-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-shell.xml
39 lines (34 loc) · 1.48 KB
/
build-shell.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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project>
<project name="shell">
<property name="shell.dir" value="${resource.dir}/shell" />
<!-- Shell File Macros -->
<macrodef name="shell-cmd">
<attribute name="name" />
<attribute name="todir" default="." />
<attribute name="mainclass" default="net.mtrop.doom.tools.DoomToolsMain" />
<attribute name="options" default="" />
<attribute name="exename" default="java" />
<attribute name="src" default="${shell.dir}/jar/app-name.cmd" />
<sequential>
<delete file="@{todir}/@{name}.cmd" failonerror="false" />
<copy file="@{src}" tofile="@{todir}/@{name}.cmd" />
<replace file="@{todir}/@{name}.cmd" token="{{JAVA_OPTIONS}}" value="@{options}" />
<replace file="@{todir}/@{name}.cmd" token="{{MAIN_CLASSNAME}}" value="@{mainclass}" />
<replace file="@{todir}/@{name}.cmd" token="{{JAVA_EXENAME}}" value="@{exename}" />
</sequential>
</macrodef>
<macrodef name="shell-bash">
<attribute name="name" />
<attribute name="todir" default="." />
<attribute name="mainclass" />
<attribute name="options" default="" />
<sequential>
<delete file="@{todir}/@{name}" failonerror="false" />
<copy file="${shell.dir}/jar/app-name.sh" tofile="@{todir}/@{name}" />
<replace file="@{todir}/@{name}" token="{{JAVA_OPTIONS}}" value="@{options}" />
<replace file="@{todir}/@{name}" token="{{MAIN_CLASSNAME}}" value="@{mainclass}" />
<chmod file="@{todir}/@{name}" perm="ugo+rx"/>
</sequential>
</macrodef>
</project>