Skip to content

Commits on Source 5

......@@ -2,3 +2,7 @@
/test-output
/bin
/build
/.gradle
.classpath
.project
.settings/
......@@ -4,7 +4,7 @@ group='sis'
dependencies {
compile 'apache:commons-io:+',
'apache:commons-lang:+',
'apache:commons-lang3:+',
'testng:testng:+',
'rinn:restrictions:+'
}
......@@ -24,6 +24,7 @@ sourceSets {
}
jar {
archiveName "${project.group}-base-${version}.jar"
manifest {
attributes 'Main-Class': 'ch.systemsx.cisd.base.BuildAndEnvironmentInfo'
}
......@@ -35,13 +36,21 @@ jar {
from fileTree("libs/")
}
sourcesJar {
archiveName "${project.group}-base-${version}-sources.jar"
}
task standaloneTestJar(type: Jar, dependsOn: [classes, testClasses]) {
archiveName "${project.group}-base-test.jar"
archiveName "${project.group}-base-${version}-tests.jar"
from files(sourceSets.main.output.classesDir)
from files(sourceSets.main.output.resourcesDir)
from files(sourceSets.test.output.classesDir)
from files("libs")
from('targets/dist') {
include 'BUILD*INFO'
}
from {configurations.testRuntime.collect {zipTree(it)}}
manifest {
......@@ -49,13 +58,16 @@ task standaloneTestJar(type: Jar, dependsOn: [classes, testClasses]) {
}
}
task javadocZip(type: Zip, dependsOn: javadoc) {
archiveName "${project.group}-base-javadoc.zip"
task javadocZip(type: Jar, dependsOn: javadoc) {
archiveName "${project.group}-base-${version}-javadoc.jar"
baseName "${project.group}-base-javadoc"
from javadoc.destinationDir
}
task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, javadocZip, standaloneTestJar]) {
baseName = "${project.group}-base"
def ver = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${version}" : ""
def myVersion = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${project.ext.versionNumber}-${project.ext.revisionNumber}" : project.ext.versionNumber
archiveName "${project.group}-base-${myVersion}.zip"
from ('dist') {
into "${project.group}-base"
}
......@@ -66,12 +78,10 @@ task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, javadocZip, standal
from (jar.archivePath) {
into "${project.group}-base/lib"
rename '(.*)', "${project.group}-base.jar"
}
from (sourcesJar.archivePath) {
into "${project.group}-base/src"
rename '(.*)', "${project.group}-base-src.jar"
}
from (standaloneTestJar.archivePath) {
......
libsis-base-java (18.08~pre+git20180810.9248fca+dfsg-1) UNRELEASED; urgency=medium
libsis-base-java (18.08.0+dfsg-1) UNRELEASED; urgency=medium
* New upstream Git checkout
* Upstream moved to Gitlab
......@@ -8,7 +8,7 @@ libsis-base-java (18.08~pre+git20180810.9248fca+dfsg-1) UNRELEASED; urgency=medi
* Drop now unneeded get-orig-source target
* Point Vcs fields to salsa.debian.org
* Standards-Version: 4.2.0
TODO: Run time test failure: testGetLinkInfoRegularFile
* Build-Depends: s/libcommons-lang-java/libcommons-lang3-java/
-- Andreas Tille <tille@debian.org> Tue, 14 Aug 2018 09:31:05 +0200
......
......@@ -8,7 +8,7 @@ Priority: optional
Build-Depends: debhelper (>= 11),
default-jdk,
javahelper,
libcommons-lang-java,
libcommons-lang3-java,
libcommons-io-java,
testng,
libtool,
......
......@@ -4,7 +4,7 @@ Forwarded: no
Author: Olivier Sallou <osallou@debian.org>
--- a/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
+++ b/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
@@ -164,14 +164,14 @@
@@ -165,14 +165,14 @@ public class UnixTests extends AbstractF
{ "requires_unix" })
public void testGetUid()
{
......@@ -21,7 +21,7 @@ Author: Olivier Sallou <osallou@debian.org>
assertEquals(Unix.getUid(), Unix.getEuid());
}
@@ -179,14 +179,14 @@
@@ -180,14 +180,14 @@ public class UnixTests extends AbstractF
{ "requires_unix" })
public void testGetGid()
{
......
......@@ -5,7 +5,7 @@ Forwarded: no
Last-Updated: 2015-08-21
--- a/source/java/ch/systemsx/cisd/base/unix/Unix.java
+++ b/source/java/ch/systemsx/cisd/base/unix/Unix.java
@@ -19,7 +19,6 @@
@@ -19,7 +19,6 @@ package ch.systemsx.cisd.base.unix;
import java.io.File;
import java.io.IOException;
......@@ -13,7 +13,7 @@ Last-Updated: 2015-08-21
import ch.systemsx.cisd.base.exceptions.CheckedExceptionTunnel;
import ch.systemsx.cisd.base.exceptions.IOExceptionUnchecked;
import ch.systemsx.cisd.base.utilities.NativeLibraryUtilities;
@@ -415,13 +414,11 @@
@@ -415,13 +414,11 @@ public final class Unix
private static native String strerror();
......@@ -29,7 +29,7 @@ Last-Updated: 2015-08-21
try
--- a/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
+++ b/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
@@ -24,7 +24,6 @@
@@ -25,7 +25,6 @@ import java.nio.charset.Charset;
import org.apache.commons.io.FileUtils;
import org.testng.annotations.Test;
......@@ -37,7 +37,7 @@ Last-Updated: 2015-08-21
import ch.systemsx.cisd.base.BuildAndEnvironmentInfo;
import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase;
import ch.systemsx.cisd.base.unix.Unix.Group;
@@ -36,7 +35,6 @@
@@ -37,7 +36,6 @@ import ch.systemsx.cisd.base.unix.Unix.S
*
* @author Bernd Rinn
*/
......
......@@ -19,7 +19,7 @@ Forwarded-Upstream: Bernd Rinn <brinn@ethz.ch>
--- a/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
+++ b/sourceTest/java/ch/systemsx/cisd/base/unix/UnixTests.java
@@ -78,7 +78,7 @@ public class UnixTests extends AbstractF
@@ -79,7 +79,7 @@ public class UnixTests extends AbstractF
}
@Test(groups =
......
......@@ -3,7 +3,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export CLASSPATH=/usr/share/java/commons-lang.jar:/usr/share/java/commons-io.jar:/usr/share/java/testng.jar
export CLASSPATH=/usr/share/java/commons-lang3.jar:/usr/share/java/commons-io.jar:/usr/share/java/testng.jar
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
......
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/base.git HEAD
# 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="repacksuffix=+dfsg,dversionmangle=s/\+dfsg//g,repack,compression=xz" \
https://sissource.ethz.ch/sispub/base/tags .*archive/18.08.0/base@ANY_VERSION@@ARCHIVE_EXT@
#Tue Jun 13 15:27:00 CEST 2017
#Fri Aug 17 11:54:01 CEST 2018
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/3.5/gradle-3.5-all.zip
distributionUrl=http\://svnsis.ethz.ch/repos/cisd/ivy-repository/trunk/gradle/distribution/4.9/gradle-4.9-all.zip
......@@ -53,10 +53,6 @@ buildscript {
apply from: './repository.gradle'
repositories repositoryConfig
dependencies {
classpath 'cisd:cisd-ant-tasks:+'
}
}
repositories repositoryConfig
......@@ -93,36 +89,14 @@ 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() {
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()) {
if (isGitProject()) {
def output = execute_working_dir('git', ['status', '--porcelain'], '../' + project.name)
return output.length == 0 ? 'clean' : 'dirty'
return (output.length == 0 || (output.length ==1 && output[0].length() == 0)) ? 'clean' : 'dirty'
} else {
return 'dirty'
}
......@@ -133,23 +107,13 @@ def findMaximum(lines, key) {
}
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])
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 date = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX").format(new Date(revisionNumber * 1000L))
project.ext.revisionInfo = "${commitHash} [${date}]"
def tag = 'git tag -l --points-at HEAD'.execute().text.trim()
if (tag == null || tag.isEmpty()) {
project.ext.versionNumber = 'SNAPSHOT'
......@@ -159,22 +123,15 @@ def calculateBuildInfo() {
project.ext.versionNumber = tag
}
} else {
project.ext.revisionInfo = '?'
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
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
project.ext.cleanFlag = calculateCleanFlag()
def buildInfo = "${project.ext.versionNumber}:${project.ext.revisionNumber}:${project.ext.cleanFlag}"
def buildInfo = "${project.ext.versionNumber}::${project.ext.revisionInfo}::${project.ext.cleanFlag}"
println "BUILD INFO for $project: $buildInfo"
def targetsDist = 'targets/dist'
def distFolder = new File("${project.projectDir}/$targetsDist")
......@@ -255,17 +212,6 @@ compileJava {
}
}
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
......
/*
* Copyright 2008 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 2009 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 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 2010 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 2010 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 2007 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 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 2008 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.
......