-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
105 lines (91 loc) · 2.92 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="smudgr" default="launch" basedir=".">
<property name="class" value="io.smudgr.test.SkyShowApp"/>
<condition property="isMac">
<os family="mac" />
</condition>
<condition property="isWindows">
<os family="windows" />
</condition>
<path id="classpath">
<fileset dir="." includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="bin"/>
<delete dir="builds/osx"/>
<delete dir="builds/win"/>
<delete file="builds/smudgr.jar"/>
</target>
<target name="compile">
<delete dir="bin"/>
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin" classpathref="classpath" includeantruntime="false"/>
<jar jarfile="builds/smudgr.jar" includes="**/**" basedir="bin" />
</target>
<target name="run" depends="compile">
<java classname="${class}"
fork="true"
classpath="bin:lib/*:builds/win64/bin/*"/>
</target>
<target name="buildJar" depends="compile">
<path id="build-classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<manifestclasspath property="lib.list" jarfile="smudgr.jar">
<classpath refid="build-classpath"/>
</manifestclasspath>
<jar jarfile="builds/smudgr.jar"
basedir="bin"
includes="**/**" >
<manifest>
<attribute name="Main-Class" value="io.smudgr.app.smudgr"/>
<attribute name="Class-Path" value="${lib.list}"/>
</manifest>
</jar>
</target>
<target name="winBuild" if="isWindows">
<mkdir dir="builds/win" />
</target>
<target name="osxBuild" if="isMac">
<mkdir dir="builds/osx" />
<mkdir dir="data/included" />
<exec dir="./app" executable="npm">
<arg line="install" />
</exec>
<exec dir="." executable="ditto">
<arg line="app/node_modules/electron/dist/Electron.app" />
<arg line="builds/osx/smudgr.app" />
</exec>
<exec dir="." executable="ditto">
<arg line="app/ui" />
<arg line="builds/osx/smudgr.app/Contents/Resources/app/ui" />
</exec>
<copy file="app/package.json" todir="builds/osx/smudgr.app/Contents/Resources/app" />
<copy file="app/index.js" todir="builds/osx/smudgr.app/Contents/Resources/app" />
<copy file="builds/smudgr.jar" todir="builds/osx/smudgr.app/Contents/Resources/app/java" />
<copy todir="builds/osx/smudgr.app/Contents/Resources/app/java/lib">
<path>
<fileset dir="lib">
<include name="*"/>
</fileset>
</path>
</copy>
<copy todir="builds/osx/smudgr.app/Contents/Resources/app/data">
<path>
<fileset dir="data/included">
<include name="*"/>
</fileset>
</path>
</copy>
</target>
<target name="build" depends="clean, buildJar, winBuild, osxBuild" />
<target name="launch" depends="build, windowsLaunch, macLaunch" />
<target name="windowsLaunch" if="isWindows">
<echo>Not yet implemented..</echo>
</target>
<target name="macLaunch" if="isMac">
<echo>Not yet implemented...</echo>
</target>
</project>