forked from fourthline/mmlTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
185 lines (174 loc) · 7.11 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="MabiIcco" basedir="." default="jar"
xmlns:fx="javafx:com.sun.javafx.tools.ant">
<!-- 環境変数 -->
<property environment="env" />
<!--property name="env.JAVA_HOME" value="C:\Program Files\BellSoft\LibericaJDK-8-Full" /-->
<!-- ビルド設定 -->
<property name="build.src.dir" value="src"/>
<property name="build.classes.dir" value="classes"/>
<property name="build.dist.dir" value="dist"/>
<property name="build.test.dir" location="test" />
<property name="build.lib.dir" location="lib" />
<property name="build.properties.dir" location="properties" />
<!-- アプリケーションの設定 -->
<property name="app.vendor" value="fourthline" />
<property name="app.id" value="MabiIcco" />
<property name="app.name" value="MabiIcco" />
<property name="app.version" value="1.0.41" />
<property name="app.description" value="MML Editor for Mabinogi / MapleStory2"/>
<property name="app.main-class" value="fourthline.mabiicco.MabiIcco" />
<property name="app.preloader-class" value="fourthline.mabiicco.preloader.MabiIccoPreloader" />
<property name="app.splash.image" value="img/title.png" />
<!-- 依存ライブラリのパス設定 -->
<path id="classpath">
<pathelement location="${build.lib.dir}/commons-compress/commons-compress-1.20.jar"/>
<pathelement location="com.sun.media.sound"/>
</path>
<!-- テスト用ライブラリのパス設定 -->
<path id="classpath-test">
<pathelement location="${build.lib.dir}/junit-4.13.jar"/>
<pathelement location="${build.lib.dir}/hamcrest-2.2.jar"/>
<pathelement location="${build.lib.dir}/hamcrest-core-2.2.jar"/>
</path>
<!-- JavaFXのパス設定 -->
<path id="fxant">
<filelist>
<file name="${java.home}\..\lib\ant-javafx.jar"/>
<file name="${java.home}\lib\ext\jfxrt.jar"/>
</filelist>
</path>
<!-- clean task -->
<target name="clean">
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${build.dist.dir}"/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*"/>
<fileset dir="${build.dist.dir}" includes="**/*"/>
</delete>
</target>
<!-- compile task -->
<target name="compile" depends="clean">
<javac includeantruntime="false" srcdir="${build.src.dir}" destdir="${build.classes.dir}" encoding="UTF-8" listfiles="yes" fork="yes" classpathref="classpath" source="8" debug="on">
<compilerarg value="-Xlint:deprecation" />
<compilerarg value="-XDignore.symbol.file" />
<exclude name="**/package-info.java,com/,fourthline/mabiicco/fx/"/>
</javac>
<copy todir="${build.classes.dir}">
<fileset dir="${build.src.dir}">
<include name="**/*.png" />
<include name="**/*.fxml" />
<include name="**/*.css" />
<exclude name="fourthline/mabiicco/fx/" />
</fileset>
</copy>
</target>
<!-- build jar file task -->
<target name="jar" depends="compile">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpathref="fxant"/>
<fx:jar destfile="${build.dist.dir}/${app.id}.jar">
<fx:application name="${app.name}" version="${app.version}" mainClass="${app.main-class}" preloaderClass="${app.preloader-class}" />
<manifest>
<attribute name="Implementation-Vendor" value="${app.vendor}" />
<attribute name="Implementation-Title" value="${app.name}" />
<attribute name="MabiIcco-Version" value="${app.version}" />
<attribute name="SplashScreen-Image" value="${app.splash.image}" />
<attribute name="Class-Path" value="${app.main-class}" />
</manifest>
<fileset dir="${build.classes.dir}" />
</fx:jar>
</target>
<!-- compile-test task -->
<target name="compile-test" depends="clean">
<javac includeantruntime="false" destdir="${build.classes.dir}" encoding="UTF-8" listfiles="yes" fork="yes" classpathref="classpath" source="8" debug="on">
<compilerarg value="-Xlint:deprecation" />
<compilerarg value="-XDignore.symbol.file" />
<src path="${build.src.dir}" />
<src path="${build.test.dir}" />
<classpath refid="classpath-test" />
</javac>
<copy todir="${build.classes.dir}">
<fileset dir="${build.test.dir}">
<include name="**/*.mml" />
<include name="**/*.mms" />
<include name="**/*.mmi" />
<include name="**/*.mid" />
<include name="**/*.txt" />
</fileset>
</copy>
</target>
<!-- test task -->
<target name="test" depends="compile-test">
<junit printsummary="no">
<classpath>
<path refid="classpath"/>
<path refid="classpath-test"/>
<pathelement path="${build.classes.dir}"/>
</classpath>
<formatter type="xml" />
<batchtest todir="${build.classes.dir}">
<fileset dir="${build.test.dir}" includes="**/*Test.java">
<exclude name="fourthline/mabiicco/midi/MabiDLSTest.java"/>
<exclude name="fourthline/mabiicco/ui/MMLSeqViewTest.java"/>
<exclude name="fourthline/mabiicco/ui/MainFrameTest.java"/>
<exclude name="fourthline/mabiicco/ui/editor/KeyboardEditorTest.java"/>
<exclude name="fourthline/mabiicco/ui/editor/MMLEditorTest.java"/>
<exclude name="fourthline/mmlTools/MMLScoreTest.java"/>
<exclude name="fourthline/mmlTools/parser/MMLFileTest.java"/>
<exclude name="fourthline/mmlTools/parser/MMSFileTest.java"/>
<exclude name="fourthline/mmlTools/parser/MidiFileTest.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Deploy Task -->
<target name="deploy" depends="jar">
<fx:deploy outdir="." outfile="${app.name}" nativeBundles="all" offlineAllowed="true">
<!--fx:platform>
<fx:jvmuserarg name="-Xms" value="31m"/>
<fx:jvmuserarg name="-Xmx" value="64m"/>
</fx:platform-->
<fx:application name="${app.name}" version="${app.version}" mainClass="${app.main-class}" preloaderClass="${app.preloader-class}" />
<fx:resources>
<fx:fileset dir="${basedir}" includes="properties/*"/>
<fx:fileset dir="${build.dist.dir}" includes="*.jar"/>
<fx:fileset dir="${build.lib.dir}/commons-compress" includes="*.jar"/>
</fx:resources>
<fx:info title="${app.name}" vendor="${app.vendor}" description="${app.description}">
<fx:icon href="${basedir}/resources/MabiIcco.ico"/>
<!-- WiX Toolset Required for File association. -->
<fx:association extension="mmi" description="MabiIcco MML File" mimetype="text/x-mabiicco-mml" icon="${basedir}/resources/mmi.ico" />
</fx:info>
<fx:preferences install="false" shortcut="true"/>
</fx:deploy>
</target>
<!-- Deploy using exewrap task. -->
<target name="exewrap" depends="jar">
<exec executable="lib/exewrap/x64/exewrap.exe">
<arg value="-g"/>
<arg value="-d"/>
<arg value="${app.description}" />
<arg value="-c"/>
<arg value="${app.vendor}" />
<arg value="-t"/>
<arg value="1.8"/>
<arg value="-M"/>
<arg value="${app.main-class}"/>
<arg value="-i"/>
<arg value="resources\MabiIcco.ico"/>
<arg value="-p" />
<arg value="${app.name}"/>
<arg value="-v" />
<arg value="${app.version}"/>
<arg value="-V" />
<arg value="${app.version}"/>
<arg value="-D"/>
<arg value="java.library.path=${env.JAVA_HOME}\jre\bin"/>
<arg value="-j"/>
<arg value="${app.name}.jar"/>
<arg value="-o"/>
<arg value="${app.name}.exe"/>
<arg value="-a"/>
</exec>
</target>
</project>