Skip to content

Commits on Source 5

......@@ -3,19 +3,19 @@
<classpathentry kind="src" path="source/java"/>
<classpathentry kind="src" path="sourceExamples/java"/>
<classpathentry kind="src" path="sourceTest/java"/>
<classpathentry kind="lib" path="/libraries/commons-lang/commons-lang.jar" sourcepath="/libraries/commons-lang/src.zip"/>
<classpathentry kind="lib" path="/libraries/commons-io/commons-io.jar" sourcepath="/libraries/commons-io/src.zip"/>
<classpathentry kind="lib" path="/libraries/cisd-args4j/cisd-args4j.jar"/>
<classpathentry kind="lib" path="/libraries/restrictionchecker/restrictions.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="/libraries/testng/testng-jdk15.jar" sourcepath="/libraries/testng/src.zip"/>
<classpathentry kind="lib" path="/libraries/jmock/jmock.jar"/>
<classpathentry kind="lib" path="/libraries/jmock/hamcrest/hamcrest-core.jar"/>
<classpathentry kind="lib" path="/libraries/jmock/hamcrest/hamcrest-integration.jar"/>
<classpathentry kind="lib" path="/libraries/jmock/hamcrest/hamcrest-library.jar"/>
<classpathentry kind="lib" path="/libraries/jmock/objenesis/objenesis-1.0.jar"/>
<classpathentry kind="lib" path="libs"/>
<classpathentry kind="lib" path="/libraries/sis-base/sis-base.jar" sourcepath="/libraries/sis-base/sis-base-src.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="libs/test/hamcrest-core.jar"/>
<classpathentry kind="lib" path="libs/test/hamcrest-integration.jar"/>
<classpathentry kind="lib" path="libs/test/hamcrest-library.jar"/>
<classpathentry kind="lib" path="libs/test/jmock.jar"/>
<classpathentry kind="lib" path="libs/test/objenesis-1.0.jar"/>
<classpathentry kind="lib" path="libs/test/testng-jdk15.jar"/>
<classpathentry kind="lib" path="libs/build/ecj-4.6.1.jar"/>
<classpathentry kind="lib" path="libs/prod/cisd-args4j-9.11.2.jar" sourcepath="libs/prod/cisd-args4j-9.11.2-sources.jar"/>
<classpathentry kind="lib" path="libs/prod/commons-lang3-3.7.jar" sourcepath="libs/prod/commons-lang3-3.7-sources.jar"/>
<classpathentry kind="lib" path="libs/prod/commons-io-2.6.jar" sourcepath="libs/prod/commons-io-2.6-sources.jar"/>
<classpathentry kind="lib" path="libs/prod/sis-base-18.08.0.jar" sourcepath="libs/prod/sis-base-18.08.0-sources.jar"/>
<classpathentry kind="output" path="targets/classes"/>
</classpath>
......@@ -7,3 +7,4 @@
/test-output
/source/c/build
source/c/hdf5*tar*
source/c/CMake*zip
apply from: 'javaproject.gradle'
group='sis'
sourceCompatibility='1.8'
targetCompatibility='1.8'
dependencies {
compile 'cisd:cisd-args4j:+',
'cisd:cisd-base:+',
'rinn:restrictions:+'
testCompile 'testng:testng:+',
'jmock:jmock:+'
compile fileTree(dir: 'libs/prod', include: '*.jar')
testCompile fileTree(dir: 'libs/test', include: '*.jar')
}
tasks.withType(Test) {
systemProperty "java.library.path", "libs/native/jhdf5/amd64-Linux:libs/native/jhdf5/amd64-Linux:libs/native/jhdf5/x86_64-Mac OS X:libs/native/jhdf5/x86_64-Mac OS X"
}
// Eclipse Gradle plugin always uses the default JRE, so we need to explicitly set it to 1.7.
// (https://issues.gradle.org/browse/GRADLE-3100)
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7'
}
}
jar {
baseName "${project.group}-jhdf5-core"
from (sourceSets.main.output.classesDir) {
exclude('ch/systemsx/cisd/hdf5/h5ar')
exclude('ch/systemsx/cisd/hdf5/io')
}
from('targets/dist') {
include 'BUILD*INFO'
}
manifest {
attributes 'Main-Class': 'ch.systemsx.cisd.hdf5.BuildAndEnvironmentInfo'
attributes 'Class-Path': configurations.runtime.collect { it.getName() }.join(' ')
}
}
task nativeJarLinuxIntel(type: Jar) {
archiveName 'hdf5-linux-intel.jar'
from ("libs") {
include 'native/jhdf5/amd64-Linux/**/*'
include 'native/jhdf5/arm-Linux/**/*'
}
from('targets/dist') {
include 'BUILD*INFO'
}
}
task nativeJarMacIntel(type: Jar) {
archiveName 'hdf5-macosx-intel.jar'
from ("libs") {
include 'native/jhdf5/x86_64-Mac OS X/**/*'
}
from('targets/dist') {
include 'BUILD*INFO'
}
}
task nativeJarWindowsIntel(type: Jar) {
archiveName 'hdf5-windows-intel.jar'
from ("libs") {
include 'native/jhdf5/amd64-Windows/**/*'
}
baseName "${project.group}-jhdf5"
from('targets/dist') {
include 'BUILD*INFO'
}
}
task toolsJar(type: Jar, dependsOn: [compileJava]) {
baseName "${project.group}-jhdf5-tools"
from (sourceSets.main.output.classesDir) {
include('ch/systemsx/cisd/hdf5/h5ar/**/*')
include('ch/systemsx/cisd/hdf5/io/**/*')
}
from('targets/dist') {
include 'BUILD*INFO'
from ("libs/") {
include 'native/jhdf5/**/**/*'
}
manifest {
attributes 'Main-Class': 'ch.systemsx.cisd.hdf5.h5ar.HDF5ArchiverMain'
attributes 'Class-Path': configurations.runtime.collect { it.getName() }.join(' ') + " ${project.group}-jhdf5-core.jar " + [nativeJarLinuxIntel, nativeJarMacIntel, nativeJarWindowsIntel].collect {it.archiveName}.join(' ')
attributes 'Class-Path': configurations.runtime.collect { it.getName().contains("-sources") ? "" : it.getName() + " " }.join('')
}
}
task allJar(type: Jar, dependsOn: [compileJava]) {
sourcesJar {
baseName "${project.group}-jhdf5"
from (sourceSets.main.output.classesDir) {
include '**/*'
}
from (configurations.runtime.collect {zipTree(it)}) {
exclude 'native/**/*'
exclude 'BUILD-*.INFO'
}
from('targets/dist') {
include 'BUILD*INFO'
}
manifest {
attributes 'Main-Class': 'ch.systemsx.cisd.hdf5.h5ar.HDF5ArchiverMain'
attributes 'Class-Path': [nativeJarLinuxIntel, nativeJarMacIntel, nativeJarWindowsIntel].collect {it.archiveName}.join(' ')
}
}
task batteriesIncluded(type: Jar, dependsOn: [allJar, nativeJarLinuxIntel, nativeJarMacIntel, nativeJarWindowsIntel]) {
archiveName "${project.group}-jhdf5-batteries_included.jar"
from (zipTree(allJar.archivePath)) {
include '**/*'
}
from (configurations.runtime.collect {zipTree(it)}) {
include 'native/**/*'
}
from (zipTree(nativeJarLinuxIntel.archivePath)) {
include 'native/**/*'
}
from (zipTree(nativeJarMacIntel.archivePath)) {
include 'native/**/*'
}
from (zipTree(nativeJarWindowsIntel.archivePath)) {
include 'native/**/*'
from ("targets/dist") {
include "BUILD-jhdf5.INFO"
}
manifest {
attributes 'Main-Class': 'ch.systemsx.cisd.hdf5.h5ar.HDF5ArchiverMain'
}
}
task myJavadoc(type: Javadoc) {
source = [ sourceSets.main.allJava, "base-src" ]
classpath = configurations.compile
task myJavadoc(type: Javadoc, dependsOn: [compileJava]) {
source = [ sourceSets.main.allJava, "base-sources" ]
classpath = files(sourceSets.main.output.classesDir) + fileTree(dir: 'libs/prod', include: '*.jar') + files("libs/build/restrictions-1.0.2.jar")
options.memberLevel = JavadocMemberLevel.PUBLIC
options.overview = "overview.html"
include "ch/systemsx/cisd/hdf5/**"
......@@ -159,13 +54,24 @@ task myJavadoc(type: Javadoc) {
exclude "ch/systemsx/cisd/hdf5/ReflectionUtils.java"
}
task javadocZip(type: Zip, dependsOn: myJavadoc) {
archiveName "${project.group}-jhdf5-javadoc.zip"
task javadocJar(type: Jar, dependsOn: myJavadoc) {
archiveName "${project.group}-jhdf5-javadoc-${project.version}.jar"
from javadoc.destinationDir
from ("sourceExamples/java") {
include '**/*'
}
from ("dist/doc") {
include 'JHDF5.pdf'
}
task exampleZip(type: Jar) {
archiveName "${project.group}-jhdf5-examples-src.zip"
from ("targets/dist") {
include "BUILD-jhdf5.INFO"
}
}
task exampleJar(type: Jar) {
baseName "${project.group}-jhdf5-examples-sources"
from ("sourceExamples/java") {
include '**/*'
......@@ -174,78 +80,101 @@ task exampleZip(type: Jar) {
from ("targets/dist") {
include "BUILD-jhdf5.INFO"
}
}
task distributionZip(type: Zip, dependsOn: [jar, toolsJar, allJar, nativeJarLinuxIntel, nativeJarMacIntel, nativeJarWindowsIntel, batteriesIncluded, javadocZip, sourcesJar, exampleZip]) {
baseName "${project.group}-jhdf5"
from (jar.archivePath) {
into "${project.group}-jhdf5/lib"
rename '(.*)', "${project.group}-jhdf5-core.jar"
}
from (toolsJar.archivePath) {
into "${project.group}-jhdf5/lib"
rename '(.*)', "${project.group}-jhdf5-tools.jar"
def execute(command, arguments) {
new ByteArrayOutputStream().withStream { os ->
print "execute: ${command}"
arguments.collect({print " ${it}"})
println ''
def result = exec {
executable = command
args = arguments
standardOutput = os
}
return os.toString().split('\n')
}
}
from (allJar.archivePath) {
into "${project.group}-jhdf5/lib"
rename '(.*)', "${project.group}-jhdf5.jar"
task processDistFiles( type: Copy) {
into "$buildDir/output/dist"
from ("dist") {
exclude 'doc/JHDF5.odt'
}
from (configurations.runtime) {
exclude '*restriction*'
exclude '*bcel*'
into "${project.group}-jhdf5/lib"
from ("dist") {
include 'doc/JHDF5.odt'
rename { "JHDF5-${version}.odt" }
}
from (zipTree(batteriesIncluded.archivePath)) {
into "${project.group}-jhdf5/lib"
include 'native/**'
doLast {
execute('lowriter', [ '--headless', '--convert-to', 'pdf', '--outdir', "$buildDir/output/dist/doc", "$buildDir/output/dist/doc/JHDF5-${version}.odt" ])
}
from (nativeJarLinuxIntel.archivePath) {
into "${project.group}-jhdf5/lib/nativejar"
}
from (nativeJarMacIntel.archivePath) {
into "${project.group}-jhdf5/lib/nativejar"
task distributionZip(type: Zip, dependsOn: [jar, javadocJar, sourcesJar, exampleJar, processDistFiles]) {
baseName "${project.group}-jhdf5"
from('targets/dist') {
into "${project.group}-jhdf5"
include 'version.txt'
include 'build.txt'
}
from (nativeJarWindowsIntel.archivePath) {
into "${project.group}-jhdf5/lib/nativejar"
from ("$buildDir/output/dist") {
into "${project.group}-jhdf5"
include '*'
}
from (batteriesIncluded.archivePath) {
into "${project.group}-jhdf5/lib/batteries_included"
from ("$buildDir/output/dist") {
into "${project.group}-jhdf5"
include 'bin/*'
}
from ("dist") {
from ("$buildDir/output/dist") {
into "${project.group}-jhdf5"
include 'doc/*'
}
from (javadocZip.archivePath) {
from (javadocJar.archivePath) {
into "${project.group}-jhdf5/doc"
}
from (exampleZip.archivePath) {
from (exampleJar.archivePath) {
into "${project.group}-jhdf5/doc"
}
from (configurations.runtime) {
include '*-sources*'
into "${project.group}-jhdf5/sources"
}
from (sourcesJar.archivePath) {
into "${project.group}-jhdf5/src"
rename '(.*)', "${project.group}-jhdf5-src.zip"
into "${project.group}-jhdf5/sources"
}
// BR 2014-06-09:
// This is a workaround for an issue in Gradle: if one of entries from a jar file gets extraced read-only,
// overwriting it in a subsequent run will fail. It should be fixed in a future version of Gradle.
// See http://forums.gradle.org/gradle/topics/ziptree_unable_to_overwrite_temporary_read_only_files
doLast {
exec {
commandLine = "chmod -R u+w $buildDir/tmp/expandedArchives".tokenize()
from (jar.archivePath) {
into "${project.group}-jhdf5/lib"
}
from (configurations.runtime) {
exclude '*restriction*'
exclude '*bcel*'
exclude '*-sources*'
into "${project.group}-jhdf5/lib"
}
from ("libs") {
into "${project.group}-jhdf5/lib"
include 'native/**'
}
from (configurations.runtime.collect {zipTree(it)}) {
into "${project.group}-jhdf5/lib"
include 'native/**/*'
}
}
......@@ -258,22 +187,6 @@ if (project == project.rootProject)
module "${project.group}-jhdf5"
revision project.revisionForPublication
from components.java
artifact(toolsJar) {
name = "${project.group}-jhdf5-tools"
conf = "runtime"
}
artifact(nativeJarLinuxIntel) {
name = "hdf5-linux-intel"
conf = "runtime"
}
artifact(nativeJarMacIntel) {
name = "hdf5-macosx-intel"
conf = "runtime"
}
artifact(nativeJarWindowsIntel) {
name = "hdf5-windows-intel"
conf = "runtime"
}
artifact(sourcesJar) {
type = "source"
}
......
libsis-jhdf5-java (18.08~pre+git20180805.da55947+dfsg-1) UNRELEASED; urgency=medium
libsis-jhdf5-java (18.09.0-pre1+dfsg-1) UNRELEASED; urgency=medium
* Pre-release to adapt to HDF5 1.10.3-pre1
* Use git mode in watch file
* Adapt watch file to upstream Gitlab clone tags
* Drop now unneeded get-orig-source target
* Fix homepage
* Use gradle build system
* Build-Depends: ant
* Versioned Build-Depends: libsis-base-java (>= 18.08.0~)
-- Andreas Tille <tille@debian.org> Mon, 13 Aug 2018 14:30:28 +0200
......
......@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 11~),
ant,
libcommons-lang-java,
libcommons-io-java,
libsis-base-java,
libsis-base-java (>= 18.08.0~),
libhdf5-dev (>> 1.8.13),
junit4,
testng,
......
......@@ -4,7 +4,7 @@ Description: Do not make wrong assumptions about directory name
--- a/javaproject.gradle
+++ b/javaproject.gradle
@@ -50,7 +50,7 @@ sourceSets {
@@ -50,13 +50,9 @@ sourceSets {
buildDir = 'targets/gradle'
buildscript {
......@@ -12,4 +12,10 @@ Description: Do not make wrong assumptions about directory name
+ apply from: 'repository.gradle'
repositories repositoryConfig
-
- dependencies {
- classpath 'cisd:cisd-ant-tasks:+'
- }
}
repositories repositoryConfig
......@@ -17,9 +17,9 @@ TESTIGNORE = sourceTest/java/ch/systemsx/cisd/hdf5/HDF5RoundtripTest.java \
sourceTest/java/ch/systemsx/cisd/hdf5/io/HDF5DataSetRandomAccessFileTest.java
%:
dh $@ --buildsystem=gradle --with javahelper
dh $@ --with javahelper # --buildsystem=gradle
_override_dh_auto_clean:
override_dh_auto_clean:
rm -rf build *.jar
rm -rf source/c/*.log
rm -rf source/c/*.so
......@@ -31,19 +31,19 @@ _override_dh_auto_clean:
#Things that we'd probably exclude from the orig.tar.gz anyway
rm -rf jsrc lib ./sourceTest/java/jni
_override_dh_auto_build:
override_dh_auto_build:
# C build
cd source/c && \
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -fPIC -Wl,--exclude-libs,ALL \
-I/usr/lib/jvm/default-java/include/ -I/usr/include/hdf5/serial \
jhdf5/*.c hdf-java/*.c -o libsis-jhdf5.so -lz -lhdf5_serial
*.c jni/*.c -o libsis-jhdf5.so -lz -lhdf5_serial
# Java build - see README.source about the file being removed
mkdir jsrc ; cp -r source/java/ch source/java/ncsa jsrc
rm jsrc/ch/systemsx/cisd/hdf5/h5ar/HDF5ArchiverMain.java
# This line is still needed on Ubuntu 14.04
jh_build sis-jhdf5.jar jsrc
_override_dh_auto_test:
override_dh_auto_test:
# FIXME
# Due to bug #842815 several tests are failing
# To get at least some installable package these tests are ignored here
......
version=4
opts="mode=git,pretty=18.08~pre+git%cd.%h,repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
https://sissource.ethz.ch/sispub/jhdf5.git HEAD
opts="repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
https://sissource.ethz.ch/sispub/jhdf5/tags .*/archive/.+/jhdf5-(\d[-\d.pre]+)@ARCHIVE_EXT@
# The versioning is <year>.<month>.<patch level>. So the next release will be
# something like 18.09.0 or 18.10.0. If you call the pre-release 18.08, you will
# be fine
#opts="mode=git,pretty=18.08~pre+git%cd.%h,repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
# https://sissource.ethz.ch/sispub/jhdf5.git HEAD
Documentation
doc/jhdf5-javadoc.zip
General Information:
build.txt
The build information of this distribution in human readable form.
version.txt
The version information of this distribution in machine readable form.
CONTENT
This file.
COPYING
Copyright notice of the JHDF5 and the SIS base libraries.
COPYING-hdf5
Copyright notice of the HDF5 library.
COPYING-commons
Copyright notice of the Apache "Commons IO" and "Commons Lang3" libraries.
COPYING-args4j
Copyright notice of the CISD args4j library.
LICENSE
The Apache Sofware License 2.0.
doc/cisd-jhdf5-examples-src.zip
Example programs for some of the features of JHDF5
Documentation:
doc/sis-jhdf5-javadoc-<VERSION>.jar
The Javadoc of JHDF5.
Source
src/jhdf5-src.zip
doc/sis-jhdf5-examples-sources-<VERSION>.jar
Simple example programs showing some features of JHDF5.
Library
lib/cisd-jhdf5-core.jar:
The Java class files of the JHDF5 library. Requires commons-io.jar, commons-lang.jar and
cisd-base.jar on the class path. Requires the native libraries to be provided separately (see
below at lib/native).
doc/JHDF5-<VERSION>.pdf
A simple (and incomplete) introduction into JHDF5 (in Portable Document Format).
lib/cisd-jhdf5-tools.jar:
The Java class files of the h5ar archiver. It can be used like 'java -jar cisd-jhdf5-tools.jar'.
Requires commons-io.jar, commons-lang.jar, cisd-base.jar, cisd-args4j.jar and cisd-jhdf5-core.jar in
the class path. Requires the native libraries to be provided separately (see below at lib/native).
doc/JHDF5-<VERSION>.odt
A simple (and incomplete) introduction into JHDF5 (in OpenDocument Text Format).
lib/cisd-jhdf5.jar:
All Java class files packaged in one jar file. Requires the native libraries to be provided
separately.
lib/batteries_included:
Includes all Java class files of the JHDF5 library and the h5ar archiver and all native
libraries necessary to use JHDF5.
No other file is needed when using one of these jar files.
All supported platforms:
lib/batteries_included/cisd-jhdf5-batteries_included_lin_win_mac_sol.jar
Linux/MacOS X/Windows, but no Solaris support:
lib/batteries_included/cisd-jhdf5-batteries_included_lin_win_mac.jar
Source Code:
sources/jhdf5-sources-<VERSION>.jar
The source code of jhdf5.
sources/sis-base-18.08.0-sources.jar
The source code of the SIS base library.
sources/cisd-args4j-9.11.2-sources.jar
The source code of the CISD args4j library.
sources/commons-io-2.6-sources.jar
The source code of the Apache "Commons IO" library.
sources/commons-lang3-3.7-sources.jar
The source code of the Apache "Commons Lang3" library.
Libraries:
lib/sis-jhdf5.jar:
The Java class files of the JHDF5 library, the h5ar archiver and the hdf5 native libraries.
Requires commons-io-2.6.jar, commons-lang3-3.7.jar, sis-base-18.08.0.jar and cisd-args4j-9.11.2
(only needed for h5ar archiver) on the class path.
lib/sis-base-18.08.0.jar
The Java class files of the SIS base library. Requires commons-io-2.6.jar, commons-lang3-3.7.jar
on the class path.
lib/cisd-args4j-9.11.2.jar
The Java class files of the CISD args4j library.
lib/commons-lang3-3.7.jar
The Java class files of the Apache "Commons Lang3" library.
lib/commons-io-2.6.jar
The Java class files of the Apache "Commons IO" library.
lib/native:
The native libraries as files in folders jhdf5 and unix. In order to use them ensure that you
point the Java property native.libpath to the root of this hierarchy,
e.g.: "-Dnative.libpath=/home/joe/lib/native"
lib/nativejar:
The jar files in this folder contain the native libraries for each platform, e.g.
hdf5-linux-intel.jar has the shared libraries for Linux on Intel/AMD. Note that these jar
files do not contain the Java class files. In order to make use of these jar files you need
to ensure that the file for your platform is in the class path of the jre.
Wrapper
Wrapper Executables:
bin/h5ar.sh:
A script that calls h5ar by invoking the JRE with appropriate parameters. Suitable for being
symlinked to e.g. /usr/local/bin
......
/*
* Copyright 2008-2012 ETH Zuerich, CISD
* Copyright 2007 - 2018 ETH Zuerich, CISD and SIS.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......
Copyright (c) 2003, Kohsuke Kawaguchi
Copyright 2007 - 2009 ETH Zuerich, CISD.
All rights reserved.
Redistribution and use in source and binary forms,
......
Apache Commons Lang and Commons IO
Copyright 2001-2008 The Apache Software Foundation
Copyright 2001-2018 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
......@@ -4,7 +4,7 @@ HDF5 (Hierarchical Data Format 5) Software Library and Utilities
-----------------------------------------------------------------------------
HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 2006-2010 by The HDF Group.
Copyright 2006-2018 by The HDF Group.
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
Copyright 1998-2006 by the Board of Trustees of the University of Illinois.
......
@echo off
java -Dnative.libpath=%~dp0..\lib\native -jar %~dp0..\lib\sis-jhdf5-tools.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
set /p version=<%~dp0..\version.txt
java -Dnative.libpath=%~dp0..\lib\native -jar %~dp0..\lib\sis-jhdf5-%version%.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
......@@ -19,4 +19,5 @@ while [ -n "${LINK}" ]; do
done
BINDIR="${SCRIPT%/*}"
JHDFDIR="${BINDIR%/*}"
java -Dnative.libpath="${JHDFDIR}/lib/native" -jar "${JHDFDIR}/lib/sis-jhdf5-tools.jar" "$@"
VERSION=`cat "${JHDFDIR}/version.txt"`
java -Dnative.libpath="${JHDFDIR}/lib/native" -jar "${JHDFDIR}/lib/sis-jhdf5-${VERSION}.jar" "$@"
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/2.3/gradle-2.3-all.zip
distributionUrl=http\://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/4.9/gradle-4.9-all.zip
......@@ -19,8 +19,8 @@ configurations.all {
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
distributionUrl = "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/2.3/gradle-2.3-all.zip"
gradleVersion = '4.9'
distributionUrl = "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/4.9/gradle-4.9-all.zip"
}
sourceCompatibility='1.8'
......@@ -50,17 +50,8 @@ sourceSets {
buildDir = 'targets/gradle'
buildscript {
apply from: '../jhdf5/repository.gradle'
repositories repositoryConfig
dependencies {
classpath 'cisd:cisd-ant-tasks:+'
}
}
repositories repositoryConfig
def execute(command, arguments) {
new ByteArrayOutputStream().withStream { os ->
print "execute: ${command}"
......@@ -89,114 +80,70 @@ def execute_working_dir(command, arguments, working_dir) {
}
}
ext.svnCommand = 'svn'
def isSvnProject() {
return new java.io.File(projectDir, ".svn").isDirectory() || new java.io.File(projectDir, "../.svn").isDirectory()
}
def isGitProject() {
return new java.io.File(projectDir, ".git").isDirectory() || new java.io.File(projectDir, "../.git").isDirectory()
}
def executeSVN(arguments) {
arguments.add(0, '--non-interactive')
return execute(svnCommand, arguments)
}
def calculateCleanFlag() {
for (childProject in project.childProjects.values()) {
if (childProject.cleanFlag == 'dirty') {
return 'dirty'
}
}
def isSvn = isSvnProject()
if (isSvn) {
def output = executeSVN(['status', '../' + project.name])
def lines = output.findAll({ (it.startsWith('?') || it.trim().isEmpty()) == false})
return lines.isEmpty() ? 'clean' : 'dirty'
} else if (isGitProject()) {
def output = execute_working_dir('git', ['status', '--porcelain'], '.')
return output.length == 1 && output[0].length() == 0 ? 'clean' : 'dirty'
def getDirtyFiles() {
if (isGitProject()) {
return execute_working_dir('git', ['status', '--porcelain'], '.')
} else {
return 'dirty'
}
return [ 'Workspace is not under revision control.' ].toArray()
}
def findMaximum(lines, key) {
return lines.findAll({ it.startsWith(key)}).collect({element -> element.split(':')[1].toInteger()}).max()
}
def calculateBuildInfo() {
if (isSvnProject()) {
def output = executeSVN(['info', '-R', '../' + project.name])
def maxRevisionNumber = findMaximum(output, 'Revision:')
project.ext.revisionNumber = findMaximum(output, 'Last Changed Rev:')
if (maxRevisionNumber < project.ext.revisionNumber) {
throw new GradleException("Maximum revision ($maxRevisionNumber) is less than the maximum "
+ "last changed revision ($project.ext.revisionNumber).")
}
project.ext.versionNumber = 'SNAPSHOT'
def url = output.findAll({ it.startsWith('URL:')})[0].split('URL:')[1].trim()
if (url.contains('/trunk') == false) {
def pathElements = url.split('/')
project.ext.versionNumber = 'libraries' == pathElements[-2] ? pathElements[-3] : pathElements[-2]
}
} else if (isGitProject()) {
def gitlogoutput = execute_working_dir('git', ['log', '-1', '--format=%at'], '../' + project.name)
project.ext.revisionNumber = Integer.parseInt(gitlogoutput[0])
def tag = 'git describe --tags'.execute().text.trim()
def humanReadableBuildInfo = ""
if (isGitProject()) {
def gitlogoutput = execute_working_dir('git', ['log', '-1', '--format=%at-%H'], '../' + project.name)
def rev = gitlogoutput[0].split("-")
project.ext.revisionNumber = Integer.parseInt(rev[0])
def commitHash = rev[1]
def commitDate = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX").format(new Date(revisionNumber * 1000L))
def dirtyFiles = getDirtyFiles()
project.ext.cleanFlag = dirtyFiles.length == 1 && dirtyFiles[0].length() == 0 ? 'clean' : 'dirty'
project.ext.revisionInfo = "${commitHash} [${commitDate}]"
def tag = 'git tag -l --points-at HEAD'.execute().text.trim()
if (tag == null || tag.isEmpty()) {
project.ext.versionNumber = 'SNAPSHOT'
} else if (tag.contains('pybis')) {
throw new GradleException("project must contain a readme file")
} else {
project.ext.versionNumber = tag
}
humanReadableBuildInfo = "Version: ${project.ext.versionNumber}\n"
humanReadableBuildInfo += "GIT Revision SHA1 Hash: ${commitHash}\n"
humanReadableBuildInfo += "GIT Revision Date: ${commitDate}\n"
if (project.ext.cleanFlag == 'dirty') {
humanReadableBuildInfo += "Uncommitted Files in Build Workspace:\n"
humanReadableBuildInfo += " " + dirtyFiles.join("\n ") + "\n"
}
} else {
project.ext.revisionInfo = '?'
project.ext.revisionNumber = 1
project.ext.versionNumber = 'SNAPSHOT'
project.ext.cleanFlag = 'dirty'
humanReadableBuildInfo += "Build workspace not under revision control.\n"
}
for (childProject in project.childProjects.values()) {
project.ext.revisionNumber = Math.max(project.ext.revisionNumber, childProject.revisionNumber)
if (project.ext.versionNumber != childProject.versionNumber) {
throw new GradleException("Inconsistent version numbers: "
+ "${project.name} at version ${project.ext.versionNumber} but "
+ "${childProject.name} at version ${childProject.versionNumber}.")
}
}
version = "${project.ext.versionNumber}-r${project.ext.revisionNumber}"
project.ext.revisionForPublication = project.ext.versionNumber.startsWith('SNAPSHOT') ? "r${project.ext.revisionNumber}" : project.ext.versionNumber
project.ext.cleanFlag = calculateCleanFlag()
def buildInfo = "${project.ext.versionNumber}:${project.ext.revisionNumber}:${project.ext.cleanFlag}"
version = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${project.ext.revisionNumber}" : project.ext.versionNumber
project.ext.revisionForPublication = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${project.ext.revisionNumber}" : project.ext.versionNumber
def buildInfo = "${project.ext.versionNumber}::${project.ext.revisionInfo}::${project.ext.cleanFlag}"
project.ext.buildInfo = buildInfo
println "BUILD INFO for $project: $buildInfo"
def targetsDist = 'targets/dist'
def distFolder = new File("${project.projectDir}/$targetsDist")
distFolder.deleteDir()
distFolder.mkdirs()
file("${project.projectDir}/$targetsDist/BUILD-${project.name}.INFO") << buildInfo
file("${project.projectDir}/$targetsDist/build.txt") << humanReadableBuildInfo
file("${project.projectDir}/$targetsDist/version.txt") << version
}
calculateBuildInfo()
group='cisd'
task checkRestrictions(type: Exec, dependsOn: [classes, testClasses]) {
doFirst {
def cp = configurations.testCompile.filter({ f -> f.name.startsWith('restrictionchecker') || f.name.startsWith('bcel')}).asPath
def cmd = ['java', '-cp', cp, 'ch.rinn.restrictions.RestrictionChecker', '-r', sourceSets.main.output.classesDir]
if (sourceSets.test.output.classesDir.exists()) {
cmd.add(sourceSets.test.output.classesDir)
}
cmd.add('-cp')
cmd.add(sourceSets.main.output.classesDir)
if (sourceSets.test.output.classesDir.exists()) {
cmd.add(sourceSets.test.output.classesDir)
}
cmd.add(configurations.testCompile.asPath)
commandLine cmd
}
}
def deleteSymbolicLinksRecursively(file) {
def absolutePath = file.getAbsolutePath()
def canonicalPath = file.getCanonicalPath()
......@@ -231,10 +178,9 @@ test {
testLogging.showStandardStreams = true
ignoreFailures = true
}
test.dependsOn checkRestrictions
dependencies {
ecj "eclipse:ecj:+"
ecj files('libs/build/ecj-4.6.1.jar')
}
compileJava {
......@@ -261,18 +207,9 @@ compileTestJava {
def createJvmArgs() {
def args = ['-cp', configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn']
appendCompatibilityOption(args, '-source', sourceCompatibility)
appendCompatibilityOption(args, '-target', targetCompatibility)
return args
}
def appendCompatibilityOption(args, option, versionCompatibility) {
if (JavaVersion.current().equals(JavaVersion.toVersion(versionCompatibility))) {
args.add(option)
args.add(versionCompatibility.toString())
}
}
processTestResources {
fileMode=0666
}
......@@ -288,7 +225,7 @@ eclipse {
eclipse.classpath.file {
whenMerged{ classpath ->
def projectRefs = classpath.entries.findAll{entry -> entry.kind =='src' && entry.path.startsWith('/')}
def projectRefs = classpath.entries.findAll{entry -> entry.kind =='sources' && entry.path.startsWith('/')}
classpath.entries.removeAll(projectRefs)
classpath.entries.addAll(projectRefs)
}
......