[plm] 06/13: Use an ant file instead of fooling around with jh_build
Martin Quinson
mquinson at moszumanska.debian.org
Sat Jan 2 21:09:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
mquinson pushed a commit to branch master
in repository plm.
commit 540c2e73ce2bcb06bcc41d3c92b8cf85e72f8ffb
Author: Martin Quinson <martin.quinson at loria.fr>
Date: Fri Jan 1 22:16:27 2016 +0100
Use an ant file instead of fooling around with jh_build
This is because jh_build does not like scala.
I had to patch (almost rewrite) the build.xml though, to use the
system-wide elements instead of the embeeded ones (that are removed by
the repacking), and more generally to make it work.
---
debian/control | 3 +-
debian/javabuild | 1 -
debian/patches/system-ant-tasks | 136 +++++++++++++++++++++++++++++++++++++++-
debian/plm.jlibs | 2 +-
debian/plm.manifest | 5 +-
debian/plm.sh | 5 ++
debian/rules | 33 ----------
7 files changed, 143 insertions(+), 42 deletions(-)
diff --git a/debian/control b/debian/control
index d8b1be0..9869efb 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,8 @@ Maintainer: Martin Quinson <mquinson at debian.org>
Build-Depends: debhelper (>> 8), javahelper (>= 0.32), ant, quilt
Build-Depends-Indep: openjdk-7-jdk, scala, libmiglayout-java, librsyntaxtextarea-java,
junit4, libgettext-commons-java, libjson-simple-java, libhttpclient-java, libhttpmime-java, libjgit-java,
- jython, libgettext-ant-tasks-java, imagemagick
+ jython, libgettext-ant-tasks-java, imagemagick,
+ libmockito-java
Standards-Version: 3.9.6
Vcs-Git: git://anonscm.debian.org/pkg-java/plm.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-java/plm.git
diff --git a/debian/javabuild b/debian/javabuild
deleted file mode 100644
index 00019d3..0000000
--- a/debian/javabuild
+++ /dev/null
@@ -1 +0,0 @@
-plm.jar src/
diff --git a/debian/patches/system-ant-tasks b/debian/patches/system-ant-tasks
index a322f75..fc72bae 100644
--- a/debian/patches/system-ant-tasks
+++ b/debian/patches/system-ant-tasks
@@ -1,10 +1,140 @@
+Modify the ant file to use the system-wide elements instead of the
+embeeded ones.
+
---
- build.xml | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ build.xml | 90 ++++++++++++++++----------------------------------------------
+ 1 file changed, 24 insertions(+), 66 deletions(-)
+Index: b/build.xml
+===================================================================
--- a/build.xml
+++ b/build.xml
-@@ -182,7 +182,7 @@
+@@ -38,7 +38,20 @@
+ <property file="${base.dir}/keystore.properties"/>
+
+ <path id="project.class.path">
+- <pathelement path="${classes.dir}"/>
++ <pathelement path="${classes.dir}"/>
++ <pathelement location="/usr/share/scala/lib/scala-compiler.jar" />
++ <pathelement location="/usr/share/scala/lib/scala-library.jar" />
++ <pathelement location="/usr/share/scala/lib/scala-reflect.jar" />
++ <pathelement location="/usr/share/java/gettext-commons.jar" />
++ <pathelement location="/usr/share/java/org.eclipse.jgit.jar" />
++ <pathelement location="/usr/share/java/miglayout.jar" />
++ <pathelement location="/usr/share/java/rsyntaxtextarea.jar" />
++ <pathelement location="/usr/share/java/json-simple.jar" />
++ <pathelement location="/usr/share/java/httpclient.jar" />
++ <pathelement location="/usr/share/java/httpcore.jar" />
++ <pathelement location="/usr/share/java/jython.jar" />
++ <pathelement location="/usr/share/java/junit4.jar" />
++ <pathelement location="/usr/share/java/mockito-core.jar" />
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar"/>
+ </fileset>
+@@ -50,23 +63,23 @@
+ <delete dir="${site.dir}/bin"/>
+ </target>
+
+- <taskdef resource="scala/tools/ant/antlib.xml">
++ <taskdef name="scalac"
++ classname="scala.tools.ant.Scalac">
+ <classpath>
+- <pathelement location="${lib.dir}/scala/scala-compiler-2.11.4.jar" />
+- <pathelement location="${lib.dir}/scala/scala-library-2.11.4.jar" />
+- <pathelement location="${lib.dir}/scala/scala-reflect-2.11.4.jar" />
++ <pathelement location="/usr/share/scala/lib/scala-compiler.jar" />
++ <pathelement location="/usr/share/scala/lib/scala-library.jar" />
++ <pathelement location="/usr/share/scala/lib/scala-reflect.jar" />
+ </classpath>
+ </taskdef>
+
+ <target name="compile" description="compile all source files">
+ <mkdir dir="${classes.dir}"/>
+ <scalac classpathref="project.class.path" destdir="${classes.dir}" srcdir="${src.dir}" />
+- <javac classpathref="project.class.path" destdir="${classes.dir}" srcdir="${src.dir}" includeantruntime="false" fork="true"/>
++ <javac classpathref="project.class.path" destdir="${classes.dir}" srcdir="${src.dir}" includeantruntime="false" fork="true" encoding="UTF8"/>
+ </target>
+
+ <target name="dist" depends="clean, i18n-generate-jar, compile, updateversion" description="build a standalone application jar file">
+- <mkdir dir="${dist.dir}"/>
+- <jar destfile="${dist.dir}/plm-${plm.major.version}-${plm.minor.version}.jar" filesetmanifest="mergewithoutmain">
++ <jar destfile="plm.jar">
+ <manifest>
+ <attribute name="Built-By" value="M. Quinson, G. Oster and others" />
+ <attribute name="Main-Class" value="plm.core.ui.ProgrammersLearningMachine" />
+@@ -77,69 +90,14 @@
+ <fileset dir="${base.dir}" includes="img/*/*.png img/*.png" excludes="*"/>
+ <fileset dir="${base.dir}" includes="ChangeLog" />
+ <fileset dir="${lib.dir}" excludes="**/*.jar *.pl l10n/missions/* l10n/engine/*"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/RSyntaxTextArea-2.5.4.jar" />
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/miglayout-4.2.jar" />
++<!--
+ <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/tools-openjdk7.jar" />
+
+ <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/scala/scala-compiler-2.11.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/scala/scala-library-2.11.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/scala/scala-reflect-2.11.4.jar"/>
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jython/antlr3-runtime.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jython/asm3-3.2.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jruby-1.5.6-5.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jython/jython-2.5.1.jar"/>
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpclient-4.3.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpcore-4.3.2.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpmime-4.3.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/commons-logging-1.1.1.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/gettext-commons-0.9.6.jar"/>
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/json_simple-1.1.jar" />
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/plm-messages.jar" />
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/gson-2.2.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/org.eclipse.egit.github.core-2.1.5.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/org.eclipse.jgit-3.2.0.201312181205-r.jar" />
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jsch-0.1.50.jar" />
+-
+- </jar>
+-
+- <jar destfile="${dist.dir}/plm-light-${plm.major.version}-${plm.minor.version}.jar" filesetmanifest="mergewithoutmain">
+- <manifest>
+- <attribute name="Built-By" value="M. Quinson and G. Oster" />
+- <attribute name="Main-Class" value="plm.core.ui.ProgrammersLearningMachine" />
+- <attribute name="Class-Path" value="." />
+- </manifest>
+- <fileset dir="${classes.dir}" excludes="**/.gitignore **/*.java **/*.css **/*.html"/>
+- <fileset dir="${src.dir}" includes="**/*.py **/*.scala **/*.java **/*.html **/*.css **/*.png **/*.map" excludes="**/.gitignore"/>
+- <fileset dir="${base.dir}" includes="img/*/*.png img/*.png" excludes="*"/>
+- <fileset dir="${base.dir}" includes="ChangeLog" />
+- <fileset dir="${lib.dir}" excludes="**/*.jar *.pl l10n/engine/* l10n/missions/*"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/RSyntaxTextArea-2.5.4.jar" />
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/miglayout-4.2.jar" />
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/tools-openjdk7.jar" />
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpclient-4.3.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpcore-4.3.2.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/httpmime-4.3.4.jar"/>
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/commons-logging-1.1.1.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/gettext-commons-0.9.6.jar"/>
+-
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/json_simple-1.1.jar" />
+-
++-->
+ <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/plm-messages.jar" />
+
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/gson-2.2.4.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/org.eclipse.egit.github.core-2.1.5.jar"/>
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/org.eclipse.jgit-3.2.0.201312181205-r.jar" />
+- <zipfileset excludes="META-INF/*.SF" src="${lib.dir}/jsch-0.1.50.jar" />
+-
+ </jar>
+-
+ </target>
+
+ <target name="dist-web" depends="compile, updateversion" description="build webstart application jar files">
+@@ -182,7 +140,7 @@
</propertyfile>
</target>
diff --git a/debian/plm.jlibs b/debian/plm.jlibs
index 01bb1ab..8de3a9a 100644
--- a/debian/plm.jlibs
+++ b/debian/plm.jlibs
@@ -1 +1 @@
-plm.jar
\ No newline at end of file
+plm.jar
diff --git a/debian/plm.manifest b/debian/plm.manifest
index 98947a6..5c37017 100644
--- a/debian/plm.manifest
+++ b/debian/plm.manifest
@@ -1,5 +1,4 @@
usr/share/java/plm.jar:
Main-Class: plm.core.ui.ProgrammersLearningMachine
- Class-Path: miglayout.jar rsyntaxtextarea.jar gettext-commons.jar json-simple.jar httpclient.jar httpcore.jar jython.jar org.eclipse.jgit.jar
-
-# scala-compiler.jar scala-library.jar
+ Class-Path: scala-reflect.jar scala-compiler.jar scala-library.jar miglayout.jar rsyntaxtextarea.jar gettext-commons.jar json-simple.jar httpclient.jar httpcore.jar jython.jar org.eclipse.jgit.jar
+
diff --git a/debian/plm.sh b/debian/plm.sh
index a098429..e33e429 100755
--- a/debian/plm.sh
+++ b/debian/plm.sh
@@ -30,6 +30,11 @@ find_jars commons-logging
# http stuff
find_jars httpmime httpcore httpclient
+# scala stuff
+# find_jars scala-compiler (not in the right directory)
+JAVA_CLASSPATH=$JAVA_CLASSPATH:/usr/share/scala/lib/scala-compiler.jar
+find_jars scala-library scala-reflect
+
# We obviously need our own library
find_jars plm
diff --git a/debian/rules b/debian/rules
index b82a002..e5651cd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,39 +16,6 @@ export CLASSPATH=$(depspath):$(gitpath):$(langpath):$(httppath):$(scalapath):.
%:
dh $@ --with javahelper --with quilt
-
-override_jh_build:
- # Copy our resource within the wannabe jar file
- mkdir -p debian/_jh_build.plm
- cp -r lib/resources debian/_jh_build.plm
-
- # Copy our image files (but prune the svg files)
- cp -r img debian/_jh_build.plm
- find debian/_jh_build.plm -name "*.svg" -print0 | xargs -0 rm
-
- # Copy other mandated files in place
- jarctn=`find src -name "*.py"; \
- find src -name "*.java"; \
- find src -name "*.scala"; \
- find src -name "*.c"; \
- find src -name "*.html"; \
- find src -name "*.png"; \
- find src -name "*.map"`; \
- for file in $$jarctn ; do\
- whereto=`echo $$file|sed 's|^src/||'` ; \
- install -D -m 644 $$file debian/_jh_build.plm/$$whereto; \
- done
-
- # Generate the translation files
- ant i18n-generate-jar
- cd debian/_jh_build.plm && jar xf ../../lib/plm-messages.jar org
-
- # Finally, ask the scripts to compile our stuff, too
- jh_build --no-javadoc --javacopts="-source 1.7 -encoding UTF-8"
-
-override_dh_auto_build:
- ant -f build.xml clean
-
override_dh_auto_install:
dh_install
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/plm.git
More information about the pkg-java-commits
mailing list