[prev in list] [next in list] [prev in thread] [next in thread] 

List:       binarycloud-dev
Subject:    [binarycloud-dev] Ant Build file for binarycloud
From:       binarycloud-dev-admin () lists ! sourceforge ! net
Date:       2001-10-09 13:33:40
[Download RAW message or body]

Hi All,

I've done a very simple ant build file for binarycloud to see how things
work. It's not very complex as I played around only for an hour or so.

It currently does make only the binarycloud core stuff in given languages
(the language thing is not well done, see build.sh) but it should give you
an idea how it works.
I also listed the packaged file by hand for illustration purposes - this can
be done more flexible and with less code and admin overhead using patterns,
conditions etc.

To test things out you need a properly installed ant (see other mail on this
topic).

Copy

build.sh
build.xml

to r2/binarycloud/

chmod +x build.sh and execute, or call "sh build.sh" and see what happens
(the build goes to "./testbuild).

Andi

["build.sh" (application/octet-stream)]

#!/bin/sh
# simple startup of build process, requires ant to be installed
# ant env var $ANT_HOME set properly

#
# The language detection should be done within  ant|phpant|make whatever
# Was just to lazy now
#

LANGS="da en"

for i in ${LANGS}
do
	BCLANG=$i;
	export BCLANG;
	$ANT_HOME/bin/ant -quiet
done

["build.xml" (text/xml)]

<project name="binarycloud" default="binarycloud" basedir=".">
	<description>
	This buildfile is toplevel buildfile used to build the core and 
	other subprojects (sites) within the large, complex binarycloud 
	project.
	</description>

	<property environment="env" />

	<!-- source tree properties -->
	<property name="src.core" value="base/core" />
	<property name="src.mgr" value="base/mgr" />
	<property name="src.lib" value="base/lib" />
	<property name="src.mod" value="base/mod" />
	<property name="src.init" value="base/init" />
	<property name="src.ext" value="ext" />

	<!-- build tree properties -->
	<property name="build.dir" value="testbuild" />

	<!-- 
	we use the env var BCLANG to determine the current 
	language to build 
	-->
	<property name="build.lang" value="${env.BCLANG}" />

	<property name="binarycloud.core" value="${build.dir}/${build.lang}/binarycloud/core" />
	<property name="binarycloud.mgr" value="${build.dir}/${build.lang}/binarycloud/mgr" />	
	<property name="binarycloud.init" value="${build.dir}/${build.lang}/binarycloud/init" />	
	<property name="binarycloud.lib" value="${build.dir}/${build.lang}/binarycloud/lib" />	
	<property name="binarycloud.mod" value="${build.dir}/${build.lang}/binarycloud/mod" />	

	<!-- 
	This is a file by file listing for the core files. It can be replaced 
	by i.e. wildcards (see patternset phpfiles)
	-->
	<patternset id="packaged.core.files" >
		<include name="**/Auth.php" /> 
		<include name="**/Lang.php" /> 
		<include name="**/Page.php" /> 
		<include name="**/Perm.php" /> 
		<include name="**/Request.php" /> 
		<include name="**/Sess.php" /> 
		<include name="**/Debug.php" /> 
	</patternset>

	<patternset id="packaged.init.files" >
		<include name="**/Init.php" /> 
	</patternset>

	<patternset id="packaged.mgr.files" >
		<include name="**/CacheManager.php" /> 
		<include name="**/QueryManager.php" /> 
	</patternset>

	<patternset id="packaged.lib.files" >
		<include name="**/XMLUtils.php" /> 
		<include name="**/ClientSniffer.php" /> 
		<include name="**/Timer.php" /> 
	</patternset>

	<patternset id="packaged.mod.files" >
		<include name="**/bcc/*.php" /> 
	</patternset>

	<!--
	This matches all php files 
	-->
	<patternset id="phpfiles" >
		<include name="**/*.php"/>
	</patternset>

	<target name="prepare">
	    <echo message="Building ${ant.project.name} in ${build.dir}/${build.lang}" />
		<mkdir dir="${build.dir}/en" />
		<tstamp />
	</target>

	<!-- 
	Make the target binarycloud, this means in essence all core stuff.
	You don't have to make changes here.
	If you want to modify files deployed, see the patternsets above
	-->
	<target name="binarycloud" depends="prepare">
		<!-- create necessary dirs if not already there -->
		<echo message="Creating directories..." />
		<mkdir dir="${binarycloud.core}" />
		<mkdir dir="${binarycloud.mgr}" />
		<mkdir dir="${binarycloud.init}" />
		<mkdir dir="${binarycloud.lib}" />
		<mkdir dir="${binarycloud.mod}" />

		<!-- copy over the core files -->
		<echo message="Files in ${binarycloud.core}" />
		<copy todir="${binarycloud.core}">
			<fileset dir="${src.core}">
				<patternset refid="packaged.core.files" />
			</fileset>
		</copy>

		<!-- copy over the init files -->
		<echo message="Files in ${binarycloud.init}" />
		<copy todir="${binarycloud.init}">
			<fileset dir="${src.init}">
				<patternset refid="packaged.init.files" />
			</fileset>
		</copy>

		<!-- the managers -->
		<echo message="Files in ${binarycloud.mgr}" />
		<copy todir="${binarycloud.mgr}">
			<fileset dir="${src.mgr}">
				<patternset refid="packaged.mgr.files" />
			</fileset>
		</copy>

		<!-- the lib -->
		<echo message="Files in ${binarycloud.lib}" />
		<copy todir="${binarycloud.lib}">
			<fileset dir="${src.lib}">
				<patternset refid="packaged.lib.files" />
			</fileset>
		</copy>

		<!-- the modules  -->
		<echo message="Files in ${binarycloud.lib}" />
		<copy todir="${binarycloud.mod}">
			<fileset dir="${src.mod}">
				<patternset refid="packaged.mod.files" />
			</fileset>
		</copy>

		<!-- fix permissions of php files-->
		<echo message="Fixing file permissions..." />
		<chmod perm="u=rw,g=r,o=r">
			<fileset dir="${build.dir}">
				<patternset refid="phpfiles" />
			</fileset>
		</chmod>

		<!-- fix permissions of directories -->
		<echo message="Fixing directory permissions..." />
		<chmod perm="u=rwx,g=rx,o=rx" type="dir">
			<fileset dir="${build.dir}">
				<include name="**/*" />
			</fileset>
		</chmod>

	</target>

</project>









_______________________________________________
binarycloud-dev mailing list
binarycloud-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/binarycloud-dev
http://www.binarycloud.com
http://www.sf.net/projects/binarycloud/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic