-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
100 lines (89 loc) · 4.7 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
<project name="linoleum" default="default" basedir=".">
<description>Builds, tests, and runs the project linoleum.</description>
<target depends="zip,deb" description="Build and test whole project." name="default"/>
<property environment="env"/>
<property name="env.LINOLEUM_HOME" value="/usr/share/linoleum"/>
<property name="linoleum.home" value="${env.LINOLEUM_HOME}"/>
<property name="env.JDEB_HOME" value="/usr/share/java"/>
<property name="jdeb.home" value="${env.JDEB_HOME}"/>
<path id="linoleum.classpath">
<pathelement location="${linoleum.home}/lib/nashorn-core-15.4.jar"/>
<pathelement location="${linoleum.home}/lib/asm-7.3.1.jar"/>
<pathelement location="${linoleum.home}/lib/asm-analysis-7.3.1.jar"/>
<pathelement location="${linoleum.home}/lib/asm-commons-7.3.1.jar"/>
<pathelement location="${linoleum.home}/lib/asm-tree-7.3.1.jar"/>
<pathelement location="${linoleum.home}/lib/asm-util-7.3.1.jar"/>
<pathelement location="${linoleum.home}/linoleum.jar"/>
</path>
<target name="clean">
<linoleum file="clean.js"/>
</target>
<macrodef name="linoleum">
<attribute name="file"/>
<sequential>
<java classname="com.sun.tools.script.shell.Main" fork="true">
<sysproperty key="java.system.class.loader" value="linoleum.application.ClassLoader"/>
<classpath refid="linoleum.classpath"/>
<arg value="-f"/>
<arg value="${linoleum.home}/init.js"/>
<arg value="-f"/>
<arg value="@{file}"/>
</java>
</sequential>
</macrodef>
<property file="build.properties"/>
<target name="src">
<tar destfile="../${ant.project.name}-src.tar.gz" compression="gzip">
<tarfileset prefix="linoleum" dir="." includes="application/**,bin/**,html/**,local/**,mail/**,calendar/**,notepad/**,pkg/**,wm/**,src/**,*.js,build.properties,*.xml,manifest.mf,*.txt,Makefile" excludes="**/build/**,**/dist/**,**/private/**"/>
</tar>
</target>
<target name="jar" description="Build JAR.">
<linoleum file="build-all.js"/>
<antcall target="post-jar"/>
</target>
<target name="post-jar">
<copy todir="${dist.dir}/lib" overwrite="true">
<fileset dir="lib"/>
</copy>
<copy todir="${dist.dir}/bin" overwrite="true">
<fileset dir="bin"/>
</copy>
<chmod file="${dist.dir}/bin/linoleum" perm="+x"/>
<chmod file="${dist.dir}/bin/linoleum-headless" perm="+x"/>
<copy todir="${dist.dir}" file="init.js" overwrite="true"/>
<copy todir="${dist.dir}" file="readme.txt" overwrite="true"/>
</target>
<target name="zip" depends="jar">
<zip destfile="../${ant.project.name}.zip" basedir="${dist.dir}"/>
</target>
<target name="deb" depends="jar" description="build the deb file">
<taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpath="${jdeb.home}/jdeb.jar"/>
<deb destfile="../${ant.project.name}.deb" control="${control.dir}">
<tarfileset dir="${dist.dir}" prefix="usr/share/${ant.project.name}">
<exclude name="bin/**"/>
<exclude name="lib/javax.activation-1.2.0.jar"/>
<exclude name="lib/commons-codec-1.10.jar"/>
<exclude name="lib/ivy-2.5.0.jar"/>
<exclude name="lib/javax.mail-1.6.2.jar"/>
<exclude name="linoleum.desktop"/>
<exclude name="readme.txt"/>
</tarfileset>
<link name="/usr/share/${ant.project.name}/lib/ivy.jar" target="../../java/ivy.jar"/>
<link name="/usr/share/${ant.project.name}/lib/commons-codec.jar" target="../../java/commons-codec.jar"/>
<link name="/usr/share/${ant.project.name}/lib/javax.mail.jar" target="../../java/javax.mail.jar"/>
<link name="/usr/share/${ant.project.name}/lib/javax.activation-1.2.0.jar" target="../../java/javax.activation-1.2.0.jar"/>
<link name="/usr/share/${ant.project.name}/lib/j3dcore.jar" target="../../java/j3dcore.jar"/>
<link name="/usr/share/${ant.project.name}/lib/j3dutils.jar" target="../../java/j3dutils.jar"/>
<link name="/usr/share/${ant.project.name}/lib/vecmath.jar" target="../../java/vecmath.jar"/>
<tarfileset dir="${dist.dir}/bin" prefix="usr/share/${ant.project.name}/bin" filemode="755">
<exclude name="*.bat"/>
</tarfileset>
<link name="/usr/bin/linoleum" target="/usr/share/${ant.project.name}/bin/linoleum"/>
<link name="/usr/bin/linoleum-headless" target="/usr/share/${ant.project.name}/bin/linoleum-headless"/>
<tarfileset dir="${dist.dir}" prefix="usr/share/doc/${ant.project.name}">
<include name="readme.txt"/>
</tarfileset>
<tarfileset file="local/linoleum.desktop" prefix="usr/share/xsessions"/>
</deb>
</target>
</project>