-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
161 lines (134 loc) · 4.84 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
<project name="Hypnos Music Player" default="compile" basedir=".">
<property name="version" value="Beta 7 Nightly" />
<property name="version-simple" value="beta7nightly" />
<property name="version-tag" value="${version}" />
<property name="src" location="src"/>
<property name="build" location="stage/bin"/>
<property name="stage" location="stage" />
<property name="dist" location="distribution/" />
<property name="temp" location="temp" />
<property name="packaging" location="packaging/" />
<property name="jarFile" location="${stage}/hypnos.jar" />
<property name="appImageTool" location="${packaging}/appimagetool-x86_64.AppImage" />
<buildnumber file="${packaging}/build.num"/>
<path id="class.path">
<fileset dir="${stage}/lib">
<include name="**/*.jar" />
<include name="${packaging}/jres/linux-64bit/jfx/*.jar" />
</fileset>
<pathelement location="${jarFile}" />
</path>
<tstamp>
<format property="TODAY"
pattern="yyyy-MM-dd"
locale="en,US"/>
</tstamp>
<target name="init">
<tstamp />
<mkdir dir="${build}"/>
</target>
<target name="compile" depends="init" description="compile the source">
<javac fork="yes" target="11" source ="11" includeantruntime="false" srcdir="." destdir="${build}" encoding="utf-8">
<classpath refid="class.path" />
<classpath>
<fileset dir="${packaging}/jres/win-jfx-full/lib">
<include name="*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="jxgrabkey-jar" depends="compile" description="Create jxgrabkey jar.">
<jar destfile="${stage}/lib/jxgrabkey.jar" basedir="${build}/jxgrabkey">
</jar>
</target>
<target name="jar" depends="compile" description="Create a jar.">
<jar destfile="${jarFile}" basedir="${build}" excludes="jxgrabkey/**">
<manifest>
<attribute name="Main-Class" value="net.joshuad.hypnos.Hypnos" />
<attribute name="Class-Path" value="lib/commons-cli-1.4.jar
lib/commons-lang3-3.7.jar
lib/commons-text-1.1.jar
lib/fuzzywuzzy-1.1.8.jar
lib/jaudiotagger-2.2.6-SNAPSHOT.jar
lib/jsoup-1.11.2.jar
lib/jlastfm.jar
lib/jna-3.5.2.jar
lib/platform-3.5.2.jar
lib/slf4j-api-1.7.10.jar
lib/vlcj-3.10.1.jar
lib/slf4j-simple-1.6.1.jar
lib/jxgrabkey.jar
lib/win/jintellitype/jintellitype-1.3.9.jar
lib/win/swt/swt-win.jar
" />
<attribute name="Implementation-Version" value="${version}" />
<attribute name="Build-Date" value="${TODAY}" />
<attribute name="Build-Number" value="${build.number}" />
<attribute name="Hypnos" value="true" />
</manifest>
</jar>
</target>
<target name="dist-linux" depends="jar" description="Make an AppImage for 64 bit Linux">
<sequential>
<delete dir="${temp}" />
<mkdir dir="${temp}/" />
<copy todir="${temp}/Hypnos.AppDir" >
<fileset dir="packaging/Hypnos.AppDir" />
</copy>
<copy todir="${temp}/Hypnos.AppDir/usr/bin" >
<fileset dir="stage" >
<exclude name="**/config/**" />
<exclude name="**/bin/**" />
<exclude name="**/lib/win/" />
<exclude name="**/lib/osx/" />
<exclude name="**/lib/nix/vlc/.git/" />
</fileset>
<fileset dir="bin-native/linux-launch" />
</copy>
<copy todir="${temp}/Hypnos.AppDir/usr/bin/jre" >
<fileset dir="${packaging}/jres/linux" />
</copy>
<copy todir="${temp}/Hypnos.AppDir/usr/bin/jfx" >
<fileset dir="${packaging}/jres/linux-jfx" />
</copy>
<chmod file="${temp}/Hypnos.AppDir/AppRun" perm="+x" />
<chmod file="${temp}/Hypnos.AppDir/usr/bin/hypnos" perm="+x" />
<exec executable="${appImageTool}">
<arg value="-n" />
<arg value="${temp}/Hypnos.AppDir" />
<arg value="${dist}/Hypnos-nix-64bit-${version-simple}_${TODAY}_b${build.number}.AppImage" />
</exec>
<delete dir="${temp}" />
</sequential>
</target>
<target name="dist-win" depends="jar" description="Make an installer for windows.">
<delete dir="${temp}" />
<mkdir dir="${temp}/Hypnos/" />
<copy todir="${temp}/Hypnos/" >
<fileset dir="stage" >
<exclude name="**/config/**" />
<exclude name="**/bin/**" />
<exclude name="**/lib/nix/" />
<exclude name="**/lib/osx/" />
<exclude name="**/lib/jintellitype-1.3.9.jar" />
</fileset>
<fileset file="bin-native/win-launch/Hypnos.exe" />
</copy>
<copy todir="${temp}/Hypnos/jre" >
<fileset dir="${packaging}/jres/win" />
</copy>
<copy todir="${temp}/Hypnos/jfx" >
<fileset dir="${packaging}/jres/win-jfx" />
</copy>
<exec executable="makensis">
<arg value="${packaging}/nsis/hypnos.nsh" />
</exec>
<move
file="${dist}/Hypnos-Installer.exe"
tofile="${dist}/Hypnos-win-${version-simple}_${TODAY}_b${build.number}.exe"
/>
<delete dir="${temp}" />
</target>
<target name="dist-all" depends="dist-linux, dist-win" description="Make all distribution files.">
</target>
</project>