-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
108 lines (102 loc) · 3.57 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
<project name="wyc" default="dist">
<import file="config.xml"/>
<!-- ================================================================== -->
<!-- Build -->
<!-- ================================================================== -->
<target name="build">
<echo message="============================================="/>
<echo message="Building ${RELEASE_DIR}"/>
<echo message="============================================="/>
<echo message="Cleaning existing dir"/>
<delete dir="tmp"/>
<echo message="Making release dir"/>
<mkdir dir="${RELEASE_DIR}"/>
<mkdir dir="${RELEASE_DIR}/lib"/>
<mkdir dir="${RELEASE_DIR}/bin"/>
<mkdir dir="${RELEASE_DIR}/doc"/>
<mkdir dir="${RELEASE_DIR}/example"/>
<echo message="Copying default configuration..."/>
<copy todir="${RELEASE_DIR}">
<fileset dir=".">
<include name="wy.toml"/>
<include name="README.txt"/>
</fileset>
</copy>
<echo message="Copying dependencies..."/>
<copy todir="${RELEASE_DIR}/lib">
<fileset refid="local.dependencies"/>
<fileset refid="remote.dependencies"/>
<mapper type="flatten"/>
</copy>
<echo message="Copying scripts..."/>
<copy todir="${RELEASE_DIR}/bin">
<fileset dir="bin">
<include name="wy"/>
</fileset>
</copy>
<echo message="Copying example..."/>
<copy todir="${RELEASE_DIR}/example">
<fileset dir="example">
<include name="src/*.whiley"/>
<include name="*.html"/>
<include name="*.toml"/>
</fileset>
</copy>
<chmod verbose="Yes" perm="0544">
<fileset dir="${RELEASE_DIR}/bin">
<include name="*"/>
</fileset>
</chmod>
<echo message="Copying docs..."/>
<copy todir="${RELEASE_DIR}/doc">
<fileset dir="doc">
<include name="*.pdf"/>
</fileset>
</copy>
</target>
<!-- ================================================================== -->
<!-- WDK -->
<!-- ================================================================== -->
<target name="dist-wdk" depends="build">
<tar destfile="dist/wdk-v${version}.tar" longfile="gnu">
<tarfileset dir="dist/">
<include name="wdk-v${version}/**/*"/>
<exclude name="wdk-v${version}/bin/*"/>
<exclude name="wdk-v${version}/lib/ant*.jar"/>
</tarfileset>
<tarfileset dir="dist/" filemode="755">
<include name="wdk-v${version}/bin/*"/>
</tarfileset>
</tar>
<gzip destfile="dist/wdk-v${version}.tgz" src="dist/wdk-v${version}.tar"/>
<delete file="dist/wdk-v${version}.tar"/>
</target>
<!-- ================================================================== -->
<!-- Jar -->
<!-- ================================================================== -->
<target name="dist-jar" depends="build">
<mkdir dir="tmp"/>
<manifest file="tmp/MANIFEST.MF">
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="wycc.WyMain"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
<unzip dest="tmp">
<patternset>
<exclude name="org/**"/>
</patternset>
<fileset refid="local.dependencies"/>
<fileset refid="remote.dependencies"/>
</unzip>
<jar destfile="dist/wycc-all-v${version}.jar" manifest="tmp/MANIFEST.MF">
<fileset dir="tmp">
<include name="**/*"/>
</fileset>
</jar>
</target>
<!-- ================================================================== -->
<!-- Dist -->
<!-- ================================================================== -->
<target name="dist" depends="dist-wdk,dist-jar">
</target>
</project>