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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
<?xml version="1.0"?>
<project name="pkg-java" default="package" basedir="..">
<property file="debian/build.properties"/>
<property name="maven.build" value="/usr/share/maven-ant-helper/maven-build.xml"/>
<property file="/usr/share/maven-ant-helper/maven-defaults.properties"/>
<macrodef name="cleanmodule">
<attribute name="dir"/>
<sequential>
<ant target="clean" antfile="${maven.build}" dir="@{dir}">
<property name="debian.dir" location="debian" />
<property name="project.dir" value="@{dir}" />
</ant>
</sequential>
</macrodef>
<macrodef name="packagemodule">
<attribute name="dir"/>
<sequential>
<echo message="Packaging module @{dir}..."/>
<ant target="package" antfile="${maven.build}" dir="@{dir}">
<property name="debian.dir" location="debian" />
<property name="project.dir" value="@{dir}" />
</ant>
</sequential>
</macrodef>
<target name="clean">
<cleanmodule dir=""/>
<cleanmodule dir="maven-plugin-tools-api"/>
<cleanmodule dir="maven-plugin-tools-beanshell"/>
<cleanmodule dir="maven-plugin-tools-java"/>
<cleanmodule dir="maven-plugin-plugin"/>
</target>
<target name="generate-sources">
<taskdef name="modello" classname="ModelloTask" classpath="/usr/share/java/maven-ant-helper.jar:/usr/share/java/modello-core.jar:/usr/share/java/modello-plugin-xml.jar:/usr/share/java/modello-plugin-xpp3.jar"/>
<modello
model="maven-plugin-tools-model/src/main/mdo/plugin-metadata.mdo"
plugin="java" output="maven-plugin-tools-model/target/generated-sources"
version="1.0.0"/>
<modello
model="maven-plugin-tools-model/src/main/mdo/plugin-metadata.mdo"
plugin="xpp3-reader" output="maven-plugin-tools-model/target/generated-sources"
version="1.0.0"/>
<modello
model="maven-plugin-tools-model/src/main/mdo/plugin-metadata.mdo"
plugin="xpp3-writer" output="maven-plugin-tools-model/target/generated-sources"
version="1.0.0"/>
<modello
model="maven-plugin-plugin/src/main/mdo/pluginRequirements.mdo"
plugin="java" output="maven-plugin-plugin/target/generated-sources"
version="1.0.0"/>
</target>
<macrodef name="package-and-local-deploy">
<attribute name="dir"/>
<attribute name="project.dir" default="@{dir}"/>
<attribute name="artifactId" default="@{dir}"/>
<attribute name="group" default="plugin-tools"/>
<sequential>
<echo message="Building @{group}:@{artifactId}..."/>
<ant target="package" antfile="${maven.build}" dir="@{dir}">
<property name="debian.dir" location="debian" />
<property name="project.dir" value="@{project.dir}" />
<property name="package" value="${package}" />
<property name="use-local-repo" value="true" />
<property name="keep-cleaned-pom" value="true" />
</ant>
<mkdir dir="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/${version}" />
<mkdir dir="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/debian" />
<copy file="@{dir}/pom.xml"
tofile="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/${version}/@{artifactId}-${version}.pom" />
<copy file="@{dir}/${build.directory}/@{artifactId}-${version}.jar"
tofile="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/${version}/@{artifactId}-${version}.jar" />
<copy file="@{dir}/pom.xml"
tofile="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/debian/@{artifactId}-debian.pom" />
<copy file="@{dir}/${build.directory}/@{artifactId}-${version}.jar"
tofile="debian/tmp/maven-repo/org/apache/maven/@{group}/@{artifactId}/debian/@{artifactId}-debian.jar" />
</sequential>
</macrodef>
<target name="package" depends="generate-sources">
<copy todir=".">
<fileset dir="." includes="**/pom.xml" />
<globmapper from="*" to="*.save"/>
</copy>
<!-- Create a dummy plugin descriptor to help plugin-plugin to bootstrap itself.
The real descriptor will be generated by calling mvn plugin:descriptor -->
<mkdir dir="maven-plugin-plugin/${build.outputDirectory}/META-INF/maven/" />
<copy file="debian/plugin.xml" todir="maven-plugin-plugin/${build.outputDirectory}/META-INF/maven/" >
<filterset>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<!-- Copy the plexus component descriptors. The descriptors are generated
by post processing the compiled classes, but maven-ant-helper doesn't
know how to do that yet, so we inject them manually for now -->
<mkdir dir="maven-plugin-tools-annotations/target/classes/META-INF/plexus/" />
<copy file="debian/components-tools-annotations.xml" tofile="maven-plugin-tools-annotations/target/classes/META-INF/plexus/components.xml"/>
<mkdir dir="maven-plugin-tools-ant/target/classes/META-INF/plexus/" />
<copy file="debian/components-tools-ant.xml" tofile="maven-plugin-tools-ant/target/classes/META-INF/plexus/components.xml"/>
<mkdir dir="maven-plugin-tools-beanshell/target/classes/META-INF/plexus/" />
<copy file="debian/components-tools-beanshell.xml" tofile="maven-plugin-tools-beanshell/target/classes/META-INF/plexus/components.xml"/>
<mkdir dir="maven-plugin-tools-java/target/classes/META-INF/plexus/" />
<copy file="debian/components-tools-java.xml" tofile="maven-plugin-tools-java/target/classes/META-INF/plexus/components.xml"/>
<package-and-local-deploy dir="." project.dir="" artifactId="maven-plugin-tools" />
<package-and-local-deploy dir="maven-plugin-tools-api" />
<package-and-local-deploy dir="maven-plugin-annotations" />
<package-and-local-deploy dir="maven-plugin-tools-annotations" />
<package-and-local-deploy dir="maven-plugin-tools-model" />
<package-and-local-deploy dir="maven-plugin-tools-ant"/>
<package-and-local-deploy dir="maven-plugin-tools-beanshell"/>
<package-and-local-deploy dir="maven-plugin-tools-generators"/>
<package-and-local-deploy dir="maven-plugin-tools-java"/>
<package-and-local-deploy dir="maven-plugin-tools-javadoc"/>
<package-and-local-deploy dir="maven-script/maven-script-ant" artifactId="maven-script-ant"/>
<package-and-local-deploy dir="maven-script/maven-script-beanshell" artifactId="maven-script-beanshell"/>
<package-and-local-deploy dir="maven-plugin-plugin" group="plugins"/>
<!-- Calls mvn plugin:descriptor on maven-plugin-plugin -->
<path id="maven.classpath">
<fileset dir="/usr/share/maven-repo">
<include name="classworlds/classworlds/debian/classworlds-debian.jar"/>
<include name="com/jcraft/jsch/debian/jsch-debian.jar"/>
<include name="commons-cli/commons-cli/debian/commons-cli-debian.jar"/>
<include name="junit/junit/debian/junit-debian.jar"/>
<include name="xml-apis/xml-apis/debian/xml-apis-debian.jar"/>
<include name="org/apache/maven/doxia/doxia-logging-api/debian/doxia-logging-api-debian.jar"/>
<include name="org/apache/maven/doxia/doxia-sink-api/debian/doxia-sink-api-debian.jar"/>
<include name="org/apache/maven/maven-artifact/debian/maven-artifact-debian.jar"/>
<include name="org/apache/maven/maven-artifact-manager/debian/maven-artifact-manager-debian.jar"/>
<include name="org/apache/maven/maven-core/debian/maven-core-debian.jar"/>
<include name="org/apache/maven/maven-error-diagnostics/debian/maven-error-diagnostics-debian.jar"/>
<include name="org/apache/maven/maven-model/debian/maven-model-debian.jar"/>
<include name="org/apache/maven/maven-monitor/debian/maven-monitor-debian.jar"/>
<include name="org/apache/maven/maven-plugin-api/debian/maven-plugin-api-debian.jar"/>
<include name="org/apache/maven/maven-plugin-descriptor/debian/maven-plugin-descriptor-debian.jar"/>
<include name="org/apache/maven/maven-plugin-parameter-documenter/debian/maven-plugin-parameter-documenter-debian.jar"/>
<include name="org/apache/maven/maven-plugin-registry/debian/maven-plugin-registry-debian.jar"/>
<include name="org/apache/maven/maven-profile/debian/maven-profile-debian.jar"/>
<include name="org/apache/maven/maven-project/debian/maven-project-debian.jar"/>
<include name="org/apache/maven/maven-repository-metadata/debian/maven-repository-metadata-debian.jar"/>
<include name="org/apache/maven/maven-settings/debian/maven-settings-debian.jar"/>
<include name="org/apache/maven/reporting/maven-reporting-api/debian/maven-reporting-api-debian.jar"/>
<include name="org/apache/maven/wagon/wagon-provider-api/debian/wagon-provider-api-debian.jar"/>
<include name="org/apache/maven/wagon/wagon-ssh-common/debian/wagon-ssh-common-debian.jar"/>
<include name="org/apache/maven/wagon/wagon-ssh/debian/wagon-ssh-debian.jar"/>
<include name="org/codehaus/plexus/plexus-container-default/1.0-alpha/plexus-container-default-1.0-alpha.jar"/>
<include name="org/codehaus/plexus/plexus-interactivity-api/debian/plexus-interactivity-api-debian.jar"/>
<include name="org/codehaus/plexus/plexus-interpolation/debian/plexus-interpolation-debian.jar"/>
<include name="org/codehaus/plexus/plexus-utils/debian/plexus-utils-debian.jar"/>
<include name="org/sonatype/plexus/plexus-cipher/debian/plexus-cipher-debian.jar"/>
<include name="org/sonatype/plexus/plexus-sec-dispatcher/debian/plexus-sec-dispatcher-debian.jar"/>
</fileset>
</path>
<java fork="true" dir="maven-plugin-plugin" classname="org.apache.maven.cli.MavenCli" failonerror="true">
<jvmarg value="-Xmx256M"/>
<classpath refid="maven.classpath"/>
<arg value="-Dmaven.test.skip"/>
<arg value="--offline"/>
<arg value="-e"/>
<arg value="-B"/>
<arg value="-s${basedir}/debian/tmp/maven-settings.xml"/>
<arg value="plugin:descriptor"/>
</java>
<copy todir="." overwrite="true" >
<fileset dir="." includes="**/pom.xml.save" />
<globmapper from="*.save" to="*"/>
</copy>
<!-- re-package, this time with the correct pom files -->
<packagemodule dir="" />
<packagemodule dir="maven-plugin-tools-api" />
<packagemodule dir="maven-plugin-annotations" />
<packagemodule dir="maven-plugin-tools-annotations" />
<packagemodule dir="maven-plugin-tools-model" />
<packagemodule dir="maven-plugin-tools-ant"/>
<packagemodule dir="maven-plugin-tools-beanshell"/>
<packagemodule dir="maven-plugin-tools-generators"/>
<packagemodule dir="maven-plugin-tools-java"/>
<packagemodule dir="maven-plugin-tools-javadoc"/>
<packagemodule dir="maven-script/maven-script-ant"/>
<packagemodule dir="maven-script/maven-script-beanshell"/>
<packagemodule dir="maven-plugin-plugin"/>
</target>
<target name="javadoc">
<javadoc destdir="${javadoc.dir}">
<packageset dir="maven-plugin-tools-api/src/main/java/"/>
<packageset dir="maven-plugin-tools-beanshell/src/main/java/"/>
<packageset dir="maven-plugin-tools-java/src/main/java/"/>
<packageset dir="maven-plugin-tools-javadoc/src/main/java/"/>
<packageset dir="maven-plugin-plugin/src/main/java/"/>
</javadoc>
</target>
</project>
|