forked from apache/royale-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maven.xml
189 lines (156 loc) · 7.87 KB
/
maven.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
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
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project default="install" basedir=".">
<property name="version" value="0.6.0"/>
<!-- Set type to RELEASE in order to deploy to the release repo -->
<property name="type" value="SNAPSHOT"/>
<condition property="maven.version"
value="${version}"
else="${version}-SNAPSHOT">
<equals arg1="${type}" arg2="RELEASE"/>
</condition>
<condition property="maven.repositoryId"
value="apache.releases.https"
else="apache.snapshots.https">
<equals arg1="${type}" arg2="RELEASE"/>
</condition>
<condition property="maven.repositoryUrl"
value="https://repository.apache.org/service/local/staging/deploy/maven2"
else="https://repository.apache.org/content/repositories/snapshots">
<equals arg1="${type}" arg2="RELEASE"/>
</condition>
<target name="package">
<echo message="Preparing Maven artifacts vor version ${maven.version} ..."/>
<delete dir="generated/maven"/>
<mkdir dir="generated/maven"/>
<copy file="maven/falcon-compiler.pom" tofile="generated/maven/falcon-compiler.pom">
<filterchain>
<tokenfilter>
<replacestring from="@VERSION@" to="${maven.version}"/>
</tokenfilter>
</filterchain>
</copy>
<antcall target="-pack-maven-artifact">
<param name="moduleName" value="compiler"/>
<param name="artifactName" value="falcon-compiler"/>
<param name="fileName" value="../compiler/generated/dist/sdk/lib/compiler.jar"/>
</antcall>
<antcall target="-pack-maven-artifact">
<param name="moduleName" value="flex-compiler-oem"/>
<param name="artifactName" value="falcon-compiler-oem"/>
<param name="fileName" value="../compiler/generated/dist/sdk/lib/flex-compiler-oem.jar"/>
</antcall>
<antcall target="-pack-maven-artifact">
<param name="moduleName" value="compiler.jx"/>
<param name="artifactName" value="falcon-jx-compiler"/>
<param name="fileName" value="../compiler.jx/lib/jsc.jar"/>
</antcall>
</target>
<target name="install" depends="package, -setup-aether-antlib">
<echo message="Installing Maven artifacts ..."/>
<antcall target="-install-maven-artifact-file">
<param name="artifactName" value="falcon-compiler"/>
</antcall>
<antcall target="-install-maven-artifact-file">
<param name="artifactName" value="falcon-compiler-oem"/>
</antcall>
<antcall target="-install-maven-artifact-file">
<param name="artifactName" value="falcon-jx-compiler"/>
</antcall>
</target>
<target name="deploy" depends="install">
<echo message="Deploying Maven artifacts to repository with id ${maven.repositoryId} and url ${maven.repositoryUrl} ..."/>
<antcall target="-deploy-maven-artifact-file">
<param name="artifactName" value="falcon-compiler"/>
</antcall>
<antcall target="-deploy-maven-artifact-file">
<param name="artifactName" value="falcon-compiler-oem"/>
</antcall>
<antcall target="-deploy-maven-artifact-file">
<param name="artifactName" value="falcon-jx-compiler"/>
</antcall>
</target>
<!--
Internal helper targets.
-->
<target name="-setup-aether-antlib">
<mkdir dir="utils"/>
<get src="http://search.maven.org/remotecontent?filepath=org/eclipse/aether/aether-ant-tasks/1.0.0.v20140518/aether-ant-tasks-1.0.0.v20140518-uber.jar"
dest="utils/aether-ant-tasks-uber.jar" verbose="true" skipexisting="true"/>
<fail message="Checksum mismatch for 'antlib/aether-ant-tasks-uber.jar'. Please delete it and rerun ant to redownload.">
<condition>
<not>
<checksum file="utils/aether-ant-tasks-uber.jar" algorithm="SHA"
property="95dadd03392a75564904da45108cf048abe6e5bb" verifyproperty="checksum.matches"/>
</not>
</condition>
</fail>
<!-- Setup the maven-ant-tasks. -->
<path id="aether-ant-tasks.classpath" path="utils/aether-ant-tasks-uber.jar" />
<typedef resource="org/eclipse/aether/ant/antlib.xml"
uri="antlib:org.eclipse.aether.ant"
classpathref="aether-ant-tasks.classpath" />
</target>
<target name="-pack-maven-artifact">
<echo message="Packing module ${moduleName} as Maven artifact ${artifactName}"/>
<copy file="maven/${artifactName}.pom" tofile="generated/maven/${artifactName}.pom">
<filterchain>
<tokenfilter>
<replacestring from="@VERSION@" to="${maven.version}"/>
</tokenfilter>
</filterchain>
</copy>
<copy file="${moduleName}/${fileName}" tofile="generated/maven/${artifactName}.jar"/>
<zip destfile="generated/maven/${artifactName}-sources.jar">
<fileset dir="${moduleName}/src"/>
<!--fileset dir="${moduleName}/generated/src"/-->
</zip>
</target>
<target name="-install-maven-artifact-pom" depends="-setup-aether-antlib"
xmlns:artifact="antlib:org.eclipse.aether.ant">
<echo message="Installing Pom: ${artifactName}"/>
<artifact:install>
<artifact:pom file="generated/maven/${artifactName}.pom"/>
</artifact:install>
</target>
<target name="-install-maven-artifact-file" depends="-setup-aether-antlib"
xmlns:artifact="antlib:org.eclipse.aether.ant">
<echo message="Installing File: ${artifactName}"/>
<artifact:install>
<artifact:pom file="generated/maven/${artifactName}.pom"/>
<artifact:artifact file="generated/maven/${artifactName}.jar"/>
<artifact:artifact file="generated/maven/${artifactName}-sources.jar" classifier="sources"/>
</artifact:install>
</target>
<target name="-deploy-maven-artifact-pom" depends="-setup-aether-antlib"
xmlns:artifact="antlib:org.eclipse.aether.ant">
<echo message="Deploying Pom: ${artifactName} to ${maven.repositoryUrl}"/>
<artifact:deploy>
<artifact:remoterepo id="${maven.repositoryId}" url="${maven.repositoryUrl}"/>
<artifact:pom file="generated/maven/${artifactName}.pom"/>
</artifact:deploy>
</target>
<target name="-deploy-maven-artifact-file" depends="-setup-aether-antlib"
xmlns:artifact="antlib:org.eclipse.aether.ant">
<echo message="Deploying File: ${artifactName} to ${maven.repositoryUrl}"/>
<artifact:deploy>
<artifact:remoterepo id="${maven.repositoryId}" url="${maven.repositoryUrl}"/>
<artifact:pom file="generated/maven/${artifactName}.pom"/>
<artifact:artifact file="generated/maven/${artifactName}.jar"/>
<artifact:artifact file="generated/maven/${artifactName}-sources.jar" classifier="sources"/>
</artifact:deploy>
</target>
</project>