-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various updates (Java 7 --> 8, Gradle Wrapper 3.1 --> 6.8.3, ...) + u…
…se Maven Central instead of Bintray/JCenter * Features * No new features * Bugfixes * No bug fixes * Changes * Minimum Java version 8 (instead of 7) * Update gradle wrapper to 6.8.2 (from 3.1) * Use Groovy 2.5.x in the tests (instead of 2.4.x) * Publish to Maven Central instead Bintray/JCenter (Bintray/JCenter will be shut down soon) * Simplify build setup: remove Jacoco and Coveralls
- Loading branch information
Showing
12 changed files
with
249 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
language: java | ||
|
||
jdk: | ||
- openjdk7 | ||
- oraclejdk7 | ||
- oraclejdk8 | ||
- openjdk8 | ||
|
||
# https://joerglenhard.wordpress.com/2013/10/01/using-travis-ci-with-gradle-wrapper | ||
before_install: | ||
- chmod +x gradlew | ||
install: | ||
- ./gradlew build -x signArchives | ||
|
||
env: | ||
- TERM=dumb | ||
|
||
after_success: | ||
- ./gradlew jacocoTestReport coveralls | ||
- TERM=dumb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,41 @@ | ||
plugins { | ||
id "com.jfrog.bintray" version '1.6' // https:/bintray/gradle-bintray-plugin | ||
id 'nu.studer.credentials' version '1.0.3' // https:/etiennestuder/gradle-credentials-plugin | ||
id 'com.github.kt3k.coveralls' version '2.7.1' // https:/kt3k/coveralls-gradle-plugin | ||
id 'com.github.hierynomus.license' version '0.11.0' // https:/hierynomus/license-gradle-plugin | ||
id "com.github.ben-manes.versions" version "0.13.0" | ||
id 'nu.studer.credentials' version '2.1' // https:/etiennestuder/gradle-credentials-plugin | ||
id 'com.github.hierynomus.license' version '0.15.0' // https:/hierynomus/license-gradle-plugin | ||
id "com.github.ben-manes.versions" version "0.38.0" | ||
} | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'groovy' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'jacoco' | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
version = '1.0.4' | ||
group = "ch.petikoch.libs" | ||
archivesBaseName = "jtrag" | ||
version = '2.0.0' | ||
|
||
ext.artifactGroupId = 'ch.petikoch.libs' | ||
ext.description = 'A small java 7+ library (on top of jtwfg) using a "task resource assignment graph" model to detect deadlocks' | ||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
|
||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 | ||
|
||
ext.fileEncoding = 'UTF-8' | ||
ext["fileEncoding"] = 'UTF-8' | ||
ext["signing.keyId"] = credentials.gpgKeyId | ||
ext["signing.password"] = credentials.gpgKeyPassword | ||
ext["signing.secretKeyRingFile"] = credentials.gpgKeyFile | ||
ext["ossrhUsername"] = credentials.ossrhUsername | ||
ext["ossrhPassword"] = credentials.ossrhPassword | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'ch.petikoch.libs:jtwfg:1.0.4' | ||
compile 'ch.petikoch.libs:jtwfg:2.0.0' | ||
|
||
testCompile 'org.codehaus.groovy:groovy-all:2.4.7' | ||
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') { | ||
testCompile 'org.codehaus.groovy:groovy-all:2.5.14' | ||
testCompile('org.spockframework:spock-core:1.3-groovy-2.5') { | ||
exclude group: 'org.codehaus.groovy' | ||
} | ||
testCompile 'cglib:cglib-nodep:3.2.4' // spock mocks | ||
testCompile 'com.google.guava:guava:20.0' // provides e.g. nice Multimap | ||
testCompile 'cglib:cglib-nodep:3.3.0' // spock mocks | ||
testCompile 'com.google.guava:guava:30.1.1-jre' // provides e.g. nice Multimap | ||
} | ||
|
||
jar { | ||
|
@@ -56,13 +58,22 @@ sourceSets.test.java.srcDirs = [] | |
sourceSets.main.groovy.srcDirs = [] | ||
sourceSets.test.groovy.srcDirs = ['src/test/groovy'] | ||
|
||
task javadocJar(type: Jar, dependsOn: classes) { | ||
classifier = 'javadoc' | ||
from javadoc | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes) { | ||
classifier = 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
archives javadocJar, sourcesJar | ||
} | ||
|
||
signing { | ||
sign configurations.archives | ||
} | ||
|
||
tasks.withType(GroovyCompile) { | ||
|
@@ -79,127 +90,51 @@ tasks.withType(Test) { | |
maxParallelForks = Runtime.getRuntime().availableProcessors() | ||
} | ||
|
||
task sourceJar(type: Jar) { | ||
from sourceSets.main.allJava | ||
} | ||
// https://central.sonatype.org/pages/gradle.html | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
def pomConfig = { | ||
name project.name | ||
description project.description | ||
url 'https:/Petikoch/jtrag' | ||
inceptionYear '2015' | ||
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
scm { url 'https:/Petikoch/jtrag.git' } | ||
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") { | ||
authentication(userName: ossrhUsername, password: ossrhPassword) | ||
} | ||
|
||
developers { | ||
developer { | ||
id 'petikoch' | ||
name 'Peti Koch' | ||
email '[email protected]' | ||
url 'https://www.google.com/+PetiKoch' | ||
} | ||
} | ||
pom.project { | ||
name project.archivesBaseName | ||
packaging 'jar' | ||
description 'A small java 8+ library (on top of jtwfg) using a "task resource assignment graph" model to detect deadlocks' | ||
url 'https:/Petikoch/jtrag' | ||
|
||
/* contributors { | ||
contributor { | ||
name 'John Doe' | ||
} | ||
}*/ | ||
} | ||
scm { | ||
connection = 'https:/Petikoch/jtrag.git' | ||
developerConnection = 'https:/Petikoch/jtrag.git' | ||
url = 'https:/Petikoch/jtrag' | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenCustom(MavenPublication) { | ||
groupId project.artifactGroupId | ||
artifactId project.name | ||
version project.version | ||
from components.java | ||
|
||
pom.withXml { | ||
|
||
asNode().children().last() + pomConfig | ||
|
||
def licencesNode = asNode().appendNode('licenses') | ||
def licenseNode = licencesNode.appendNode('license') | ||
licenseNode.appendNode('name', 'The Apache Software License, Version 2.0') | ||
licenseNode.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt') | ||
licenseNode.appendNode('distribution', 'repo') | ||
|
||
// ugly dirty hack... build up the test dependencies ourselve | ||
// why? because maven-publish plugin creates crapy dependencies in pom.xml (gradle 2.2) | ||
// see http://stackoverflow.com/questions/20131915/publishing-artifact-from-gradle-project-to-bintray-maven-repository | ||
// solution: http://stackoverflow.com/questions/24743562/gradle-not-including-dependencies-in-published-pom-xml | ||
|
||
node.remove(node.dependencies) | ||
|
||
def dependenciesNode = node.appendNode('dependencies') | ||
configurations.testCompile.allDependencies.each { | ||
if (it.name != 'jtwfg') { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
if (it.version == '+') { | ||
dependencyNode.appendNode('version', 'RELEASE') | ||
} else { | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
dependencyNode.appendNode('scope', 'test') | ||
} else { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
if (it.version == '+') { | ||
dependencyNode.appendNode('version', 'RELEASE') | ||
} else { | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
dependencyNode.appendNode('scope', 'compile') | ||
licenses { | ||
license { | ||
name 'The Apache License, Version 2.0' | ||
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
|
||
return node | ||
} | ||
|
||
artifact sourceJar { | ||
classifier "sources" | ||
developers { | ||
developer { | ||
id = 'petikoch' | ||
name 'Peti Koch' | ||
email '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
model { | ||
tasks.generatePomFileForMavenCustomPublication { | ||
destination = file("$buildDir/generated_pom.xml") | ||
} | ||
} | ||
|
||
bintray { | ||
user = credentials.bintrayUserName // https:/etiennestuder/gradle-credentials-plugin | ||
key = credentials.bintrayApiKey // https:/etiennestuder/gradle-credentials-plugin | ||
publications = ['mavenCustom'] // see publications closure | ||
|
||
publish true | ||
|
||
pkg { | ||
repo = 'maven' | ||
name = project.name | ||
desc = project.description // doesn't work | ||
websiteUrl = 'https:/Petikoch/jtrag' | ||
issueTrackerUrl = 'https:/Petikoch/jtrag/issues' | ||
vcsUrl = 'https:/Petikoch/jtrag.git' | ||
licenses = ['Apache-2.0'] | ||
labels = ['java'] | ||
publicDownloadNumbers = true | ||
} | ||
} | ||
|
||
jacocoTestReport { | ||
reports { | ||
xml.enabled = true // coveralls plugin depends on xml format report | ||
html.enabled = true | ||
} | ||
} | ||
|
||
license { | ||
header = rootProject.file('config/HEADER') | ||
strictCheck = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Sat Nov 12 15:05:16 CET 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip |
Oops, something went wrong.