-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
152 lines (126 loc) · 4.89 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
146
147
148
149
150
151
152
<project name="Snopts" basedir="." default="test">
<property file="build.properties" />
<property name="ceylon.verbosity" value="false"/>
<property name="ceylon.executable" value="${dist.bin.dir}/ceylon"/>
<property name="out.repo" location="modules"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="${dist.root.dir}/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- Local repository -->
<property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo" />
<path id="ant-tasks">
<pathelement location="${ceylon.ant.lib}"/>
</path>
<typedef resource="com/redhat/ceylon/ant/antlib.xml" classpathref="ant-tasks"/>
<reposet id="reposet.default">
<repo url="${out.repo}"/>
</reposet>
<moduleset id="modules.source">
<module name="herd.snopts"/>
</moduleset>
<moduleset id="modules.test">
<module name="test.herd.snopts"/>
</moduleset>
<moduleset id="modules.snopts">
<moduleset refid="modules.source"/>
<moduleset refid="modules.test"/>
</moduleset>
<target name="clean"
description="Deletes the modules directory">
<delete dir="${out.repo}"/>
</target>
<target name="compile-source"
description="Compiles Snopts">
<ceylon-compile executable="${ceylon.executable}"
verbose="${ceylon.verbosity}"
encoding="UTF-8"
pack200="true"
out="${out.repo}">
<moduleset refid="modules.source"/>
</ceylon-compile>
</target>
<path id="test-sources-path">
<pathelement location="source"/>
</path>
<property name="test-sources" refid="test-sources-path"/>
<!-- Compiling both modules in one go is faster than depending on compile-source,compile-test -->
<target name="compile-test"
description="Compiles the test module" >
<ceylon-compile executable="${ceylon.executable}"
src="${test-sources}"
out="${out.repo}"
verbose="${ceylon.verbosity}"
encoding="UTF-8">
<reposet refid="reposet.default"/>
<moduleset refid="modules.test"/>
</ceylon-compile>
</target>
<target name="compile"
description="Compiles the Snopts and test modules">
<ceylon-compile executable="${ceylon.executable}"
src="${test-sources}"
out="${out.repo}"
verbose="${ceylon.verbosity}"
encoding="UTF-8">
<moduleset refid="modules.snopts"/>
</ceylon-compile>
</target>
<target name="test" depends="compile"
description="Runs the compiled test module">
<ceylon-test>
<reposet refid="reposet.default"/>
<moduleset refid="modules.test"/>
</ceylon-test>
</target>
<target name="doc"
description="Documents the Snopts module">
<ceylon-doc executable="${ceylon.executable}"
includesourcecode="true"
nomtimecheck="true"
encoding="UTF-8">
<moduleset refid="modules.source"/>
<linkset>
<link pattern="ceylon" url="http://modules.ceylon-lang.org/1/"/>
</linkset>
</ceylon-doc>
</target>
<target name="publish" depends="compile-source"
description="Copies the Snopts module to the user's repository">
<copy todir="${ceylon.repo.dir}" overwrite="true">
<fileset dir="${out.repo}">
<include name="herd/snopts/**"/>
</fileset>
</copy>
</target>
<target name="publish-herd">
<fail message="Please specify a target Herd upload repo url with -Dherd.repo=..." unless="herd.repo"/>
<fail message="Please specify a target Herd user name with -Dherd.user=..." unless="herd.user"/>
<fail message="Please specify a target Herd password with -Dherd.pass=..." unless="herd.pass"/>
<ceylon-compile executable="${ceylon.executable}"
verbose="${ceylon.verbosity}"
out="${herd.repo}"
user="${herd.user}"
pass="${herd.pass}"
encoding="UTF-8">
<moduleset refid="modules.source"/>
</ceylon-compile>
<ceylon-doc executable="${ceylon.executable}"
includesourcecode="true"
nomtimecheck="true"
out="${herd.repo}"
user="${herd.user}"
pass="${herd.pass}"
encoding="UTF-8">
<moduleset refid="modules.source"/>
<rep url="https://modules.ceylon-lang.org/repo/1/"/>
</ceylon-doc>
</target>
<target name="format"
description="formats the source code">
<ceylon-run module="ceylon.formatter/1.1.0">
<arg value="source"/>
</ceylon-run>
</target>
</project>