-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.xml
executable file
·133 lines (114 loc) · 5.32 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0"?>
<project name="Teaching Kids Programming" basedir="." default="Publish TeachingKidsProgramming" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="home" value="." />
<property name="src" value="${home}/src/main/java" />
<property name="rsrc" value="${home}/src/main/resources" />
<property name="build_home" value="/tmp/builds" />
<property name="build" value="${build_home}/build" />
<property name="targetJavaClass" value="org/teachingextensions/**,you/**" />
<property name="jar" value="${build}/TeachingKidsProgramming.jar" />
<property name="tkp_workspace" value="${home}/../TeachingKidsProgramming.Java" />
<property name="tkp_project" value="${tkp_workspace}/TeachingKidsProgramming" />
<property name="documentation" value="${home}/build/resources/teaching_kids_programming" />
<property name="excludeTests" value="true" />
<!-- maven integration -->
<path id="maven-ant-tasks.classpath" path="build/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />
<artifact:pom id="tkppom" file="pom.xml" />
<artifact:dependencies filesetId="pomdeps" pomRefId="tkppom" pathId="dependency.classpath" />
<target name="cleanTeachingKidsProgramming" description="Delete generated files from Eclipse project.">
<delete dir="${tkp_project}/bin" failonerror="false" />
<delete dir="${tkp_project}/src" failonerror="false" />
<delete dir="${tkp_project}/build" failonerror="false" />
</target>
<target name="cleanUp" description="Delete files from temp build directory.">
<delete dir="${build}" />
</target>
<target name="compile" depends="cleanUp" description="Compile sources.">
<mkdir dir="${build}" />
<echo>${targetJavaClass}</echo>
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true" includes="${targetJavaClass}" target="1.7" source="1.7" listfiles="true">
<exclude name="**/tests/**" if="excludeTests" />
<classpath refid="dependency.classpath" />
</javac>
</target>
<target name="stagesrc" description="Copy source files to temp build directory.">
<mkdir dir="${build}/src" />
<mkdir dir="${build}/soundFiles"/>
<copy todir="${build}/src">
<fileset dir="${src}" includes="${targetJavaClass}/*.java">
<exclude name="**/tests/**" if="excludeTests" />
</fileset>
</copy>
<copy todir="${build}">
<fileset dir="${rsrc}" includes="*.png" />
<fileset dir="${rsrc}" includes="*.rtf" />
<!--need to fix to add .png files at /icons /> -->
</copy>
<copy toDir="${build}/soundFiles">
<fileset dir="${rsrc}/soundFiles" includes="*.wav" />
</copy>
<copy todir="${build}/src/org/teachingextensions/logo">
<fileset dir="${rsrc}" includes="*.png" />
</copy>
</target>
<target name="buildJarFile" depends="compile, stagesrc" description="Create jar file.">
<delete file="${jar}" failonerror="false" />
<jar destfile="${jar}" update="false">
<fileset dir="${build}" includes="**" />
</jar>
</target>
<target name="createTeachingKidsProgramming" depends="cleanTeachingKidsProgramming, buildJarFile" description="Copy build files to Eclipse project.">
<copy file="${build}/TeachingKidsProgramming.jar" todir="${tkp_project}/src/jars" />
<copy file="${documentation}/build.xml" todir="${tkp_project}/build" />
<copy todir="${tkp_project}/src" verbose="true">
<fileset dir="${src}">
<include name="org/teachingkidsprogramming/**/*.java" />
<include name="org/teachingkidsprogramming/**/*.docx" />
<include name="org/teachingkidsprogramming/**/*.pdf" />
<exclude name="**/tests/**" />
<exclude name="**/completed/**" />
</fileset>
</copy>
<copy todir="${tkp_project}/src/jars">
<fileset dir="build/jars" includes="*.jar"></fileset>
</copy>
<replace dir="${tkp_project}/src" token="@Ignore" value="" />
<zip destfile="${build}/tkp_workspace.v${version}.zip" basedir="${tkp_workspace}" includes="**">
</zip>
</target>
<target name="Publish TeachingKidsProgramming" description="Publish Eclipse Project">
<property file="properties/teaching_kids_programming.properties" />
<antcall target="createTeachingKidsProgramming" />
</target>
<!-- Other targets -->
<target name="createDownload" depends="buildJarFile">
<zip destfile="${zip}" basedir="${build}" includes="*.jar,*.txt">
<fileset dir="${documentation}" includes="**" />
</zip>
</target>
<target name="PublishTKPLauncher">
<property file="properties/tkplauncher.properties" />
<antcall target="buildExecutableTkpJarFile" />
</target>
<target name="buildExecutableTkpJarFile" depends="compile">
<jar destfile="${jar}/TKP_Launcher.jar" update="false">
<fileset dir="${build}" includes="**" />
<manifest>
<attribute name="Main-Class" value="org.teachingextensions.setup.SetupValidator" />
</manifest>
</jar>
</target>
<target name="Publish TKP ThumbDriveInstaller">
<property file="properties/tkplauncher.properties" />
<antcall target="buildThumbDriveInstaller" />
</target>
<target name="buildThumbDriveInstaller" depends="compile">
<jar destfile="${jar}/TKP_Installer.jar" update="false">
<fileset dir="${build}" includes="**" />
<manifest>
<attribute name="Main-Class" value="org.teachingextensions.setup.ThumbDriveInstaller" />
</manifest>
</jar>
</target>
</project>