-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.xml
More file actions
190 lines (169 loc) · 7.3 KB
/
build.xml
File metadata and controls
190 lines (169 loc) · 7.3 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<project name="Ceylon Common module" default="publish" basedir=".">
<property file="user-build.properties" />
<property file="common-build.properties" />
<property file="build.properties" />
<!-- Set build directories for all formats. -->
<property name="build.dir" value="${basedir}/build" />
<property name="build.bin" value="${build.dir}/bin" />
<property name="build.dist" value="${build.dir}/dist" />
<property name="build.dist.repo" value="${build.dist}/repo" />
<property name="build.classes" location="${build.dir}/classes" />
<property name="src" location="src" />
<property name="test.src" location="test/src" />
<property name="test.reports" location="${build.dir}/test-reports" />
<!-- Local repository -->
<property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo" />
<property name="ceylon.bin.dir" location="${user.home}/.ceylon/bin" />
<property name="ceylon.common.dir" value="com/redhat/ceylon/common/${module.com.redhat.ceylon.common.version}" />
<property name="ceylon.common.jar" value="${ceylon.common.dir}/com.redhat.ceylon.common-${module.com.redhat.ceylon.common.version}.jar" />
<property name="ceylon.common.lib" location="${ceylon.repo.dir}/${ceylon.common.jar}" />
<property name="ceylon.common.repo" value="${ceylon.repo.dir}/${ceylon.common.dir}" />
<property name="ceylon.common.dist" value="${build.dist}/${ceylon.common.dir}" />
<!-- Classpath for the build tools. -->
<path id="classpath">
<pathelement path="${markdownpapers.lib}" />
</path>
<path id="test.run.classpath">
<pathelement path="${build.classes}" />
<pathelement path="${junit.lib}" />
</path>
<!-- ################################################################## -->
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!-- project compilation -->
<target name="compile" description="compile Ceylon common">
<mkdir dir="${build.classes}" />
<javac
srcdir="${src}"
destdir="${build.classes}"
debug="true"
encoding="UTF8"
classpathref="classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}">
<include name="**/*.java" />
</javac>
<copy todir="${build.classes}">
<fileset dir="${src}">
<include name="**/*" />
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="ceylon-common.jar" depends="compile">
<mkdir dir="${build.dist.repo}/${ceylon.common.dir}"/>
<mkdir dir="${build.bin}"/>
<tstamp>
<format property="qualifier" timezone="GMT" pattern="'v'yyyyMMdd-HHmm"/>
</tstamp>
<jar destfile="${build.dist.repo}/${ceylon.common.jar}">
<fileset dir="${build.classes}">
</fileset>
<manifest>
<attribute name="Bundle-SymbolicName" value="com.redhat.ceylon.common"/>
<attribute name="Bundle-Version" value="${module.com.redhat.ceylon.common.version}.${qualifier}"/>
</manifest>
</jar>
<antcall target="sha1sum">
<param name="file" value="${build.dist.repo}/${ceylon.common.jar}" />
</antcall>
</target>
<target name="build" depends="ceylon-common.jar">
<mkdir dir="${build.bin}" />
<copy todir="${build.bin}">
<fileset dir="${basedir}/bin">
</fileset>
<filterset>
<filter token="ceylon-version" value="${ceylon.base.version}"/>
</filterset>
</copy>
</target>
<!-- constant to declare a file binary for checksumsum -->
<property name="checksum.binary-prefix" value=" *" />
<!-- Helper target, used to create a sha1 checksum file -->
<!-- Requires 'file' as a parameter. -->
<target name="sha1sum">
<fail unless="file" />
<fail if="filename" />
<fail if="value" />
<basename file="${file}" property="filename" />
<checksum file="${file}" property="value" algorithm="sha1" />
<echo file="${file}.sha1" message="${value}" />
</target>
<!-- Repository targets -->
<target name="init.repo" description="Init local ceylon repository and add ceylon.common">
<mkdir dir="${ceylon.common.repo}" />
</target>
<target name="clean.repo" description="Clean local ceylon repository">
<delete dir="${ceylon.common.repo}" />
</target>
<target name="ide-quick-internal">
<property name="archivePath" value="${ceylon.common.lib}"/>
<basename file="${archivePath}" property="archiveFileName"/>
<property name="proxy-project" value="../ceylon-ide-eclipse/required-bundle-proxies/${archiveFileName}"/>
<mkdir dir="${proxy-project}"/>
<delete failonerror="false" dir="${proxy-project}/META-INF"/>
<copy toDir="${proxy-project}" overwrite="true">
<zipfileset src="${archivePath}" includes="META-INF/**"/>
<fileset file="${archivePath}"/>
</copy>
<manifest file="${proxy-project}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Bundle-Classpath" value="${archiveFileName}"/>
</manifest>
</target>
<target name="dist" depends="build">
<copy file="${markdownpapers.lib}" tofile="${build.dist.repo}/${markdownpapers.repo}"/>
</target>
<target name="publish"
depends="dist,clean.repo,init.repo,publish-internal"
description="Publish both type checker and ceylon.language template module">
</target>
<target name="publish-internal" depends="init.repo">
<copy todir="${ceylon.repo.dir}" overwrite="true">
<fileset dir="${build.dist.repo}" />
</copy>
<copy todir="${ceylon.bin.dir}" overwrite="true">
<fileset dir="${build.bin}" />
</copy>
</target>
<target name="compile.tests">
<mkdir dir="${build.classes}" />
<javac
srcdir="${test.src}"
destdir="${build.classes}"
debug="true"
encoding="UTF8"
classpathref="test.run.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}">
<include name="**/*.java" />
</javac>
<copy todir="${build.classes}">
<fileset dir="${test.src}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="test"
depends="publish,compile.tests"
description="Run tests">
<mkdir dir="${test.reports}" />
<junit printsummary="yes" haltonfailure="no">
<classpath refid="test.run.classpath" />
<formatter type="xml" />
<test
name="com.redhat.ceylon.common.test.AllTests"
fork="yes"
todir="${test.reports}" />
</junit>
<junitreport todir="${test.reports}">
<fileset dir="${test.reports}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.reports}" />
</junitreport>
</target>
</project>