[pkg-java] r13042 - in trunk/maven-ant-helper: . debian debian/source

Ludovic Claude ludovicc-guest at alioth.debian.org
Fri Oct 29 23:12:55 UTC 2010


Author: ludovicc-guest
Date: 2010-10-29 23:12:54 +0000 (Fri, 29 Oct 2010)
New Revision: 13042

Added:
   trunk/maven-ant-helper/debian/source/
   trunk/maven-ant-helper/debian/source/format
Modified:
   trunk/maven-ant-helper/debian/changelog
   trunk/maven-ant-helper/debian/control
   trunk/maven-ant-helper/maven-build.xml
Log:
* Update Standards-Version to 3.9.1, use source format 3.0 (native)  
* Use default-jdk-doc instead of openjdk-6-doc when linking
  Javadoc files (Closes: #587361)
* d/control: add Suggests: default-jdk-doc, move all Recommends: to Suggest
  as they are not needed except when Maven is called within the Ant build,
  add maven-repo-helper to Depends as it's now always used from the jar task
* maven-build.xml: add -N option to Maven to avoid recursive actions,
  reorder actions in mvn-package and give to the POMCleaner the location
  of the local Maven repository which can be used when deciding when to
  replace a parent version by a its symbolic version (fixes
  maven-debian-helper build),
  add local-install and package-and-local-install target to deal with
  composite projects which need to install some of their build elements in
  the local repository, for consuption by other parts of the build,
  deprecate passing the 'version' variable to Ant as it's read from the POM file,
  remove macro prepare-package-list, update paths to the JDK docs.

Modified: trunk/maven-ant-helper/debian/changelog
===================================================================
--- trunk/maven-ant-helper/debian/changelog	2010-10-29 23:11:15 UTC (rev 13041)
+++ trunk/maven-ant-helper/debian/changelog	2010-10-29 23:12:54 UTC (rev 13042)
@@ -1,3 +1,24 @@
+maven-ant-helper (7.0) UNRELEASED; urgency=low
+
+  * Update Standards-Version to 3.9.1, use source format 3.0 (native)  
+  * Use default-jdk-doc instead of openjdk-6-doc when linking
+    Javadoc files (Closes: #587361)
+  * d/control: add Suggests: default-jdk-doc, move all Recommends: to Suggest
+    as they are not needed except when Maven is called within the Ant build,
+    add maven-repo-helper to Depends as it's now always used from the jar task
+  * maven-build.xml: add -N option to Maven to avoid recursive actions,
+    reorder actions in mvn-package and give to the POMCleaner the location
+    of the local Maven repository which can be used when deciding when to
+    replace a parent version by a its symbolic version (fixes
+    maven-debian-helper build),
+    add local-install and package-and-local-install target to deal with
+    composite projects which need to install some of their build elements in
+    the local repository, for consuption by other parts of the build,
+    deprecate passing the 'version' variable to Ant as it's read from the POM file,
+    remove macro prepare-package-list, update paths to the JDK docs.
+ 
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Thu, 14 Oct 2010 00:08:38 +0200
+
 maven-ant-helper (6.8) unstable; urgency=low
 
   * Use default-jdk-doc instead of openjdk-6-doc when linking

Modified: trunk/maven-ant-helper/debian/control
===================================================================
--- trunk/maven-ant-helper/debian/control	2010-10-29 23:11:15 UTC (rev 13041)
+++ trunk/maven-ant-helper/debian/control	2010-10-29 23:12:54 UTC (rev 13042)
@@ -5,8 +5,8 @@
 Uploaders: Trygve Laugstøl <trygvis at inamo.no>, Paul Cager <paul-debian at home.paulcager.org>, 
  Torsten Werner <twerner at debian.org>, Ludovic Claude <ludovic.claude at laposte.net>
 Build-Depends: debhelper (>= 5), cdbs (>= 0.4.5.3), default-jdk
-Build-Depends-Indep: ant, ant-optional
-Standards-Version: 3.8.3
+Build-Depends-Indep: ant, ant-optional, ant-contrib
+Standards-Version: 3.9.1
 Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/maven-ant-helper
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/maven-ant-helper/
 Homepage: http://svn.debian.org/wsvn/pkg-java/trunk/maven-ant-helper
@@ -14,10 +14,9 @@
 Package: maven-ant-helper
 Architecture: all
 Section: java
-Depends: ${misc:Depends}, ant, ant-optional
-Recommends: libmodello-java (>= 1.0), libmaven2-core-java, 
- libmaven-plugin-tools-java, libplexus-component-metadata-java, 
- maven-repo-helper 
+Depends: ${misc:Depends}, ant, ant-optional, ant-contrib, maven-repo-helper
+Suggests: default-jdk-doc, libmodello-java (>= 1.0), libmaven2-core-java, 
+ libmaven-plugin-tools-java, libplexus-component-metadata-java
 Description: helper scripts for building Maven components with ant
  An environment that can be used to simplify the creation of Debian packages
  to support the Maven system. A "modello" ant task is also provided.

Added: trunk/maven-ant-helper/debian/source/format
===================================================================
--- trunk/maven-ant-helper/debian/source/format	                        (rev 0)
+++ trunk/maven-ant-helper/debian/source/format	2010-10-29 23:12:54 UTC (rev 13042)
@@ -0,0 +1 @@
+3.0 (native)

Modified: trunk/maven-ant-helper/maven-build.xml
===================================================================
--- trunk/maven-ant-helper/maven-build.xml	2010-10-29 23:11:15 UTC (rev 13041)
+++ trunk/maven-ant-helper/maven-build.xml	2010-10-29 23:12:54 UTC (rev 13042)
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
 
-<project name="pkg-java" default="package" basedir=".">
+<project name="pkg-java" default="package" basedir="." xmlns:c="antlib:net.sf.antcontrib">
+    <taskdef uri="antlib:net.sf.antcontrib"
+            resource="net/sf/antcontrib/antlib.xml"
+            classpath="/usr/share/java/ant-contrib.jar"/>
 
     <!--
        maven-build.xml - an Ant build script that reproduces the Maven build life-cycle.
@@ -13,10 +16,7 @@
        package: the name of the source package. For example, use: 
            DEB_ANT_ARGS := -Dversion=$(DEB_SOURCE_PACKAGE) 
        bin.package: the name of the binary package. Defaults to lib${package}-java
-       version: the version of the project, used in the name of the jar. Prefer to use the Debian version 
-         here as it makes the rules file easier to write when the version contains alpha, beta or rc versions.
-         For example, use: 
-           DEB_ANT_ARGS := -Dversion=$(DEB_UPSTREAM_VERSION) 
+       version: DEPRECATED - the version of the project, used in the name of the jar. 
        debian.dir: the location of the debian directory. Defaults to ${basedir}/debian
        project.dir: the location of the current project. Defaults to ""
        pom.name: the name of the pom file. Must appear as it is in the debian/${bin.package}.poms file
@@ -31,7 +31,7 @@
        keep-cleaned-pom: if set, keeps the cleaned pom after packaging. If can be restored later by calling
           maven-build.xml with the restore-pom target (without the keep-cleaned-pom property set).
        use-local-repo: if set, then Maven will use a local repository copied from /usr/share/maven-repo into
-          debian/tmp. This allows you to install some custom or intermediate artifacts, handy for multi modules builds.
+          debian/.mh. This allows you to install some custom or intermediate artifacts, handy for multi modules builds.
        dependency, dependency2, dependency3...: Give the name of the dependent packages. Those packages will be
           used to form the links to the Javadoc APIs from the generated Javadoc. 
           The links are of the form: file:///usr/share/doc/${dependency}/api
@@ -69,7 +69,12 @@
             <equals arg1="" arg2="${project.dir}" />
         </condition>
         <property name="pom.file" value="${pom.name}" />
-        <available property="available.pom" file="${pom.file}"/>
+        <condition property="available.pom">
+            <and>
+                <available file="${debian.dir}/${bin.package}.poms"/>
+                <available file="${pom.file}"/>
+            </and>
+        </condition>
 
         <echo message="Base dir is ${basedir}" />
         <echo message="Pom name in ${bin.package}.poms: ${pom.name}" />
@@ -144,16 +149,15 @@
         <property name="cleaner.options" value=""/>
         <echo message="Cleaner options: ${cleaner.options}" />
 
-        <mkdir dir="${debian.dir}/tmp" /> 
+        <mkdir dir="${debian.dir}/.mh" /> 
         <delete>
-           <fileset dir="${debian.dir}/tmp">
+           <fileset dir="${debian.dir}/.mh">
               <include name="pom.xml" />
               <include name="pom.properties" />
            </fileset>
         </delete> 
 
         <property name="pom.loc" location="${pom.file}" />
-        <echo message="Cleaning pom ${pom.loc}" />
 
         <java fork="true" dir="." 
            classname="org.debian.maven.repo.POMCleaner">
@@ -163,20 +167,35 @@
            <arg value="-p${bin.package}" />
            <arg value="-r${debian.dir}/maven.rules" />
            <arg value="-i${debian.dir}/maven.publishedRules" />
+           <arg value="--maven-repo=${debian.dir}/.mh/maven-repo" />
            <arg value="--verbose" />
            <arg line="${cleaner.options} --keep-pom-version" />
            <arg value="${pom.loc}" />
-           <arg value="${debian.dir}/tmp/pom.xml" />
-           <arg value="${debian.dir}/tmp/pom.properties" />
+           <arg value="${debian.dir}/.mh/pom.xml" />
+           <arg value="${debian.dir}/.mh/pom.properties" />
         </java> 
         <copy file="${pom.file}" tofile="${pom.file}.save" />
         <!-- force the pom file to be located in the current dir, we'll need it when running Maven plugins -->
-        <copy file="${debian.dir}/tmp/pom.xml" tofile="${pom.file}" overwrite="true" />
-        <property file="${debian.dir}/tmp/pom.properties"/>
+        <copy file="${debian.dir}/.mh/pom.xml" tofile="${pom.file}" overwrite="true" />
 
+        <!-- Read groupId, artifactId, version from the POM file -->
+        <c:var name="groupId" unset="true" /> 
+        <c:var name="artifactId" unset="true" /> 
+        <c:var name="version" unset="true" /> 
+        <c:var name="debianVersion" unset="true" /> 
+        <c:var name="classifier" unset="true" /> 
+        <c:var name="type" unset="true" />
+        <property file="${debian.dir}/.mh/pom.properties"/>
+
+        <pathconvert property="groupPath">
+            <path location="${groupId}"/>
+            <filtermapper>
+                <replacestring from="." to="/"/>
+            </filtermapper>
+        </pathconvert>
+
         <echo message="Properties read from the POM file:" />
-        <echo message="  groupId: ${groupId}" />
-        <echo message="  artifactId: ${artifactId}" />
+        <echo message="  groupId: ${groupId}, artifactId: ${artifactId}, version: ${version}, debianVersion: ${debianVersion}" />
     </target>
 
     <target name="init" depends="read.pom">
@@ -217,7 +236,7 @@
     <target name="process-pom" depends="init" if="available.pom">
         <mkdir dir="${build.outputDirectory}/META-INF/maven/${groupId}/${artifactId}"/>
         <copy todir="${build.outputDirectory}/META-INF/maven/${groupId}/${artifactId}">
-            <fileset dir="${debian.dir}/tmp">
+            <fileset dir="${debian.dir}/.mh">
                <include name="pom.xml" />
                <include name="pom.properties" />
             </fileset>
@@ -234,6 +253,7 @@
           <arg value="--offline"/>
           <arg value="-e"/>
           <arg value="-B"/>
+          <arg value="-N"/>
           <arg value="-s${debian.dir}/maven-settings.xml"/>
           <arg value="@{target}"/>
         </java>
@@ -242,12 +262,15 @@
 
     <macrodef name="run-maven-local-repo">
       <attribute name="target"/>
+      <element name="before-maven" optional="true" />
       <sequential>
-        <mkdir dir="${debian.dir}/tmp/maven-repo" /> 
-        <copy todir="${debian.dir}/tmp/maven-repo">
+        <mkdir dir="${debian.dir}/.mh/maven-repo" /> 
+        <copy todir="${debian.dir}/.mh/maven-repo">
             <fileset dir="/usr/share/maven-repo" />
         </copy>
 
+        <before-maven/>
+
         <java fork="true" dir="." classname="org.apache.maven.cli.MavenCli" failonerror="true">
           <jvmarg value="-Xmx256M"/>
           <classpath refid="maven.classpath"/>
@@ -255,8 +278,9 @@
           <arg value="--offline"/>
           <arg value="-e"/>
           <arg value="-B"/>
+          <arg value="-N"/>
           <arg value="--offline"/>
-          <arg value="-Dmaven.repo.local=${debian.dir}/tmp/maven-repo"/>
+          <arg value="-Dmaven.repo.local=${debian.dir}/.mh/maven-repo"/>
           <arg value="@{target}"/>
         </java>
       </sequential>      
@@ -343,57 +367,38 @@
     </target>
 
     <target name="mvn-package" depends="jar" if="maven.package.target">
-        <!-- do a POM transform in order to keep important plugin configuration for Maven -->
-        <delete file="${pom.file}" />
-        <echo message="Transform ${pom.file}" />
-        <java fork="true" dir="." 
-           classname="org.debian.maven.repo.POMCleaner">
-           <classpath refid="repo-helper.classpath"/>
-           <sysproperty key="javax.xml.stream.XMLInputFactory" value="${xml-input-factory}" />
-           <sysproperty key="javax.xml.stream.XMLOutputFactory" value="${xml-output-factory}" />
-           <arg value="-p${bin.package}" />
-           <arg value="-r${debian.dir}/maven.rules" />
-           <arg value="-i${debian.dir}/maven.publishedRules" />
-           <arg value="--verbose" />
-           <arg value="--keep-all-elements" />
-           <arg line="${cleaner.options} --keep-pom-version" />
-           <arg value="${pom.file}.save" />
-           <arg value="${pom.file}" />
-           <arg value="${debian.dir}/tmp/pom.properties" />
-        </java> 
         <!-- Calls mvn ${maven.package.target} -->
         <run-maven-local-repo target="${maven.package.target}" />
     </target>
 
+    <target name="local-install" depends="jar">
+        <mkdir dir="${debian.dir}/.mh/maven-repo/${groupPath}/${artifactId}/${version}" />
+        <copy file="${pom.file}" tofile="${debian.dir}/.mh/maven-repo/${groupPath}/${artifactId}/${version}/${artifactId}-${version}.pom" />
+        <c:if>
+          <or>
+            <equals arg1="${type}" arg2="jar" />
+            <equals arg1="${type}" arg2="bundle" />
+          </or>
+          <then>
+            <copy file="${build.directory}/${artifactId}-${version}.jar" todir="${debian.dir}/.mh/maven-repo/${groupPath}/${artifactId}/" />
+          </then>
+        </c:if>
+    </target>
+
     <target name="restore-pom" depends="init.pom" unless="keep-cleaned-pom"> 
         <!-- restore the pom file -->
         <copy file="${pom.file}.save" tofile="${pom.file}" overwrite="true"/>
     </target>
  
     <target name="package" depends="jar,mvn-package,restore-pom" />
+    <target name="package-and-local-install" depends="package,local-install" />
 
-    <macrodef name="prepare-package-list">
-       <attribute name="package" />
-       <sequential>
-         <mkdir dir="${build.directory}/@{package}" />
-         <copy todir="${build.directory}/@{package}"> 
-           <fileset dir="/usr/share/doc">
-             <include name="@{package}/api/package*list" />
-           </fileset>
-         </copy>
-         <!-- the file package-list is no longer compressed but leaving <gunzip/> here for backporting
-         <gunzip src="/usr/share/doc/@{package}/api/package-list.gz" dest="${build.directory}/@{package}" /> 
-         -->
-       </sequential>
-    </macrodef>
-
     <!--
      | Javadoc
      |-->
 
-    <target name="javadoc">
+    <target name="javadoc" depends="read.pom">
         <mkdir dir="${javadoc.dir}"/>
-        <prepare-package-list package="openjdk-6-doc" />
         <javadoc 
             source="${build.javaVersion}"
             sourcepath="${build.sourceDirectory}"
@@ -407,8 +412,8 @@
             <packageset dir="${build.sourceDirectory}" defaultexcludes="yes">
                 <include name="**"/>
             </packageset>
-            <link href="file:///usr/share/doc/default-jdk-doc/api" packagelistLoc="${build.directory}/default-jdk-doc" />
-            <link href="file:///usr/share/doc/openjdk-6-doc/api" packagelistLoc="${build.directory}/openjdk-6-doc" />
+            <link href="file:///usr/share/doc/default-jdk-doc/api" packagelistLoc="/usr/share/doc/default-jdk/api/" />
+            <link href="file:///usr/share/doc/openjdk-6-doc/api" packagelistLoc="/usr/share/doc/openjdk-6/api/" />
             <link href="file:///usr/share/doc/classpath-doc/api" />
             <link href="file:///usr/share/doc/${dependency}/api" />
             <link href="file:///usr/share/doc/${dependency2}/api" />




More information about the pkg-java-commits mailing list