[med-svn] [Git][med-team/libsis-base-java][upstream] New upstream version 18.08~pre+git20180810.9248fca+dfsg
Andreas Tille
gitlab at salsa.debian.org
Tue Aug 14 08:47:52 BST 2018
Andreas Tille pushed to branch upstream at Debian Med / libsis-base-java
Commits:
6f70e903 by Andreas Tille at 2018-08-14T07:38:38Z
New upstream version 18.08~pre+git20180810.9248fca+dfsg
- - - - -
15 changed files:
- − .classpath
- + .gitignore
- − branch.sh
- build.gradle
- + build/antrun.sh
- + build/build.xml
- gradle/wrapper/gradle-wrapper.jar
- gradle/wrapper/gradle-wrapper.properties
- gradlew
- gradlew.bat
- + javaproject.gradle
- + repository.gradle
- source/java/ch/systemsx/cisd/base/utilities/NativeLibraryUtilities.java
- source/java/ch/systemsx/cisd/base/utilities/ResourceUtilities.java
- − tag.sh
Changes:
=====================================
.classpath deleted
=====================================
--- a/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="source/java"/>
- <classpathentry kind="src" path="sourceTest/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="/libraries/testng/testng-jdk15.jar" sourcepath="/libraries/testng/src.zip"/>
- <classpathentry kind="lib" path="/libraries/restrictionchecker/restrictions.jar"/>
- <classpathentry kind="lib" path="/libraries/commons-io/commons-io.jar" sourcepath="/libraries/commons-io/src.zip"/>
- <classpathentry kind="lib" path="/libraries/commons-lang/commons-lang.jar" sourcepath="/libraries/commons-lang/src.zip"/>
- <classpathentry kind="lib" path="/libraries/unix"/>
- <classpathentry kind="lib" path="/libraries/nativedata"/>
- <classpathentry kind="output" path="targets/classes"/>
-</classpath>
=====================================
.gitignore
=====================================
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/targets
+/test-output
+/bin
+/build
=====================================
branch.sh deleted
=====================================
--- a/branch.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-if [ `dirname $0` != "." ]
-then
- echo "Please run from the same directory than the script source file is in"
- exit 1
-fi
-
-if [ $# -ne 1 ]
-then
- echo "Usage: ./branch.sh [branch]"
- echo ""
- echo "Example: ./branch.sh release/13.04.x"
- exit 1
-fi
-
-svn info svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 2>/dev/null
-if [ $? -eq 0 ]; then echo "Branch already exists!"; exit 1; fi
-
-CURRENT=`svn info|grep URL|cut -d" " -f2`
-
-svn copy $CURRENT svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 -m "create branch $1"
-mkdir -p out
-rm -r out/temp_checkout
-svn checkout --depth=empty svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 out/temp_checkout
-if [ $? -ne 0 ]; then echo "Checkout of new branch $1 failed!"; exit 1; fi
-
-cd out/temp_checkout
-svn update gradlew gradle build.gradle
-./gradlew dependencyReport
-cat out/reports/project/dependencies.txt|egrep ^.---|grep \>|sort|uniq|awk '{print $2 ":" $4}'|awk -F: '{print "s/" $1 ":" $2 ":" $3 "/" $1 ":" $2 ":" $4 "/g"}' > sed_commands
-sed -f sed_commands build.gradle > build.gradle.tmp
-mv build.gradle.tmp build.gradle
-svn commit build.gradle -m "fixed dependencies for branch $1"
-cd ../..
=====================================
build.gradle
=====================================
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-apply from: '../gradle/javaproject.gradle'
+apply from: './javaproject.gradle'
group='sis'
@@ -24,6 +24,14 @@ sourceSets {
}
jar {
+ manifest {
+ attributes 'Main-Class': 'ch.systemsx.cisd.base.BuildAndEnvironmentInfo'
+ }
+
+ from('targets/dist') {
+ include 'BUILD*INFO'
+ }
+
from fileTree("libs/")
}
@@ -95,4 +103,4 @@ publishing {
}
}
}
-}
\ No newline at end of file
+}
=====================================
build/antrun.sh
=====================================
--- /dev/null
+++ b/build/antrun.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+ME="$0"
+MYDIR=${ME%/*}
+cd $MYDIR
+ant -lib ../../build_resources/lib/ecj.jar "$@"
=====================================
build/build.xml
=====================================
--- /dev/null
+++ b/build/build.xml
@@ -0,0 +1,163 @@
+<project name="base" default="dist" basedir="..">
+ <target name="clean">
+ <delete dir="${dist}" />
+ </target>
+
+ <import file="../../build_resources/ant/build-common.xml" />
+
+ <project-classpath name="ecp" classes="${classes}" />
+ <property name="distfolder" value="sis-base" />
+ <property name="mainfolder" value="base" />
+ <property name="jar.file" value="${dist}/sis-base.jar" />
+ <property name="dist.file" value="${dist}/sis-base" />
+ <property name="jar.test.file" value="${dist}/sis-base-test.jar" />
+ <property name="src.zip.file" value="${dist}/sis-base-src.zip" />
+ <property name="javadoc.zip.file" value="${dist}/sis-base-javadoc.zip" />
+ <property name="original.dist" value="../${ant.project.name}/dist" />
+ <property name="nativesrc" value="libs/native" />
+ <property name="nativeroot" value="${targets}/ant" />
+ <property name="native" value="${nativeroot}/native" />
+
+ <property name="dist.common" value="${dist}/${mainfolder}" />
+ <property name="dist.common.lib" value="${dist.common}/lib" />
+
+
+ <target name="ci" depends="build-common.ci, check-dependencies, dist" />
+
+ <target name="jar" depends="compile">
+ <mkdir dir="${dist.common.lib}" />
+ <build-info revision="revision.number" version="version.number" clean="clean.flag" />
+ <echo file="${build.info.file}">${version.number}:${revision.number}:${clean.flag}</echo>
+ <copy todir="${native}">
+ <fileset dir="${nativesrc}">
+ <include name="**/libunix.so" />
+ <include name="**/libunix.jnilib" />
+ </fileset>
+ </copy>
+ <copy todir="${native}">
+ <fileset dir="${nativesrc}">
+ <include name="**/libnativedata.so" />
+ <include name="**/libnativedata.jnilib" />
+ <include name="**/nativedata.dll" />
+ </fileset>
+ </copy>
+ <recursive-jar destfile="${jar.file}">
+ <fileset dir="${classes}">
+ <include name="**/*.class" />
+ <include name="${build.info.filename}" />
+ </fileset>
+ <fileset dir="${nativeroot}">
+ <include name="native/**/*.so" />
+ <include name="native/**/*.jnilib" />
+ <include name="native/**/*.dll" />
+ </fileset>
+ <manifest>
+ <attribute name="Main-Class"
+ value="ch.systemsx.cisd.base.BuildAndEnvironmentInfo" />
+ <attribute name="Version" value="${version.number}" />
+ <attribute name="Build-Number"
+ value="${version.number} (r${revision.number},${clean.flag})" />
+ </manifest>
+ </recursive-jar>
+ </target>
+
+ <target name="jar-test" depends="compile-tests">
+ <mkdir dir="${dist.common.lib}" />
+ <build-info revision="revision.number" version="version.number" clean="clean.flag" />
+ <echo file="${build.info.file}">${version.number}:${revision.number}:${clean.flag}</echo>
+ <copy todir="${native}">
+ <fileset dir="${nativesrc}">
+ <include name="**/libunix.so" />
+ <include name="**/libunix.jnilib" />
+ </fileset>
+ </copy>
+ <copy todir="${native}">
+ <fileset dir="${nativesrc}">
+ <include name="**/libnativedata.so" />
+ <include name="**/libnativedata.jnilib" />
+ <include name="**/nativedata.dll" />
+ </fileset>
+ </copy>
+ <recursive-jar destfile="${jar.test.file}">
+ <fileset dir="${classes}">
+ <include name="**/*.class" />
+ <include name="${build.info.filename}" />
+ </fileset>
+ <fileset dir="${nativeroot}">
+ <include name="native/**/*.so" />
+ <include name="native/**/*.jnilib" />
+ <include name="native/**/*.dll" />
+ </fileset>
+ <zipfileset src="${lib}/testng/testng-jdk15.jar" />
+ <zipfileset src="${lib}/commons-lang/commons-lang.jar" />
+ <zipfileset src="${lib}/commons-io/commons-io.jar" />
+ <manifest>
+ <attribute name="Main-Class" value="ch.systemsx.cisd.base.AllTests" />
+ <attribute name="Version" value="${version.number}" />
+ <attribute name="Build-Number"
+ value="${version.number} (r${revision.number},${clean.flag})" />
+ </manifest>
+ </recursive-jar>
+ </target>
+
+ <target name="src-zip">
+ <build-info revision="revision.number" version="version.number" clean="clean.flag" />
+ <mkdir dir="${classes}" />
+ <echo file="${build.info.file}">${version.number}:${revision.number}:${clean.flag}</echo>
+ <jar destfile="${src.zip.file}">
+ <fileset dir="${classes}">
+ <include name="${build.info.filename}" />
+ </fileset>
+ <fileset dir="${sources}">
+ <include name="**/*.java" />
+ </fileset>
+ <fileset dir="${sources.test}">
+ <include name="ch/systemsx/cisd/base/tests/**/*.java" />
+ </fileset>
+ <manifest>
+ <attribute name="Version" value="${version.number}" />
+ <attribute name="Build-Number"
+ value="${version.number} (r${revision.number},${clean.flag})" />
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="doc">
+ <delete dir="targets/doc" />
+ <javadoc sourcepath="source/java"
+ packagenames="ch.systemsx.cisd.base.*"
+ classpath="../libraries/commons-lang/commons-lang.jar:../libraries/commons-io/commons-io.jar:../libraries/testng/testng-jdk15.jar:../libraries/restrictionchecker/restrictions.jar"
+ destdir="targets/doc"
+ access="public" />
+ </target>
+
+ <target name="dist" depends="clean, jar, jar-test, src-zip, doc">
+ <zip destfile="${javadoc.zip.file}" basedir="${targets}" includes="doc/**" />
+ <delete dir="${dist}/${mainfolder}" />
+ <delete dir="${dist}/${distfolder}" />
+ <move file="${jar.file}" todir="${dist}/${distfolder}/lib" />
+ <move file="${jar.test.file}" todir="${dist}/${distfolder}/lib" />
+ <move file="${src.zip.file}" todir="${dist}/${distfolder}/src" />
+ <move file="${javadoc.zip.file}" todir="${dist}/${distfolder}/doc" />
+ <copy todir="${dist}/${distfolder}/doc">
+ <fileset dir="doc" includes="**" />
+ </copy>
+ <copy todir="${dist}/${distfolder}">
+ <fileset dir="${original.dist}"/>
+ </copy>
+ <zip destfile="${dist.file}-${version.number}-r${revision.number}.zip"
+ basedir="${dist}"
+ includes="${distfolder}/**" />
+ <delete dir="${dist}/${distfolder}" />
+ </target>
+
+ <!--
+ // Runs the test suite 'tests.xml'.
+ -->
+ <target name="run-tests" description="Runs the test suite 'tests.xml'.">
+ <antcall target="build-common.run-tests">
+ <param name="test.suite" value="tests.xml" />
+ </antcall>
+ </target>
+
+</project>
=====================================
gradle/wrapper/gradle-wrapper.jar
=====================================
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
=====================================
gradle/wrapper/gradle-wrapper.properties
=====================================
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Apr 23 11:31:33 CEST 2014
+#Tue Jun 13 15:27:00 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://svncisd.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/1.8/gradle-1.8-all.zip
+distributionUrl=http\://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/3.5/gradle-3.5-all.zip
=====================================
gradlew
=====================================
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -6,12 +6,30 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
+nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
+ NONSTOP* )
+ nonstop=true
+ ;;
esac
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
@@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save ( ) {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"
=====================================
gradlew.bat
=====================================
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -8,14 +8,14 @@
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
- at rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+ at rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
@@ -46,10 +46,9 @@ echo location of your Java installation.
goto fail
:init
- at rem Get command-line arguments, handling Windowz variants
+ at rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
- at rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
=====================================
javaproject.gradle
=====================================
--- /dev/null
+++ b/javaproject.gradle
@@ -0,0 +1,368 @@
+apply plugin: 'java'
+apply plugin: 'project-report'
+
+evaluationDependsOnChildren()
+
+configurations {
+ tests {
+ extendsFrom testRuntime
+ }
+}
+
+configurations {
+ ecj
+}
+
+configurations.all {
+ resolutionStrategy.cacheDynamicVersionsFor 0, 'hours'
+ resolutionStrategy.cacheChangingModulesFor 0, 'hours'
+}
+
+task wrapper(type: Wrapper) {
+ gradleVersion = '3.5'
+ distributionUrl = "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/3.5/gradle-3.5-all.zip"
+}
+
+sourceCompatibility='1.8'
+targetCompatibility='1.8'
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['source/java']
+ }
+ }
+ test {
+ java {
+ srcDirs = ['sourceTest/java']
+ }
+ resources {
+ srcDirs = ['sourceTest/java']
+ }
+ }
+ examples {
+ java {
+ srcDirs = ['sourceExamples/java']
+ }
+ }
+}
+
+buildDir = 'targets/gradle'
+
+buildscript {
+ apply from: './repository.gradle'
+
+ repositories repositoryConfig
+
+ dependencies {
+ classpath 'cisd:cisd-ant-tasks:+'
+ }
+}
+
+repositories repositoryConfig
+
+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')
+ }
+}
+
+ext.executeFunction = {
+ command, arguments -> execute(command, arguments)
+}
+
+def execute_working_dir(command, arguments, working_dir) {
+ 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')
+ }
+}
+
+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() {
+ return 'clean'
+ 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'], '../' + project.name)
+ return output.length == 0 ? 'clean' : 'dirty'
+ } else {
+ return 'dirty'
+ }
+}
+
+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 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
+ }
+ } else {
+ project.ext.revisionNumber = 1
+ project.ext.versionNumber = 'SNAPSHOT'
+ }
+
+ 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}"
+ 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
+}
+
+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()
+ if (absolutePath.equals(canonicalPath) == false) {
+ file.delete();
+ } else if (file.isDirectory()) {
+ File[] files = file.listFiles()
+ for (File child : files) {
+ deleteSymbolicLinksRecursively(child)
+ }
+ }
+}
+
+task deleteSymLinks {
+ doFirst {
+ println "DELETE SYM LINKS in $buildDir"
+ deleteSymbolicLinksRecursively buildDir
+ }
+}
+
+clean.dependsOn deleteSymLinks
+
+test {
+ useTestNG()
+ options.suites('sourceTest/java/tests.xml')
+
+ systemProperty "ant.project.name", project.name
+
+ maxHeapSize = "8192m"
+ jvmArgs '-XX:MaxPermSize=1024m', '-Duser.timezone=Europe/Zurich'
+
+ testLogging.showStandardStreams = true
+ ignoreFailures = true
+}
+test.dependsOn checkRestrictions
+
+dependencies {
+ ecj "eclipse:ecj:+"
+}
+
+compileJava {
+ options.encoding = 'utf-8'
+ options.fork = true
+ doFirst {
+ options.forkOptions.with {
+ executable = 'java'
+ jvmArgs = createJvmArgs()
+ }
+ }
+}
+
+compileTestJava {
+ options.encoding = 'utf-8'
+ options.fork = true
+ doFirst {
+ options.forkOptions.with {
+ executable = 'java'
+ jvmArgs = createJvmArgs()
+ }
+ }
+}
+
+def createJvmArgs() {
+ def args = ['-cp', configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn']
+ return args
+}
+
+processTestResources {
+ fileMode=0666
+}
+
+apply plugin: 'eclipse'
+
+eclipse {
+ classpath {
+ downloadSources=true
+ defaultOutputDir = file('targets/classes')
+ }
+}
+
+eclipse.classpath.file {
+ whenMerged{ classpath ->
+ def projectRefs = classpath.entries.findAll{entry -> entry.kind =='src' && entry.path.startsWith('/')}
+ classpath.entries.removeAll(projectRefs)
+ classpath.entries.addAll(projectRefs)
+ }
+}
+
+task testJar(type: Jar, dependsOn: testClasses) {
+ baseName = "test-${project.archivesBaseName}"
+ from sourceSets.test.output
+}
+
+task sourcesJar(type: Jar) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+}
+
+compileJava.dependsOn sourcesJar
+
+artifacts {
+ tests testJar
+}
+
+artifacts {
+ archives sourcesJar
+}
+
+task compileDependencies(type: Copy) {
+ into "$buildDir/output/compile-dependencies"
+ from configurations.compile
+}
+
+task runtimeDependencies(type: Copy) {
+ into "$buildDir/output/runtime-dependencies"
+ from configurations.runtime
+}
+
+task testCompileDependencies(type: Copy) {
+ into "$buildDir/output/testCompile-dependencies"
+ from configurations.testCompile
+}
+
+task testRuntimeDependencies(type: Copy) {
+ into "$buildDir/output/testRuntime-dependencies"
+ from configurations.testRuntime
+}
+
+task checkDependencies(dependsOn: classes) << {
+ ant.taskdef(name: 'dependencychecker', classname: 'classycle.ant.DependencyCheckingTask', classpath: configurations.testRuntime.asPath)
+ ant.dependencychecker(
+ definitionFile: 'resource/dependency-structure.ddf',
+ failOnUnwantedDependencies: 'true',
+ mergeInnerClasses: 'true') {
+ fileset(dir: "${buildDir}", includes: "**/*.class")
+ }
+}
+
+apply plugin: 'ivy-publish'
+if (hasProperty('ivyRepository') == false || ''.equals(project.ivyRepository))
+{
+ project.ext.ivyRepository = "${project.projectDir}/../ivy-repository"
+}
+publishing {
+
+ repositories {
+ ivy {
+ ivyPattern "file://${project.ivyRepository}/[organisation]/[module]/[revision]/ivy.xml"
+ artifactPattern "file://${project.ivyRepository}/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
+ }
+ }
+}
+
+publish {
+ dependsOn build
+}
+
+if (JavaVersion.current().isJava8Compatible()) {
+ tasks.withType(Javadoc) {
+ options.addStringOption('Xdoclint:none', '-quiet')
+ }
+}
=====================================
repository.gradle
=====================================
--- /dev/null
+++ b/repository.gradle
@@ -0,0 +1,10 @@
+ext.repositoryConfig = {
+ ivy {
+ ivyPattern "${project.projectDir}/../ivy-repository/[organisation]/[module]/[revision]/ivy.xml"
+ artifactPattern "${project.projectDir}/../ivy-repository/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
+ }
+ ivy {
+ ivyPattern "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/[organisation]/[module]/[revision]/ivy.xml"
+ artifactPattern "http://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
+ }
+}
=====================================
source/java/ch/systemsx/cisd/base/utilities/NativeLibraryUtilities.java
=====================================
--- a/source/java/ch/systemsx/cisd/base/utilities/NativeLibraryUtilities.java
+++ b/source/java/ch/systemsx/cisd/base/utilities/NativeLibraryUtilities.java
@@ -141,8 +141,10 @@ public final class NativeLibraryUtilities
*/
public static String tryCopyNativeLibraryToTempFile(final String libraryName)
{
+ // Request clean-up of old native library temp files as under Windows the files are locked and
+ // cannot be deleted on regular shutdown.
return ResourceUtilities.tryCopyResourceToTempFile(getLibPath("/native", libraryName),
- libraryName, ".so");
+ libraryName, ".so", true);
}
private static String getLibPath(final String prefix, final String libraryName)
=====================================
source/java/ch/systemsx/cisd/base/utilities/ResourceUtilities.java
=====================================
--- a/source/java/ch/systemsx/cisd/base/utilities/ResourceUtilities.java
+++ b/source/java/ch/systemsx/cisd/base/utilities/ResourceUtilities.java
@@ -18,11 +18,13 @@ package ch.systemsx.cisd.base.utilities;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.io.IOUtils;
+import org.apache.commons.io.filefilter.WildcardFileFilter;
import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked;
@@ -57,6 +59,29 @@ public class ResourceUtilities
}
/**
+ * Tries to copy the resource with the given name to a temporary file.
+ *
+ * @param resource The name of the resource to copy.
+ * @param prefix The prefix to use for the temporary name.
+ * @param postfix The postfix to use for the temporary name.
+ * @param cleanUpOldResources If <code>true</code>, remove old leftover temporary files for this
+ * <var>prefix</var> and <var>postfix</var>.
+ * @return The name of the temporary file, or <code>null</code>, if the resource could not be
+ * copied.
+ */
+ public static String tryCopyResourceToTempFile(final String resource, final String prefix,
+ final String postfix, final boolean cleanUpOldResources)
+ {
+ try
+ {
+ return copyResourceToTempFile(resource, prefix, postfix, cleanUpOldResources);
+ } catch (final Exception ex)
+ {
+ return null;
+ }
+ }
+
+ /**
* Copies the resource with the given name to a temporary file. The file will be deleted on
* program exit.
*
@@ -70,6 +95,29 @@ public class ResourceUtilities
public static String copyResourceToTempFile(final String resource, final String prefix,
final String postfix) throws IOExceptionUnchecked
{
+ return copyResourceToTempFile(resource, prefix, postfix, false);
+ }
+
+ /**
+ * Copies the resource with the given name to a temporary file. The file will be deleted on
+ * program exit.
+ *
+ * @param resource The name of the resource to copy.
+ * @param prefix The prefix to use for the temporary name.
+ * @param postfix The postfix to use for the temporary name.
+ * @param cleanUpOldResources If <code>true</code>, remove old leftover temporary files for this
+ * <var>prefix</var> and <var>postfix</var>.
+ * @return The name of the temporary file.
+ * @throws IllegalArgumentException If the resource cannot be found in the class path.
+ * @throws IOExceptionUnchecked If an {@link IOException} occurs.
+ */
+ public static String copyResourceToTempFile(final String resource, final String prefix,
+ final String postfix, final boolean cleanUpOldResources) throws IOExceptionUnchecked
+ {
+ if (cleanUpOldResources)
+ {
+ deleteOldResourceTempFiles(prefix, postfix);
+ }
final InputStream resourceStream = ResourceUtilities.class.getResourceAsStream(resource);
if (resourceStream == null)
{
@@ -98,4 +146,13 @@ public class ResourceUtilities
}
}
+ private static void deleteOldResourceTempFiles(final String prefix, final String postfix)
+ {
+ final FilenameFilter filter = new WildcardFileFilter(prefix + "*" + postfix);
+ for (File file : new File(System.getProperty("java.io.tmpdir")).listFiles(filter))
+ {
+ file.delete();
+ }
+ }
+
}
=====================================
tag.sh deleted
=====================================
--- a/tag.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-if [ `dirname $0` != "." ]
-then
- echo "Please run from the same directory than the script source file is in"
- exit 1
-fi
-
-if [ $# -ne 2 ]
-then
- echo "Usage: ./tag.sh [branch] [tag]"
- echo ""
- echo "Example: ./tag.sh release/13.04.x 13.04.1"
- exit 1
-fi
-
-svn info svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 2>/dev/null
-if [ $? -ne 0 ]; then echo "Branch does not exist!"; exit 1; fi
-
-svn info svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 2>/dev/null
-if [ $? -eq 0 ]; then echo "Tag already exists!"; exit 1; fi
-
-svn mkdir --parents svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1 -m "create tag folders $1/$2"
-svn copy svn+ssh://svncisd.ethz.ch/repos/cisd/base/branches/$1 svn+ssh://svncisd.ethz.ch/repos/cisd/base/tags/$1/$2 -m "create tag $1/$2"
View it on GitLab: https://salsa.debian.org/med-team/libsis-base-java/commit/6f70e9037c6269ff46e8eab7d61ba2607ff73f30
--
View it on GitLab: https://salsa.debian.org/med-team/libsis-base-java/commit/6f70e9037c6269ff46e8eab7d61ba2607ff73f30
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180814/8d937491/attachment-0001.html>
More information about the debian-med-commit
mailing list