[gant] 02/04: Build with gradle-debian-helper
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Wed Dec 9 16:15:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository gant.
commit 276ecdf82687a3a3ba8ff860f09d0c1020ef7b15
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Wed Dec 9 16:58:11 2015 +0100
Build with gradle-debian-helper
---
debian/build.xml | 224 ------------------------------------------
debian/changelog | 1 +
debian/control | 6 +-
debian/maven.rules | 3 +
debian/patches/01-build.patch | 11 +++
debian/patches/series | 1 +
debian/rules | 24 ++---
7 files changed, 30 insertions(+), 240 deletions(-)
diff --git a/debian/build.xml b/debian/build.xml
deleted file mode 100644
index 4561fc5..0000000
--- a/debian/build.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Gant - A Groovy way of scripting Ant tasks.
-
-Copyright © 2006-10 Russel Winder
-
-Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software distributed under the License is
-distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-implied. See the License for the specific language governing permissions and limitations under the
-License.
-
-Author : Russel Winder <russel.winder at concertant.com>
--->
-
-<project name="Gant" default="package" basedir=".." xmlns:artifact="urn:maven-artifact-ant">
-
- <description>
- This Ant script provides the build needed by Debian whilst the Gradle system is not packaged.
- </description>
-
- <property name="gantVersion" value="1.9.11"/>
- <property name="groovyVersion" value="2.2.2"/>
- <property name="mavenAntTaskVersion" value="2.1.3"/>
- <property name="ivyVersion" value="2.2.0"/>
-
- <property environment="environment"/>
-
- <property name="sourceDirectory" value="src/main/groovy"/>
- <property name="testsDirectory" value="src/test/groovy"/>
- <property name="jarfilesDirectory" value="/usr/share/java"/>
- <property name="mavenJarfilesDirectory" value="/usr/share/maven2/lib"/>
- <property name="scriptsDirectory" value="scripts"/>
-
- <property name="buildDirectory" value="target_gant"/>
- <property name="buildClassesDirectory" value="${buildDirectory}/classes"/>
- <property name="buildTestClassesDirectory" value="${buildDirectory}/test-classes"/>
- <property name="buildTestReportsDirectory" value="${buildDirectory}/test-reports"/>
-
- <property name="buildMetadataDirectory" value="${buildClassesDirectory}/META-INF"/>
-
- <property name="mavenAntTaskJarName" value="maven-ant-tasks-${mavenVersion}.jar"/>
- <property name="gantJarName" value="gant-${gantVersion}.jar"/>
-
- <property name="gantJarPath" value="${buildDirectory}/${gantJarName}"/>
-
- <condition property="skipTestsIsSet">
- <istrue value="${skipTests}"/>
- </condition>
-
- <target name="-checkGroovyHome">
- <!--
- This test is contained in a target so that the test can be completely avoided for the continuous
- integration runs: only check the test for command line invocations, the property is never set for
- continuous integration runs.
- -->
- <condition property="groovyHomeIsSet">
- <isset property="environment.GROOVY_HOME"/>
- </condition>
- </target>
-
- <target name="-initializeMavenAntTask">
- <path id="mavenAntTaskJarPathId">
- <fileset dir="${jarfilesDirectory}" includes="maven-ant-tasks-${mavenAntTaskVersion}.jar"/>
- <fileset dir="${jarfilesDirectory}" includes="plexus-classworlds.jar"/>
- <fileset dir="${jarfilesDirectory}" includes="plexus-utils.jar"/>
- <fileset dir="${mavenJarfilesDirectory}" includes="maven-debian-uber.jar"/>
- </path>
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="mavenAntTaskJarPathId"/>
- </target>
-
- <target name="-initializeWithGroovyHome" if="groovyHomeIsSet">
- <echo message="Building with the Groovy installation at $GROOVY_HOME (${environment.GROOVY_HOME})."/>
- <path id="groovyJarPathId">
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="groovy-2.*.jar"/>
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="groovy-ant.jar"/>
- </path>
- <path id="compileJarSetPathId">
- <path refid="groovyJarPathId"/>
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="commons-cli*.jar"/>
- <!-- The ASM and Antlr jars are just transitive dependencies of the Groovy jar, the Ant and Commons
- CLI jars are needed directly by the Gant code. -->
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="asm*.jar"/>
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="ant*.jar"/> <!-- Intentionally includes Ant and Antlr jars. -->
- </path>
- <path id="testJarSetPathId">
- <path refid="compileJarSetPathId"/>
- <fileset dir="${environment.GROOVY_HOME}/lib" includes="junit*.jar"/>
- </path>
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="compileJarSetPathId"/>
- <property name="scriptsExtrasDirectory" value="${scriptsDirectory}/bin_requiresGroovy"/>
- </target>
-
- <target name="-initializeNoGroovyHome" depends="-initializeMavenAntTask" unless="groovyHomeIsSet">
- <echo message="Building without a Groovy installation. Using Groovy ${groovyVersion}, Commons CLI ${commonsCliVersion}, Ant ${antVersion} from Maven repository."/>
- <artifact:dependencies pathId="groovyJarPathId" filesetId="groovyJarFilesetId">
- <dependency groupId="org.codehaus.groovy" artifactId="groovy-all" version="${groovyVersion}"/>
- </artifact:dependencies>
- <artifact:dependencies pathId="compileJarSet" filesetId="compileJarSetFilesetId">
- <dependency groupId="commons-cli" artifactId="commons-cli" version="${commonsCliVersion}"/>
- </artifact:dependencies>
- <path id="compileJarSetPathId">
- <path refid="groovyJarPathId"/>
- <path refid="compileJarSet"/>
- </path>
- <artifact:dependencies pathId="testJarSet" filesetId="compileJarSetFilesetId">
- <dependency groupId="org.apache.ant" artifactId="ant-junit" version="${antVersion}"/>
- </artifact:dependencies>
- <path id="testJarSetPathId">
- <path refid="compileJarSetPathId"/>
- <path refid="testJarSet"/>
- </path>
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="compileJarSetPathId"/>
- <property name="scriptsExtrasDirectory" value="${scriptsDirectory}/bin_standalone"/>
- </target>
-
- <target name="-compile">
- <mkdir dir="${buildClassesDirectory}"/>
- <groovyc srcdir="${sourceDirectory}" destdir="${buildClassesDirectory}" fork="true" failonerror="true" includeantruntime="false">
- <classpath>
- <path refid="compileJarSetPathId"/>
- </classpath>
- <javac source="5" target="5" debug="on" encoding="UTF-8"/>
- </groovyc>
- </target>
-
- <target name="-package" depends="-compile" unless="testsFailed">
- <mkdir dir="${buildMetadataDirectory}"/>
- <copy todir="${buildMetadataDirectory}" file="LICENCE.txt"/>
- <manifest file="${buildMetadataDirectory}/MANIFEST.MF">
- <attribute name="Built-By" value="${user.name}"/>
- <attribute name="Extension-Name" value="gant"/>
- <attribute name="Specification-Title" value="Gant: scripting Ant tasks with Groovy."/>
- <attribute name="Specification-Version" value="${gantVersion}"/>
- <attribute name="Specification-Vendor" value="The Codehaus"/>
- <attribute name="Implementation-Title" value="Gant: Scripting Ant tasks with Groovy."/>
- <attribute name="Implementation-Version" value="${gantVersion}"/>
- <attribute name="Implementation-Vendor" value="The Codehaus"/>
- </manifest>
- <jar destfile="${gantJarPath}" basedir="${buildClassesDirectory}" manifest="${buildMetadataDirectory}/MANIFEST.MF"/>
- </target>
-
- <target name="-compileTests" depends="-package" unless="skipTestsIsSet">
- <mkdir dir="${buildTestClassesDirectory}"/>
- <groovyc srcdir="${testsDirectory}" destdir="${buildTestClassesDirectory}" fork="true" failonerror="true" includeantruntime="false">
- <classpath>
- <pathelement location="${gantJarPath}"/>
- <path refid="testJarSetPathId"/>
- </classpath>
- <javac source="5" target="5" debug="on" encoding="UTF-8"/>
- </groovyc>
- </target>
-
- <target name="-test" depends="-initializeMavenAntTask,-compileTests" unless="skipTestsIsSet">
- <mkdir dir="${buildTestReportsDirectory}"/>
- <!-- Only need this file if GROOVY_HOME is not set but write it anyway to save the hassle of decision making. -->
- <echo file="groovyAntTaskTestVersion.properties" message="groovyAntTaskTestVersion = ${groovyVersion}"/>
- <artifact:dependencies pathId="ivyJarPathId">
- <dependency groupId="org.apache.ivy" artifactId="ivy" version="${ivyVersion}"/>
- </artifact:dependencies>
- <path id="testClasspathPathId">
- <pathelement location="${buildTestClassesDirectory}"/>
- <path refid="mavenAntTaskJarPathId"/>
- <path refid="ivyJarPathId"/>
- <path refid="testJarSetPathId"/>
- </path>
- <!-- Forkmode should be once for speed but perTest for safety. -->
- <junit printsummary="yes" fork="true" forkmode="once" failureproperty="testsFailed" includeantruntime="false">
- <!--jvmarg line="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/-->
- <formatter type="plain"/>
- <formatter type="xml"/> <!-- Must have XML output for the continuous integration builds. -->
- <batchtest todir="${buildTestReportsDirectory}">
- <fileset dir="${buildTestClassesDirectory}" includes="**/*_Test.class" excludes="**/ant/tests/*"/>
- </batchtest>
- <classpath>
- <path refid="testClasspathPathId"/>
- <pathelement location="${gantJarPath}"/>
- </classpath>
- </junit>
- <junit printsummary="yes" fork="true" forkmode="once" failureproperty="testsFailed" includeantruntime="false">
- <formatter type="plain"/>
- <formatter type="xml"/> <!-- Must have XML output for the continuous integration builds. -->
- <batchtest todir="${buildTestReportsDirectory}">
- <fileset dir="${buildTestClassesDirectory}" includes="**/ant/tests/*_Test.class"/>
- </batchtest>
- <classpath>
- <path refid="testClasspathPathId"/>
- </classpath>
- </junit>
- <delete file="groovyAntTaskTestVersion.properties"/>
- </target>
-
- <target name="-commandLineDependencies" depends="-checkGroovyHome,-initializeWithGroovyHome,-initializeNoGroovyHome"/>
-
- <!--
- The targets usable from the command line.
- -->
-
- <target name="compile" depends="-commandLineDependencies,-compile" description="Compile everything needed for a bootstrap build of Gant."/>
-
- <target name="package" depends="-commandLineDependencies,-package" description="Create the jar file for a bootstrap build of Gant."/>
-
- <target name="compileTests" depends="-commandLineDependencies,-compileTests" description="Compile all the tests for a bootstrap build of Gant."/>
-
- <target name="test" depends="-commandLineDependencies,-test" description="Test a boostrap build of Gant."/>
-
- <target name="clean" description="Clean everything up.">
- <delete dir="${buildDirectory}"/>
- <delete dir="target_forMavenTest"/>
- <delete>
- <fileset dir="." defaultexcludes="false">
- <include name="**/*~"/>
- <include name="texput.log"/>
- <include name="cobertura.ser"/>
- </fileset>
- </delete>
- </target>
-
-</project>
diff --git a/debian/changelog b/debian/changelog
index 8a07a3d..31e4794 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ gant (1.9.11-2) UNRELEASED; urgency=medium
* Team upload.
* Removed the recommended dependency on maven2
+ * Build with gradle-debian-helper
-- Emmanuel Bourg <ebourg at apache.org> Wed, 09 Dec 2015 16:30:29 +0100
diff --git a/debian/control b/debian/control
index 4b35dd1..ddf8d3e 100644
--- a/debian/control
+++ b/debian/control
@@ -4,14 +4,12 @@ Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
Uploaders: Varun Hiremath <varun at debian.org>, Torsten Werner <twerner at debian.org>,Miguel Landaeta <miguel at miguel.cc>
Build-Depends: ant,
- cdbs,
debhelper (>= 9),
default-jdk,
- groovy2,
+ gradle-debian-helper,
libmaven-ant-tasks-java,
libplexus-classworlds-java,
- libplexus-utils-java,
- maven2
+ libplexus-utils-java
Standards-Version: 3.9.6
Vcs-Git: git://anonscm.debian.org/pkg-java/gant.git
Vcs-Browser: http://anonscm.debian.org/cgit/pkg-java/gant.git
diff --git a/debian/maven.rules b/debian/maven.rules
new file mode 100644
index 0000000..d0a06bb
--- /dev/null
+++ b/debian/maven.rules
@@ -0,0 +1,3 @@
+
+junit junit * s/.*/4.x/ * *
+org.codehaus.groovy groovy-all * s/.*/2.x/ * *
diff --git a/debian/patches/01-build.patch b/debian/patches/01-build.patch
new file mode 100644
index 0000000..53d7102
--- /dev/null
+++ b/debian/patches/01-build.patch
@@ -0,0 +1,11 @@
+--- a/build.gradle
++++ b/build.gradle
+@@ -133,7 +133,7 @@
+ test{groovy{srcDir '../src/test/groovy'}}
+ integTest{groovy{srcDir '../src/integTest/groovy'}}
+ }
+- metaInf << fileTree(dir: '..').matching{include 'LICENCE.txt'}
++ //metaInf << fileTree(dir: '..').matching{include 'LICENCE.txt'}
+ final theVendor = 'The Codehaus'
+ final theTitle = 'Gant: Scripting Ant tasks with Groovy.'
+ jar{
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..605653d
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-build.patch
diff --git a/debian/rules b/debian/rules
index 62cc8bd..5628a7f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,23 +1,23 @@
#!/usr/bin/make -f
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/ant.mk
+export JAVA_HOME = /usr/lib/jvm/default-java
-JAVA_HOME := /usr/lib/jvm/default-java
-GROOVY_HOME := /usr/share/groovy2
+GROOVY_HOME = /usr/share/groovy2
+UPSTREAM_VERSION = $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+)[-+].*$$/\1/p')
-DEB_ANT_BUILDFILE := debian/build.xml
-DEB_ANT_BUILD_TARGET := package
-DEB_ANT_ARGS := -Denvironment.GROOVY_HOME=$(GROOVY_HOME)
-UPSTREAM_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -e's,+dak.*,,')
+%:
+ dh $@ --buildsystem=gradle
-DEB_INSTALL_CHANGELOGS_ALL = releaseNotes.txt
+override_dh_install:
+ dh_install
-install/gant::
- dh_install target_gant/gant-$(UPSTREAM_VERSION).jar $(GROOVY_HOME)/lib
+ dh_install gant/build/libs/gant-$(UPSTREAM_VERSION).jar $(GROOVY_HOME)/lib
dh_link $(GROOVY_HOME)/lib/gant-$(UPSTREAM_VERSION).jar /usr/share/java/gant.jar
- install -D -m755 debian/gant.sh $(DEB_DESTDIR)/$(GROOVY_HOME)/bin/gant
+ install -D -m755 debian/gant.sh debian/gant/$(GROOVY_HOME)/bin/gant
dh_link $(GROOVY_HOME)/bin/gant /usr/bin/gant
+override_dh_installchangelogs:
+ dh_installchangelogs releaseNotes.txt
+
get-orig-source:
uscan --force-download --rename
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/gant.git
More information about the pkg-java-commits
mailing list