-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
140 lines (121 loc) · 6.15 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
133
134
135
136
137
138
139
140
<?xml version="1.0" encoding="utf-8"?>
<project name="SFML java" default="info">
<property name="src.dir" value="src" />
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="output.dir" value="output" />
<property name="source.repository" value="https://github.com/kalimatas/sfmlbook-java.git" />
<target name="info" description="Get project information">
<echo>Java port of the SFML book source code</echo>
<echo />
<echo>Repository: ${source.repository}</echo>
</target>
<target name="01_Intro" depends="create-dirs" description="Generate JAR for chapter 1">
<echo>Generating JAR for "Chapter 01"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c01_Intro" />
<param name="chapter.main" value="com.github.kalimatas.c01_Intro.Intro" />
<param name="chapter.executable" value="01_intro.jar" />
</antcall>
</target>
<target name="02_Resources" depends="create-dirs" description="Generate JAR for chapter 2">
<echo>Generating JAR for "Chapter 02"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c02_Resources" />
<param name="chapter.main" value="com.github.kalimatas.c02_Resources.Resources" />
<param name="chapter.executable" value="02_resources.jar" />
</antcall>
</target>
<target name="03_World" depends="create-dirs" description="Generate JAR for chapter 3">
<echo>Generating JAR for "Chapter 03"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c03_World" />
<param name="chapter.main" value="com.github.kalimatas.c03_World.WorldRun" />
<param name="chapter.executable" value="03_world.jar" />
</antcall>
</target>
<target name="04_Input" depends="create-dirs" description="Generate JAR for chapter 4">
<echo>Generating JAR for "Chapter 04"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c04_Input" />
<param name="chapter.main" value="com.github.kalimatas.c04_Input.Main" />
<param name="chapter.executable" value="04_input.jar" />
</antcall>
</target>
<target name="05_States" depends="create-dirs" description="Generate JAR for chapter 5">
<echo>Generating JAR for "Chapter 05"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c05_States" />
<param name="chapter.main" value="com.github.kalimatas.c05_States.Main" />
<param name="chapter.executable" value="05_states.jar" />
</antcall>
</target>
<target name="06_Menus" depends="create-dirs" description="Generate JAR for chapter 6">
<echo>Generating JAR for "Chapter 06"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c06_Menus" />
<param name="chapter.main" value="com.github.kalimatas.c06_Menus.Main" />
<param name="chapter.executable" value="06_menus.jar" />
</antcall>
</target>
<target name="07_Gameplay" depends="create-dirs" description="Generate JAR for chapter 7">
<echo>Generating JAR for "Chapter 07"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c07_Gameplay" />
<param name="chapter.main" value="com.github.kalimatas.c07_Gameplay.Main" />
<param name="chapter.executable" value="07_gameplay.jar" />
</antcall>
</target>
<target name="08_Graphics" depends="create-dirs" description="Generate JAR for chapter 8">
<echo>Generating JAR for "Chapter 08"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c08_Graphics" />
<param name="chapter.main" value="com.github.kalimatas.c08_Graphics.Main" />
<param name="chapter.executable" value="08_graphics.jar" />
</antcall>
</target>
<target name="09_Audio" depends="create-dirs" description="Generate JAR for chapter 9">
<echo>Generating JAR for "Chapter 09"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c09_Audio" />
<param name="chapter.main" value="com.github.kalimatas.c09_Audio.Main" />
<param name="chapter.executable" value="09_audio.jar" />
</antcall>
</target>
<target name="10_Network" depends="create-dirs" description="Generate JAR for chapter 10">
<echo>Generating JAR for "Chapter 10"</echo>
<antcall target="build">
<param name="chapter.dir" value="com/github/kalimatas/c10_Network" />
<param name="chapter.main" value="com.github.kalimatas.c10_Network.Main" />
<param name="chapter.executable" value="10_network.jar" />
</antcall>
</target>
<target name="build">
<delete dir="${build.dir}/${chapter.dir}" />
<delete file="${output.dir}/${chapter.executable}" />
<javac destdir="${build.dir}"
srcdir="${src.dir}/${chapter.dir}"
classpath="${lib.dir}/jsfml.jar" />
<copy todir="${build.dir}/${chapter.dir}/Media" overwrite="true">
<fileset dir="${src.dir}/${chapter.dir}/Media/" />
</copy>
<jar destfile="${output.dir}/${chapter.executable}" basedir="${build.dir}">
<fileset dir="${build.dir}/${chapter.dir}">
<exclude name="Media/**" />
<exclude name="**/*.class" />
</fileset>
<zipfileset src="${lib.dir}/jsfml.jar" />
<manifest>
<attribute name="Main-Class" value="${chapter.main}" />
</manifest>
</jar>
</target>
<target name="clean-all" description="Clean output directories">
<delete dir="${build.dir}" />
<delete dir="${output.dir}" />
</target>
<target name="create-dirs">
<mkdir dir="${build.dir}" />
<mkdir dir="${output.dir}" />
</target>
</project>