Skip to content
Commits on Source (21)
Copyright © 2010 Reinier Zwitserloot.
Copyright (C) 2009-2017 The Project Lombok Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -118,12 +118,15 @@ _Supported since ipp 1.4_
The defaults are also different:
debug = on
source = 1.6
target = 1.6
source = 1.8
target = 1.8
encoding = UTF-8
includeAntRuntime = false
The _destdir_ directory is also created automatically, so you don't have to `<mkdir>` it first.
(since ipp 1.22: You can also set ecj="true" to use ecj instead. Useful if you want to compile with old source/target).
_Supported since ipp 1.0_
### `<ivy:cachedunjar>` - similar to unjar, except will not unpack jars that don't need to be unpacked.
......@@ -191,3 +194,28 @@ Inner elements:
_Supported since ipp 1.3_
NB: make-maven-repo is no longer under active development since sonatype changed their policy on how maven artifacts are to be added to maven central.
### `<ivy:hardlink>` - creates hardlinks instead of copying files
Attributes:
* `from` - File to hardlink from (only individual files are supported).
* `to` - New file to create which will be a hardlink copy of `from`.
This task will use `fsutil hardlink create` on windows, and `ln` on other systems.
### `<ivy:scpUpload>` and `<ivy:sshExec>` - Uploads files / runs scripts via SSH
Attributes
* `server` - IP or domain of the SSH server to talk to
* `port` - Port to use (optional, defaults to 22)
* `username` - Username to connect as.
* `keyFile` - The only supported connection mechanism is key files, not password protected (many formats supported. ed25519 recommended).
* `knownHosts` - A file listing known hosts; defaults to `ssh.knownHosts`. If you fail to list the host, the command fails put prints what you'd have to add to this file to make it work.
For scpUpload:
* `from` - File to upload.
* `to` - Where to upload to.
For sshExec:
* `cmd` - Command to execute.
<!--
Copyright © 2010-2011 Reinier Zwitserloot.
Copyright © 2010-2017 Reinier Zwitserloot.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......@@ -19,41 +19,38 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project name="com.zwitserloot.ivyplusplus" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus">
<project name="com.zwitserloot.ivyplusplus" default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="jre.version" value="1.7" />
<property name="ivy.retrieve.pattern" value="lib/[conf]/[artifact].[ext]" />
<property name="ivy.lib" value="ivy-2.4.0.jar" />
<property name="ivy.location" value="https://projectlombok.org/downloads/${ivy.lib}" />
<available file="lib/${ivy.lib}" property="ivy.available" />
<available file="lib/ivyplusplus.jar" property="ivyplusplus.available" />
<target name="download-ivy" unless="ivy.available">
<mkdir dir="lib" />
<get src="${ivy.location}" dest="lib/${ivy.lib}" usetimestamp="true" />
</target>
<target name="version" depends="ensure-ipp" description="Shows the version number." unless="ivyplusplus.version">
<mkdir dir="build/lombok" />
<ivy:compile source="1.6" target="1.6" includeDestClasses="false" srcdir="src" destdir="build" includes="com/zwitserloot/ivyplusplus/Version.java" />
<target name="version" description="Shows the version number." unless="ivyplusplus.version">
<mkdir dir="build" />
<javac source="${jre.version}" target="${jre.version}" includeDestClasses="false" includeAntRuntime="false" srcdir="src" destdir="build" includes="com/zwitserloot/ivyplusplus/Version.java">
<compilerarg value="-Xlint:-options" />
</javac>
<java
classname="com.zwitserloot.ivyplusplus.Version"
classpath="build"
failonerror="true"
output="build/version.txt" />
<ivy:loadversion property="ivyplusplus.version" file="build/version.txt" />
<delete file="build/version.txt" />
<loadresource property="ivyplusplus.version">
<file file="build/version.txt" />
<filterchain>
<striplinebreaks />
</filterchain>
</loadresource>
<delete quiet="true" file="build/version.txt" />
<echo level="info">com.zwitserloot.ivyplusplus version: ${ivyplusplus.version}</echo>
</target>
<target name="download-ipp" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="http://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="load-ipp" depends="download-ipp">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
<ivy:ensureippversion version="1.5" property="ivyplusplus.minimumAvailable" />
</target>
<target name="redownload-ipp" unless="ivyplusplus.minimumAvailable">
<get src="http://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" />
<fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail>
</target>
<target name="ensure-ipp" depends="load-ipp, redownload-ipp" />
<path id="build.path">
<fileset dir="lib/build">
<include name="*.jar" />
......@@ -86,9 +83,17 @@
<target name="compile" depends="ensureBuildDeps" description="Compiles ivyplusplus">
<delete quiet="true" file="build/pack/com/zwitserloot/ivyplusplus/antlib.xml" />
<ivy:compile srcdir="src" destdir="build/pack" target="1.6" source="1.6">
<mkdir dir="build/pack" />
<javac includeDestClasses="false" includeAntRuntime="false" srcdir="src" destdir="build/pack" target="${jre.version}" source="${jre.version}">
<classpath refid="build.path" />
</ivy:compile>
<compilerarg value="-Xlint:-options" />
</javac>
<copy todir="build/pack">
<fileset dir="src">
<include name="**/*.template" />
<include name="**/antlib.xml" />
</fileset>
</copy>
</target>
<target name="isolateBridges" depends="compile">
......@@ -113,25 +118,31 @@
</copy>
</target>
<target name="dist" depends="isolateBridges, version, stripeIvy, unpackRuntime" description="Creates the distributable">
<target name="dist" depends="compile, isolateBridges, version, stripeIvy, unpackRuntime" description="Creates the distributable">
<mkdir dir="dist" />
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/build/jarjar.jar" />
<jarjar jarfile="dist/ivyplusplus-${ivyplusplus.version}.jar">
<delete>
<fileset dir="build/runtimedeps" includes="**/*_.SF" />
<fileset dir="build/runtimedeps" includes="**/*_.RSA" />
<fileset dir="build/runtimedeps" includes="META-INF/*.DSA" />
<fileset dir="build/runtimedeps" includes="META-INF/*.SF" />
<fileset dir="build/runtimedeps" includes="META-INF/MANIFEST.MF" />
</delete>
<checksum algorithm="SHA-256" totalproperty="sha256.pack">
<fileset dir="build/runtimedeps" includes="**/*.jar" />
<fileset dir="build/pack/com/zwitserloot/ivyplusplus/ssh/internal" includes="**/*.class" />
</checksum>
<echo file="build/runtimedeps/packhash">${sha256.pack}</echo>
<jar jarfile="dist/ivyplusplus-${ivyplusplus.version}.jar">
<fileset dir="build/pack" />
<fileset dir="build/runtimedeps" />
<rule pattern="com.zwitserloot.cmdreader.**" result="com.zwitserloot.ivyplusplus.libs.com.zwitserloot.cmdreader.@1" />
<manifest>
<attribute name="Main-Class" value="com.zwitserloot.ivyplusplus.createProject.CreateProject" />
<attribute name="ivyplusplus-version" value="${ivyplusplus.version}" />
</manifest>
</jarjar>
</jar>
<copy file="dist/ivyplusplus-${ivyplusplus.version}.jar" tofile="dist/ivyplusplus.jar" />
</target>
<target name="show-dep-report" depends="deps" description="Displays a dependencies report">
<ivy:show-dep-report />
</target>
<target name="stripeIvy">
<mkdir dir="build/pack" />
<unjar src="lib/build/ivy.jar" dest="build/pack" />
......@@ -148,7 +159,8 @@
<replace file="build/pack/com/zwitserloot/ivyplusplus/antlib.xml" token="-- insert here -->" value="-- ivy's antlib -->${antlib-ivy.contents}" />
</target>
<target name="config-ivy" depends="ensure-ipp">
<target name="config-ivy" depends="download-ivy">
<taskdef classpath="lib/ivy-2.4.0.jar" resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" />
<ivy:configure file="buildScripts/ivysettings.xml" />
</target>
......@@ -169,47 +181,62 @@
<ivy:retrieve />
</target>
<target name="contrib" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing lombok.ast.">
<target name="contrib" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing ivyplusplus.">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib" />
<ivy:retrieve />
</target>
<target name="publish" depends="dist" description="Creates distributable and uploads to projectlombok.org">
<property file="ssh.configuration" />
<target name="config-ssh" unless="ssh.username">
<input message="What is your SSH username on the projectlombok.org server? (Enter to abort)." addproperty="ssh.username" />
<condition property="ssh.usernameBlank"><equals arg1="${ssh.username}" arg2="" trim="true" /></condition>
<fail if="ssh.usernameBlank">Aborted.</fail>
<input message="Where is your ssh keyfile located?" addproperty="ssh.keyfile" defaultvalue="${user.home}/.ssh/id_rsa" />
<input message="SSH configuration saved as 'ssh.configuration'. Delete this file to reconfigure. Press enter to continue." />
<propertyfile file="ssh.configuration">
<entry key="ssh.username" value="${ssh.username}" />
<entry key="ssh.keyfile" value="${ssh.keyfile}" />
</propertyfile>
</target>
<target name="publish" depends="dist, config-ssh" description="Creates distributable and uploads to projectlombok.org">
<taskdef name="scp" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.Scp" classpathref="build.path" />
<taskdef name="sshexec" classname="org.apaxhe.tools.ant.taskdefs.optional.ssh.SSHExec" classpathref="build.path" />
<available file="escudo-upload.key" property="escudo.key.available" />
<fail unless="escudo.key.available">You don't have the escudo-upload.key; you'll need it to get write access to the server.</fail>
<scp
localFile="dist/ivyplusplus-${ivyplusplus.version}.jar"
todir="lombokup@projectlombok.org:/web/downloads"
keyfile="escudo-upload.key" passphrase=""
todir="${ssh.username}@projectlombok.org:/data/lombok/staging"
keyfile="${ssh.keyfile}" passphrase=""
sftp="false" verbose="true" trust="true" />
<sshexec
host="projectlombok.org"
username="lombokup"
keyfile="escudo-upload.key" passphrase=""
trust="true" command="./deployIvyPlusPlus '${ivyplusplus.version}'" />
</target>
<target name="intellij" depends="deps" description="Creates intellij project files and downloads all dependencies. Open this directory as project in intellij after running this target.">
<ivy:intellijgen source="1.6">
<conf name="build" />
<module name="ivyplusplus">
<srcdir dir="src" />
</module>
<settings>
<url url="http://projectlombok.org/downloads/lombok.intellij.settings" />
</settings>
</ivy:intellijgen>
username="${ssh.username}"
keyfile="${ssh.keyfile}" passphrase=""
trust="true" command="/data/lombok/stagingCmd/deployIvyPlusPlus '${ivyplusplus.version}'" />
</target>
<target name="eclipse" depends="deps, contrib" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target.">
<ivy:eclipsegen source="1.6">
<srcdir dir="src" />
<conf name="build" sources="contrib" />
<settings>
<url url="http://projectlombok.org/downloads/lombok.eclipse.settings" />
</settings>
</ivy:eclipsegen>
<property name="allDeps" refid="build.path" />
<property name="tab" value="&#x0009;" />
<echo file="build/depslist.txt">${allDeps}</echo>
<replace file="build/depslist.txt" token=":" encoding="UTF-8">
<replacevalue>
</replacevalue>
</replace>
<replaceregexp byline="true" file="build/depslist.txt">
<regexp pattern="^.*?(lib/build/.*.jar)$" />
<substitution expression="${tab}&lt;classpathentry kind=&quot;lib&quot; path=&quot;\1&quot;/&gt;" />
</replaceregexp>
<copy file="src/com/zwitserloot/ivyplusplus/eclipse/project.template" tofile="./.project" />
<replace file="./.project" token="%" value="com.zwitserloot.ivyplusplus" encoding="UTF-8" />
<concat destfile="./.classpath" encoding="UTF-8">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;classpath&gt;
&lt;classpathentry kind="src" path="src/"/&gt;
</concat>
<concat destfile="./.classpath" encoding="UTF-8" append="true" fixlastline="true"><fileset dir="build" includes="depslist.txt" /></concat>
<concat destfile="./.classpath" encoding="UTF-8" append="true"> &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-${jre.version}"/&gt;
&lt;classpathentry kind="output" path="bin"/&gt;
&lt;/classpath&gt;
</concat>
</target>
</project>
......@@ -7,14 +7,15 @@
<conf name="contrib" />
</configurations>
<dependencies>
<dependency org="org.projectlombok" name="lombok" rev="0.11.6" conf="build->default" />
<dependency org="com.jcraft" name="jsch" rev="0.1.42" conf="build->default" />
<dependency org="org.projectlombok" name="jsch-ant-fixed" rev="0.1.42" conf="build" />
<dependency org="org.apache.ant" name="ant" rev="1.8.0" conf="build->master; contrib->sources" />
<dependency org="org.apache.ivy" name="ivy" rev="2.1.0" conf="build->master; contrib->sources" />
<dependency org="com.zwitserloot" name="cmdreader" rev="1.5" conf="build->default; runtime->default" />
<dependency org="com.googlecode.jarjar" name="jarjar" rev="1.1" conf="build->default" />
<dependency org="org.bouncycastle" name="bcprov-jdk16" rev="1.46" conf="build->default; pack->default" />
<dependency org="org.bouncycastle" name="bcpg-jdk16" rev="1.46" conf="build->default; pack->default; contrib->sources" />
<dependency org="org.apache.ivy" name="ivy" rev="2.4.0" conf="build->master; contrib->sources" />
<dependency org="com.zwitserloot" name="cmdreader" rev="1.5" conf="build, runtime->default" />
<dependency org="com.googlecode.jarjar" name="jarjar" rev="1.3" conf="build->default" />
<dependency org="org.bouncycastle" name="bcprov-jdk15on" rev="1.58" conf="build, pack->default" />
<dependency org="org.bouncycastle" name="bcpg-jdk15on" rev="1.58" conf="build->default; pack->default; contrib->sources" />
<dependency org="org.eclipse.tycho" name="org.eclipse.jdt.core" rev="3.13.50.v20171007-0855" conf="build, runtime->default" />
<dependency org="com.hierynomus" name="sshj" rev="0.23.0" conf="build, pack->default" />
<dependency org="org.slf4j" name="slf4j-simple" rev="1.7.25" conf="pack->default" />
</dependencies>
</ivy-module>
files
ivyplusplus.debhelper.log
ivyplusplus.substvars
ivyplusplus.version.properties
ivyplusplus/
<?xml version="1.0" encoding="UTF-8"?>
<project name="com.zwitserloot.ivyplusplus" default="dist">
<property file="debian/ivyplusplus.version.properties" />
<path id="build.path">
<fileset dir="/usr/share/java">
<include name="ant.jar" />
<include name="bcpg.jar" />
<include name="bcprov.jar" />
<include name="com.zwitserloot.cmdreader.jar" />
<include name="ecj.jar" />
<include name="ivy.jar" />
<include name="lombok.jar" />
</fileset>
</path>
<target name="clean">
<delete dir="build" />
<delete dir="dist" />
</target>
<target name="compile">
<mkdir dir="build/pack" />
<javac destdir="build/pack" encoding="UTF-8" source="1.6" target="1.6">
<javac destdir="build/pack" encoding="UTF-8" release="8">
<src path="src" />
<exclude name="com/zwitserloot/ivyplusplus/eclipse/**" />
<exclude name="com/zwitserloot/ivyplusplus/intellij/**" />
<exclude name="com/zwitserloot/ivyplusplus/mavencentral/**" />
<exclude name="com/zwitserloot/ivyplusplus/ssh/**" />
<classpath refid="build.path" />
</javac>
</target>
......
ivyplusplus (1.26-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patch
- Fixed the compatibility with the version of Ant in Debian
- New dependency on libecj-java
- Ignore the ssh classes (missing sshj dependency)
- Generate Java 8 bytecode
* Build temporarily with OpenJDK 8 to work around the Lombok
incompatibility with Java 10
* Install the jar with javahelper
* Replaced the Ant clean target with debian/clean
* Standards-Version updated to 4.2.1
* Switch to debhelper level 11
* Use salsa.debian.org Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Tue, 18 Sep 2018 11:58:38 +0200
ivyplusplus (1.14-5) unstable; urgency=medium
* Team upload.
......
usr/share/java/ivyplusplus.jar /usr/share/java/ecj.jar
build/
dist/
......@@ -2,22 +2,26 @@ Source: ivyplusplus
Section: java
Priority: optional
Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org>
Build-Depends: ant,
Build-Depends:
ant,
ant-optional,
cmdreader,
debhelper (>= 9),
debhelper (>= 11),
default-jdk,
ivy,
javahelper,
libecj-java,
libjarjar-java,
liblombok-java
Standards-Version: 3.9.7
liblombok-java,
openjdk-8-jdk
Standards-Version: 4.2.1
Vcs-Git: https://salsa.debian.org/java-team/ivyplusplus.git
Vcs-Browser: https://salsa.debian.org/java-team/ivyplusplus
Homepage: https://github.com/rzwitserloot/ivyplusplus
Vcs-Git: https://anonscm.debian.org/git/pkg-java/ivyplusplus.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/ivyplusplus.git
Package: ivyplusplus
Architecture: all
Depends: ${misc:Depends}
Depends: ${misc:Depends}, libecj-java
Description: Adds features to ivy for creating projects
ivyplusplus (ipp) adds a few useful features to ivy, such as creating
an eclipse project from your deps. Aside from ivy itself, you get a
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ivyplusplus
Source: https://github.com/rzwitserloot/ivyplusplus
Files: *
Copyright: 2010-2015 Reinier Zwitserloot
Copyright: 2010-2017, Reinier Zwitserloot
License: MIT
Files: debian/*
Copyright: 2015 Hans-Christoph Steiner <hans@eds.org>
Copyright: 2015, Hans-Christoph Steiner <hans@eds.org>
2016, Markus Koschany <apo@debian.org>
2018, Emmanuel Bourg <ebourg@apache.org>
License: MIT
License: MIT
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......
dist/ivyplusplus-1.14.jar /usr/share/java/
dist/ivyplusplus-*.jar
/usr/share/java/ivyplusplus-1.14.jar /usr/share/ant/lib/ivyplusplus.jar
/usr/share/java/ivyplusplus-1.14.jar /usr/share/java/ivyplusplus.jar
/usr/share/java/ivyplusplus.jar /usr/share/ant/lib/ivyplusplus.jar
Description: Fixes the compatibility with the version of Ant in Debian
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/src/com/zwitserloot/ivyplusplus/ecj/EcjAdapter.java
+++ b/src/com/zwitserloot/ivyplusplus/ecj/EcjAdapter.java
@@ -21,6 +21,7 @@
import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Resource;
import org.apache.tools.ant.types.resources.FileResource;
import org.eclipse.jdt.core.compiler.CategorizedProblem;
import org.eclipse.jdt.internal.compiler.Compiler;
@@ -259,11 +260,13 @@
}
if (javac.getClasspath() != null) {
- Iterator<FileResource> iterator = javac.getClasspath().iterator();
+ Iterator<Resource> iterator = javac.getClasspath().iterator();
while (iterator.hasNext()) {
- FileResource fileResource = iterator.next();
- File classesFile = fileResource.getFile();
- if (classesFile.exists()) classpathList.add(FileSystem.getClasspath(classesFile.toString(), "UTF-8", null));
+ Resource fileResource = iterator.next();
+ if (fileResource instanceof FileResource) {
+ File classesFile = ((FileResource) fileResource).getFile();
+ if (classesFile.exists()) classpathList.add(FileSystem.getClasspath(classesFile.toString(), "UTF-8", null));
+ }
}
}
@@ -275,9 +278,12 @@
Path bootClasspath = javac.getBootclasspath();
// Step 2: iterate over the boot class path entries as specified in the ant path
- for (Iterator<FileResource> iterator = bootClasspath.iterator(); iterator.hasNext();) {
- FileResource fileResource = iterator.next();
- if (fileResource.getFile().exists()) classpaths.add(FileSystem.getClasspath(fileResource.getFile().toString(), "UTF-8", null));
+ for (Iterator<Resource> iterator = bootClasspath.iterator(); iterator.hasNext();) {
+ Resource fileResource = iterator.next();
+ if (fileResource instanceof FileResource) {
+ File file = ((FileResource) fileResource).getFile();
+ if (file.exists()) classpaths.add(FileSystem.getClasspath(file.toString(), "UTF-8", null));
+ }
}
}
......@@ -10,11 +10,9 @@ Forwarded: not-needed
src/com/zwitserloot/ivyplusplus/antlib.xml | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/com/zwitserloot/ivyplusplus/antlib.xml b/src/com/zwitserloot/ivyplusplus/antlib.xml
index d3752bd..d846ab1 100644
--- a/src/com/zwitserloot/ivyplusplus/antlib.xml
+++ b/src/com/zwitserloot/ivyplusplus/antlib.xml
@@ -22,14 +22,9 @@
@@ -22,18 +22,11 @@
-->
<antlib xmlns:current="ant:current">
<!-- insert here -->
......@@ -27,5 +25,9 @@ index d3752bd..d846ab1 100644
<typedef name="ensure-ipp-version" classname="com.zwitserloot.ivyplusplus.EnsureVersion" />
- <typedef name="create-artifact-bundle" classname="com.zwitserloot.ivyplusplus.mavencentral.CreateArtifactBundle" />
<typedef name="cachedunjar" classname="com.zwitserloot.ivyplusplus.CachedUnjar" />
<typedef name="hardlink" classname="com.zwitserloot.ivyplusplus.Hardlink" />
- <typedef name="scpUpload" classname="com.zwitserloot.ivyplusplus.ssh.ScpUpload" />
- <typedef name="sshExec" classname="com.zwitserloot.ivyplusplus.ssh.SshExec" />
<macrodef name="show-html" description="Shows an HTML page.">
<attribute name="file" />
exclude-unsupported-classes-from-antlib.xml.patch
ant-compatibility.patch
......@@ -2,15 +2,10 @@
include /usr/share/dpkg/default.mk
export JAVA_HOME=/usr/lib/jvm/default-java
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-${DEB_BUILD_ARCH}
%:
dh $@ --parallel
override_dh_auto_clean:
dh_auto_clean
ant -buildfile debian/build.xml -Dbasedir=$(CURDIR) clean
dh $@ --with javahelper
override_dh_auto_build:
echo ivyplusplus.version=$(DEB_VERSION_UPSTREAM) > debian/ivyplusplus.version.properties
ant -buildfile debian/build.xml -Dbasedir=$(CURDIR) dist
ant -buildfile debian/build.xml -Dbasedir=$(CURDIR) -Divyplusplus.version=$(DEB_VERSION_UPSTREAM)
......@@ -35,9 +35,6 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import lombok.Cleanup;
import lombok.Data;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Delete;
......@@ -174,14 +171,19 @@ public class CachedUnjar extends MatchingTask {
}
private void saveCache(Collection<CacheRecord> crs) throws IOException {
@Cleanup FileOutputStream fos = new FileOutputStream(marker);
FileOutputStream fos = new FileOutputStream(marker);
try {
for (CacheRecord cr : crs) fos.write(cr.write().getBytes("UTF-8"));
} finally {
fos.close();
}
}
private static Set<CacheRecord> readCaches(File marker) throws IOException {
Set<CacheRecord> out = new LinkedHashSet<CacheRecord>();
try {
@Cleanup FileInputStream fis = new FileInputStream(marker);
FileInputStream fis = new FileInputStream(marker);
try {
BufferedReader br = new BufferedReader(new InputStreamReader(fis, "UTF-8"));
for (String line = br.readLine(); line != null; line = br.readLine()) {
line = line.trim();
......@@ -189,15 +191,49 @@ public class CachedUnjar extends MatchingTask {
if (line.length() == 0) continue;
out.add(CacheRecord.read(line));
}
} finally {
fis.close();
}
} catch (FileNotFoundException e) {}
return out;
}
@Data
private static class CacheRecord {
private final String name;
private final long lastMod, len;
public CacheRecord(String name, long lastMod, long len) {
this.name = name;
this.lastMod = lastMod;
this.len = len;
}
@Override public String toString() {
return name + "[lastMod = " + lastMod + ", len = " + len + "]";
}
@Override public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + (int) (lastMod ^ (lastMod >>> 32));
result = prime * result + (int) (len ^ (len >>> 32));
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
@Override public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (getClass() != obj.getClass()) return false;
CacheRecord other = (CacheRecord) obj;
if (lastMod != other.lastMod) return false;
if (len != other.len) return false;
if (name == null) {
if (other.name != null) return false;
} else if (!name.equals(other.name)) return false;
return true;
}
static CacheRecord read(String line) {
String[] elems = line.split(" ::: ", 3);
return new CacheRecord(elems[0], Long.parseLong(elems[1]), Long.parseLong(elems[2]));
......