forked from pquiring/javaforce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.xml
More file actions
executable file
·183 lines (155 loc) · 6.57 KB
/
Copy pathbase.xml
File metadata and controls
executable file
·183 lines (155 loc) · 6.57 KB
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
<project xmlns:if="ant:if" xmlns:unless="ant:unless">
<!--these should be set before importing this file to override default behavior-->
<property name="apptype" value="window"/>
<property name="ico" value="${app}.ico"/>
<property name="cfg" value="${app}.cfg"/>
<property name="jarpath" value="."/>
<property name="jdkver" value="17"/>
<property name="lib" value="${home}/lib"/>
<property name="debian.depends" value="javaforce"/>
<property name="fedora.depends" value="javaforce"/>
<property name="arch.depends" value="javaforce"/>
<import file="versions.xml"/>
<target name="javadoc" description="generate java documentation">
<javadoc sourcepath="src" destdir="javadoc" additionalparam="-Xdoclint:none">
<classpath>
<fileset refid="classpath"/>
</classpath>
</javadoc>
<zip destfile="${app}-${version}-javadoc.jar">
<fileset dir="javadoc" includes="**/*"/>
</zip>
</target>
<target name="src" description="generate src archive">
<zip destfile="${app}-${version}-sources.jar">
<fileset dir="src" includes="**/*"/>
</zip>
</target>
<property environment="environment"/>
<target name="sign" description="generate asc files">
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}-sources.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}-javadoc.jar"/>
<exec command="gpg --no-tty --batch --passphrase ${environment.GPG_PASSPHRASE} -ab ${app}-${version}.pom"/>
</target>
<target name="deploy" depends="src,javadoc,jar" description="generate deployment artifacts">
<copy file="${app}.jar" tofile="${app}-${version}.jar"/>
<copy file="pom.xml" tofile="${app}-${version}.pom"/>
<antcall target="sign"/>
</target>
<target name="depnatives">
</target>
<target name="ffmpeg">
<copy todir=".">
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.dll"/>
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.so"/>
<fileset dir="${home}/ffmpeg-bin/${ffmpeg-version}" includes="*.dylib"/>
</copy>
</target>
<macrodef name="download">
<attribute name="url"/>
<attribute name="dest"/>
<sequential>
<!-- exists property is not working -->
<local name="exists"/>
<available property="exists" file="@{dest}"/>
<get unless:true="exists" src="@{url}" dest="@{dest}" usetimestamp="true"/>
</sequential>
</macrodef>
<macrodef name="maven">
<attribute name="name"/>
<attribute name="path"/>
<attribute name="version"/>
<attribute name="repo" default="https://repo1.maven.org/maven2"/>
<attribute name="dest" default="@{name}"/>
<sequential>
<download url="@{repo}/@{path}/@{name}/@{version}/@{name}-@{version}.jar" dest="${lib}/@{dest}-@{version}.jar"/>
</sequential>
</macrodef>
<macrodef name="copyjar">
<attribute name="name"/>
<attribute name="path"/>
<attribute name="version"/>
<attribute name="suffix" default=""/>
<sequential>
<copy file="${lib}/@{name}-@{version}@{suffix}.jar" tofile="@{path}/@{name}.jar"/>
</sequential>
</macrodef>
<import file="install-jars.xml"/>
<target name="executable" depends="jar,depjars,depnatives" description="create executable launcher">
<sequential>
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenExecutable" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</sequential>
</target>
<target name="graal" depends="jar,depjars" description="generate aot library">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecGraal" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="graalagent">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecGraalAgent" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="run">
<sequential>
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.ExecProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</sequential>
</target>
<!-- Windows targets -->
<target name="msi" depends="executable" description="create msi package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenMSI" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<!-- Linux targets -->
<target name="installapp" depends="executable">
<sequential>
<exec command="sudo ant -f ${ant.file} installapproot"/>
</sequential>
</target>
<target name="installapproot">
<!-- this will run "install" target in project as root including sub-projects -->
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.InstallProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="uninstallapp" depends="">
<sequential>
<exec command="sudo ant -f ${ant.file} uninstallapproot"/>
</sequential>
</target>
<target name="uninstallapproot">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.UninstallProject" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
<target name="deb" depends="installapp" description="create deb package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenDEB" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${debian.depends}"/>
</java>
</target>
<target name="rpm" depends="installapp" description="create rpm package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenRPM" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${fedora.depends}"/>
</java>
</target>
<target name="pac" depends="installapp" description="create pac package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenPAC" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
<arg value="${arch.depends}"/>
</java>
</target>
<!-- MacOSX targets -->
<target name="dmg" depends="executable" description="create dmg package">
<java classpath="${home}/javaforce.jar" classname="javaforce.utils.GenDMG" fork="true" jvm="${home}/bin/jfexec">
<arg value="${ant.file}"/>
</java>
</target>
</project>