forked from pquiring/javaforce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·145 lines (127 loc) · 5.72 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
<project name="javaforce" default="jar" basedir=".">
<description>JavaForce SDK</description>
<!-- set global properties for this build -->
<property name="app" value="javaforce"/>
<property name="src" location="src"/>
<property name="build" location="classes"/>
<property name="home" value="."/>
<property name="version" value="17.5.0"/>
<property name="noelf" value="true"/>
<property name="debian.depends" value="default-jre-headless, libjsch-java, libjzlib-java, libjcifs-java, libv4l-0, desktop-file-utils"/>
<property name="fedora.depends" value="java-1.8.0-openjdk, jsch, jzlib, jcifs, libv4l, desktop-file-utils"/>
<property name="arch.depends" value="jre8-openjdk, java-jsch, v4l-utils, desktop-file-utils"/> <!-- missing jzlib jcifs -->
<property environment="env"/>
<import file="base.xml"/>
<available property="have_glfw" file="native/glfw/src/window.c"/>
<target name="glfw" unless="have_glfw" description="download glfw">
<exec command="git clone https://github.com/glfw/glfw.git native/glfw"/>
</target>
<target name="depjars" depends="depnatives,glfw">
</target>
<target name="compile" depends="depjars" description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<mkdir dir="${build}"/>
<mkdir dir="jars"/>
<javac srcdir="${src}" destdir="${build}" target="1.9" source="1.9" debug="true" includeantruntime="false" nativeheaderdir="native/headers">
<compilerarg value="-Xlint:unchecked"/>
<classpath>
<fileset dir="jars" includes="*.jar"/>
</classpath>
</javac>
</target>
<target name="jar" depends="depjars,compile" description="build jar file">
<!-- Build jar file from class files -->
<jar destfile="jars/javaforce.jar" includes="**/*.class" basedir="${build}">
<fileset dir="${src}">
<include name="**/*.png"/>
<include name="**/*.html"/>
<include name="**/*.js"/>
<include name="**/*.css"/>
</fileset>
</jar>
</target>
<target name="javadoc" description="generate java documentation">
<javadoc sourcepath="src" destdir="javadoc">
<classpath>
<fileset dir="jars" includes="*.jar"/>
</classpath>
</javadoc>
</target>
<!-- sudo ant install -->
<target name="install" description="install files">
<copy file="jars/javaforce.jar" todir="/usr/share/java"/>
<copy file="jars/bouncycastle.jar" todir="/usr/share/java"/>
<copy file="jars/filters.jar" todir="/usr/share/java"/>
<copy file="native/jfnative${bits}.so" todir="/usr/lib"/>
<copy file="lnxbin/jbus-call" todir="/usr/bin"/>
<chmod file="/usr/bin/jbus-call" perm="+x"/>
<copy file="lnxbin/jbus-client" todir="/usr/bin"/>
<chmod file="/usr/bin/jbus-client" perm="+x"/>
<elf appx="jfsudo" cfgdir="cfg/"/>
<elf appx="jfsudo-ask" cfgdir="cfg/"/>
<elf appx="jfopen" cfgdir="cfg/"/>
<elf appx="jfs" cfgdir="cfg/"/>
<elf appx="jfimageconvert" cfgdir="cfg/"/>
<elf appx="jfr" cfgdir="cfg/"/>
<elf appx="pngalpha" cfgdir="cfg/"/>
<elf appx="jf-update-desktop-database" cfgdir="cfg/"/>
<elf appx="jsmbget" cfgdir="cfg/"/>
<elf appx="jservice" cfgdir="cfg/"/>
<elf appx="jf-monitor-dir" cfgdir="cfg/"/>
<elf appx="jfshare" cfgdir="cfg/"/>
<elf appx="jcp" cfgdir="cfg/"/>
<elf appx="jmv" cfgdir="cfg/"/>
<elf appx="jrm" cfgdir="cfg/"/>
<elf appx="jfver" cfgdir="cfg/"/>
<elf appx="jfresmgr" cfgdir="cfg/"/>
</target>
<macrodef name="utilsmacro">
<attribute name="app"/>
<attribute name="bits"/>
<sequential>
<copy file="${home}/stubs/win@{bits}c.exe" tofile="@{app}.exe" overwrite="true"/>
<java classpath="${home}/jars/javaforce.jar" classname="javaforce.utils.WinPE" fork="true">
<arg value="@{app}.exe"/>
<arg value="cfg/@{app}.cfg"/>
</java>
</sequential>
</macrodef>
<target name="utils" depends="jar" description="build exe for utils 64bit">
<utilsmacro app="jfr" bits="64"/>
<utilsmacro app="jfs" bits="64"/>
<utilsmacro app="jfimageconvert" bits="64"/>
<utilsmacro app="pngalpha" bits="64"/>
<utilsmacro app="jfshare" bits="64"/>
<utilsmacro app="WinPE" bits="64"/>
</target>
<target name="jre-base-desktop" description="build JRE for bundled JRE builds with desktop (swing) support">
<exec command="jlink --module-path ${env.JAVA_HOME}/jmods --add-modules java.base,java.desktop,java.sql --output jre_base_desktop"/>
<delete>
<fileset dir="jre_base_desktop/bin" includes="java**.exe"/>
<fileset dir="jre_base_desktop/legal" includes="**/*"/>
<fileset dir="jre_base_desktop/include" includes="**/*"/>
</delete>
</target>
<target name="jre-base" description="build JRE for bundled JRE builds with only base">
<exec command="jlink --module-path ${env.JAVA_HOME}/jmods --add-modules java.base,java.sql --output jre_base"/>
<delete>
<fileset dir="jre_base/bin" includes="java**.exe"/>
<fileset dir="jre_base/legal" includes="**/*"/>
<fileset dir="jre_base/include" includes="**/*"/>
</delete>
</target>
<target name="jre-base-javac" description="build JRE for bundled JRE builds with base and Java compiler">
<exec command="jlink --module-path ${env.JAVA_HOME}/jmods --add-modules java.base,java.sql,jdk.compiler,jdk.jartool,jdk.zipfs --output jre_base_javac"/>
<delete>
<fileset dir="jre_base_javac/bin" includes="java**.exe"/>
<fileset dir="jre_base_javac/legal" includes="**/*"/>
<fileset dir="jre_base_javac/include" includes="**/*"/>
</delete>
</target>
<target name="clean" description="deletes compiled files">
<delete>
<fileset dir="classes" includes="**/*.class"/>
<fileset dir="jars" includes="javaforce.jar"/>
</delete>
</target>
</project>