summaryrefslogtreecommitdiff
path: root/src/build
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-10-28 21:52:27 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-06 14:52:31 -0800
commitde66ada07a05c52f5bf9e2d77f37423712c52724 (patch)
treefe6b67f180cd8d0252375d6cfeb6b57f61338785 /src/build
parentfe5aab6f633e90ff52abc70e007cded1de3b5359 (diff)
downloadscala-de66ada07a05c52f5bf9e2d77f37423712c52724.tar.gz
scala-de66ada07a05c52f5bf9e2d77f37423712c52724.tar.bz2
scala-de66ada07a05c52f5bf9e2d77f37423712c52724.zip
De-duplicate logic in maven deployment.
Diffstat (limited to 'src/build')
-rw-r--r--src/build/maven/maven-deploy.xml69
1 files changed, 47 insertions, 22 deletions
diff --git a/src/build/maven/maven-deploy.xml b/src/build/maven/maven-deploy.xml
index 9e4215d297..7cff0b457e 100644
--- a/src/build/maven/maven-deploy.xml
+++ b/src/build/maven/maven-deploy.xml
@@ -6,6 +6,46 @@
SuperSabbus extension for deploying a distribution to Maven. THIS FILE IS MEANT TO BE RUN STANDALONE IN THE MAVEN "distpack" DIRECTORY
</description>
+ <macrodef name="deploy-remote">
+ <attribute name="jar" default=""/>
+ <attribute name="pom"/>
+ <element name="artifacts" implicit="true" optional="true"/>
+ <sequential>
+ <artifact:deploy file="@{jar}" settingsFile="${settings.file}">
+ <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" />
+ <artifact:pom refid="@{pom}" />
+ <artifacts/>
+ </artifact:deploy>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="deploy-local">
+ <attribute name="jar" default=""/>
+ <attribute name="pom"/>
+ <element name="artifacts" implicit="true" optional="true"/>
+ <sequential>
+ <artifact:install file="@{jar}">
+ <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" />
+ <artifact:pom refid="@{pom}" />
+ <artifacts/>
+ </artifact:install>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="deploy-to">
+ <attribute name="jar" default=""/>
+ <attribute name="pom"/>
+ <attribute name="local"/>
+ <element name="artifacts" implicit="true" optional="true"/>
+ <sequential>
+ <if><equals arg1="@{local}" arg2="true"/><then>
+ <deploy-local jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-local>
+ </then><else>
+ <deploy-remote jar="@{jar}" pom="@{pom}"> <artifacts/> </deploy-remote>
+ </else></if>
+ </sequential>
+ </macrodef>
+
<macrodef name="deploy-one">
<attribute name="dir" default=""/>
<attribute name="name" />
@@ -31,30 +71,15 @@
<artifact:pom id="@{name}.pom" file="${path}-pom-filtered.xml" />
<if><equals arg1="@{signed}" arg2="false"/><then>
- <if><equals arg1="@{local}" arg2="false"/><then>
- <artifact:deploy file="${path}.jar" settingsFile="${settings.file}">
- <artifact:remoteRepository url="${remote.repository}" id="${repository.credentials.id}" />
- <artifact:pom refid="@{name}.pom" />
+ <if><isset property="docs.skip"/><then>
+ <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom">
<artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
- <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" />
- </artifact:deploy>
+ </deploy-to>
</then><else>
- <if><isset property="docs.skip"/><then>
- <artifact:install file="${path}.jar">
- <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" />
- <artifact:pom refid="@{name}.pom" />
- <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
- </artifact:install>
- </then>
- <else>
- <artifact:install file="${path}.jar">
- <artifact:localRepository path="${local.repository}" id="${repository.credentials.id}" />
- <artifact:pom refid="@{name}.pom" />
- <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
- <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" />
- </artifact:install>
- </else>
- </if>
+ <deploy-to local="@{local}" jar="${path}.jar" pom="@{name}.pom">
+ <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
+ <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" />
+ </deploy-to>
</else></if>
</then><else>
<local name="repo"/>