-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
160 lines (135 loc) · 5.59 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
153
154
155
156
157
158
159
160
<project name="Ceylon LLVM compiler" basedir="." default="test">
<property environment="env"/>
<property name="ceylon.home" value="${env.CEYLON_HOME}"/>
<property name="ceylon.ant.lib" value="${ceylon.home}/lib/ceylon-ant.jar"/>
<property name="ceylon.verbosity" value="false"/>
<property name="ceylon.base.version" value="1.3.4-SNAPSHOT"/>
<property name="ceylon.executable" value="${ceylon.home}/bin/ceylon"/>
<property name="out.repo" location="modules"/>
<!-- Local repository -->
<property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo" />
<property name="ceylon.bin.dir" location="${user.home}/.ceylon/bin" />
<path id="ant-tasks">
<pathelement location="${ceylon.ant.lib}"/>
</path>
<typedef resource="org/eclipse/ceylon/ant/antlib.xml" classpathref="ant-tasks"/>
<reposet id="reposet.default">
<repo url="${out.repo}"/>
</reposet>
<moduleset id="modules.source">
<module name="org.americanteeth.ceylon_llvm"/>
</moduleset>
<moduleset id="modules.test">
<module name="test.org.americanteeth.ceylon_llvm"/>
</moduleset>
<moduleset id="modules.all">
<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 the org.americanteeth.ceylon_llvm module">
<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"/>
<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>
<!-- Compiling both modules in one go is faster than depending on compile-source,compile-test -->
<target name="compile"
description="Compiles the org.americanteeth.ceylon_llvm and test modules">
<ceylon-compile executable="${ceylon.executable}"
src="${test-sources}"
out="${out.repo}"
verbose="${ceylon.verbosity}"
encoding="UTF-8">
<moduleset refid="modules.all"/>
</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 org.americanteeth.ceylon_llvm 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 org.americanteeth.ceylon_llvm module to the user's repository">
<copy todir="${ceylon.repo.dir}" overwrite="true">
<fileset dir="${out.repo}">
<include name="org/americanteeth/ceylon_llvm/**"/>
</fileset>
</copy>
<copy todir="${ceylon.bin.dir}" file="ceylon-compile-native.plugin" overwrite="true">
<filterset>
<filter token="ceylon-version" value="${ceylon.base.version}"/>
</filterset>
</copy>
<copy todir="${ceylon.bin.dir}" file="ceylon-run-native.plugin" overwrite="true">
<filterset>
<filter token="ceylon-version" value="${ceylon.base.version}"/>
</filterset>
</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.1">
<arg value="source"/>
</ceylon-run>
</target>
</project>