-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-publish.xml
49 lines (45 loc) · 1.99 KB
/
build-publish.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="DMDirc-Publish" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>Publish artifacts for DMDirc</description>
<available file="${git.dir}" property="is.git" />
<target name="-init-version">
<taskdef name="git-describe" classname="org.mdonoughe.JGitDescribeTask" classpathref="lib.classpath"/>
</target>
<target name="-get-git-version" depends="-init-version" if="is.git">
<git-describe dir="${git.dir}" property="raw.git.version" />
<loadresource property="git.version">
<concat>${raw.git.version}</concat>
<filterchain><replaceregex pattern="^v"/></filterchain>
</loadresource>
</target>
<target name="publish-snapshot" depends="-init-ivy,-get-git-version">
<ivy:resolve file="ivy.xml"/>
<ivy:deliver deliverpattern="build/ivy.xml" pubrevision="${git.version}-SNAPSHOT" />
<ivy:makepom ivyfile="build/ivy.xml" pomfile="dist/annotations.pom">
<mapping conf="default" scope="compile"/>
</ivy:makepom>
<ivy:retrieve/>
<ivy:publish
pubrevision="${git.version}-SNAPSHOT"
status="integration"
overwrite="true"
publishivy="false"
artifactspattern="dist/[artifact].[ext]"
resolver="upload-snapshot"/>
</target>
<target name="publish-release" depends="-init-ivy,-get-git-version">
<ivy:resolve file="ivy.xml"/>
<ivy:deliver deliverpattern="build/ivy.xml" pubrevision="${git.version}" />
<ivy:makepom ivyfile="build/ivy.xml" pomfile="dist/annotations.pom">
<mapping conf="default" scope="compile"/>
</ivy:makepom>
<ivy:retrieve/>
<ivy:publish
pubrevision="${git.version}"
status="release"
overwrite="true"
publishivy="false"
artifactspattern="dist/[artifact].[ext]"
resolver="upload-release"/>
</target>
</project>