forked from flexunit/flexunit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.xml
More file actions
85 lines (76 loc) · 4.36 KB
/
utils.xml
File metadata and controls
85 lines (76 loc) · 4.36 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
<project xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<!-- xml namespace which is used to deploy the artifacts with maven -->
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpath="lib/maven-ant-tasks-2.1.3.jar"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpath="lib/ant-contrib-0.6.jar"/>
<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-staging-repository-id" value="sonatype-nexus-staging" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<macrodef name="sonatype-deploy">
<attribute name="binaryFile"/>
<attribute name="sourcesFile" default=""/>
<attribute name="docFile" default=""/>
<attribute name="todir"/>
<attribute name="pomTemplate"/>
<attribute name="artifact"/>
<attribute name="type"/>
<attribute name="name"/>
<attribute name="version"/>
<attribute name="description"/>
<sequential>
<!-- Create POM from template -->
<copy file="@{pomTemplate}" tofile="@{todir}/pom.xml"/>
<replace file="@{todir}/pom.xml">
<replacefilter token="@ARTIFACT@" value="@{artifact}"/>
<replacefilter token="@TYPE@" value="@{type}"/>
<replacefilter token="@NAME@" value="@{name}"/>
<replacefilter token="@VERSION@" value="@{version}"/>
<replacefilter token="@DESCRIPTION@" value="@{description}"/>
</replace>
<copy file="@{binaryFile}" tofile="@{todir}/@{artifact}-@{version}.@{type}" />
<if>
<equals arg1="@{type}" arg2="jar" />
<then>
<copy file="@{sourcesFile}" tofile="@{todir}/@{artifact}-@{version}-sources.@{type}" />
<copy file="@{docFile}" tofile="@{todir}/@{artifact}-@{version}-javadoc.@{type}" />
</then>
</if>
<!-- sign and deploy the main artifact -->
<artifact:mvn>
<artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"/>
<artifact:arg value="-Durl=${maven-staging-repository-url}"/>
<artifact:arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<artifact:arg value="-DpomFile=@{todir}/pom.xml"/>
<artifact:arg value="-Dfile=@{todir}/@{artifact}-@{version}.@{type}"/>
<artifact:arg value="-Pgpg"/>
</artifact:mvn>
<if>
<equals arg1="@{type}" arg2="jar" />
<then>
<!-- sign and deploy the sources artifact -->
<artifact:mvn>
<artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"/>
<artifact:arg value="-Durl=${maven-staging-repository-url}"/>
<artifact:arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<artifact:arg value="-DpomFile=@{todir}/pom.xml"/>
<artifact:arg value="-Dfile=@{todir}/@{artifact}-@{version}-sources.@{type}"/>
<artifact:arg value="-Dclassifier=sources"/>
<artifact:arg value="-Pgpg"/>
</artifact:mvn>
<!-- sign and deploy the javadoc artifact -->
<artifact:mvn>
<artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file"/>
<artifact:arg value="-Durl=${maven-staging-repository-url}"/>
<artifact:arg value="-DrepositoryId=${maven-staging-repository-id}"/>
<artifact:arg value="-DpomFile=@{todir}/pom.xml"/>
<artifact:arg value="-Dfile=@{todir}/@{artifact}-@{version}-javadoc.@{type}"/>
<artifact:arg value="-Dclassifier=javadoc"/>
<artifact:arg value="-Pgpg"/>
</artifact:mvn>
</then>
</if>
</sequential>
</macrodef>
</project>