1.1 --- a/samples/composition/build.xml Sat Jun 14 09:51:05 2008 +0200
1.2 +++ b/samples/composition/build.xml Sat Jun 14 09:51:05 2008 +0200
1.3 @@ -4,9 +4,7 @@
1.4 <delete dir="build"/>
1.5 </target>
1.6
1.7 - <target name="build">
1.8 - <ant dir="../libs/"/>
1.9 -
1.10 + <target name="build" depends="-libraries">
1.11 <antcall target="-build-one">
1.12 <param name="version" value="api1.0"/>
1.13 </antcall>
1.14 @@ -16,7 +14,7 @@
1.15
1.16 <antcall target="-build-one">
1.17 <param name="version" value="test"/>
1.18 - <param name="cp" value="build/api1.0/classes:../libs/dist/junit-4.1.jar"/>
1.19 + <param name="cp" value="build/api1.0/classes:${junit.jar}"/>
1.20 </antcall>
1.21 </target>
1.22
1.23 @@ -30,10 +28,15 @@
1.24 <param name="version" value="api2.0"/>
1.25 </antcall>
1.26 </target>
1.27 -
1.28
1.29 <!-- support methods -->
1.30
1.31 + <target name="-libraries">
1.32 + <ant dir="../libs/"/>
1.33 +
1.34 + <property name="junit.jar" location="../libs/dist/junit-4.4.jar"/>
1.35 + </target>
1.36 +
1.37 <target name="-run-one">
1.38 <fail message="You need to specify API version number" unless="version"/>
1.39 <mkdir dir="build/testresults"/>
1.40 @@ -46,7 +49,7 @@
1.41 <classpath>
1.42 <path location="build/${version}/classes"/>
1.43 <path location="build/test/classes"/>
1.44 - <path location="../libs/dist/junit-4.1.jar"/>
1.45 + <path location="${junit.jar}"/>
1.46 </classpath>
1.47 <formatter type="brief" usefile="false"/>
1.48 <formatter type="xml"/>
2.1 --- a/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 09:51:05 2008 +0200
2.2 +++ b/samples/composition/src-api1.0/api/Arithmetica.java Sat Jun 14 09:51:05 2008 +0200
2.3 @@ -5,6 +5,7 @@
2.4 * @author Jaroslav Tulach <jtulach@netbeans.org>
2.5 * @version 1.0
2.6 */
2.7 +// BEGIN: design.composition.arith1.0
2.8 public class Arithmetica {
2.9 public int sumTwo(int one, int second) {
2.10 return one + second;
2.11 @@ -27,3 +28,4 @@
2.12 return sumAll(array);
2.13 }
2.14 }
2.15 +// END: design.composition.arith1.0
3.1 --- a/samples/libs/build.xml Sat Jun 14 09:51:05 2008 +0200
3.2 +++ b/samples/libs/build.xml Sat Jun 14 09:51:05 2008 +0200
3.3 @@ -6,8 +6,8 @@
3.4
3.5 <target name="libraries">
3.6 <antcall target="-library">
3.7 - <param name="library" value="junit-4.1"/>
3.8 - <param name="url" value="junit"/>
3.9 + <param name="library" value="junit-4.4"/>
3.10 + <param name="url" value="http://switch.dl.sourceforge.net/sourceforge/junit/junit-4.4.jar"/>
3.11 </antcall>
3.12 </target>
3.13
3.14 @@ -17,16 +17,18 @@
3.15 <fail message="You need to specify library name" unless="library"/>
3.16 <fail message="You need to specify url" unless="url"/>
3.17
3.18 - <echo message="Checking for dist/${library}.jar"/>
3.19 - <available file="dist/${library}.jar" property="library.available"/>
3.20 + <property name="library.jar" location="dist/${library}.jar"/>
3.21 +
3.22 + <echo message="Checking for ${library.jar}"/>
3.23 + <available file="${library.jar}" property="library.available"/>
3.24 </target>
3.25 <target name="-library" depends="-library-check" unless="library.available">
3.26 <mkdir dir="dist"/>
3.27 - <get dest="dist/${library}" src="${url}"/>
3.28 + <get dest="${library.jar}" src="${url}"/>
3.29
3.30 <fail message="Now the library ${library} should be downloaded">
3.31 <condition>
3.32 - <available file="dist/${library}.jar"/>
3.33 + <not><available file="${library.jar}"/></not>
3.34 </condition>
3.35 </fail>
3.36 </target>