WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 854ebcb

Browse files
committed
Various updates (Java 7 --> 8, Gradle Wrapper 3.1 --> 6.8.3, ...) + use 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
1 parent 5f06993 commit 854ebcb

File tree

12 files changed

+249
-308
lines changed

12 files changed

+249
-308
lines changed

.travis.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
language: java
22

33
jdk:
4-
- openjdk7
5-
- oraclejdk7
6-
- oraclejdk8
4+
- openjdk8
75

8-
# https://joerglenhard.wordpress.com/2013/10/01/using-travis-ci-with-gradle-wrapper
9-
before_install:
10-
- chmod +x gradlew
6+
install:
7+
- ./gradlew build -x signArchives
118

129
env:
13-
- TERM=dumb
14-
15-
after_success:
16-
- ./gradlew jacocoTestReport coveralls
10+
- TERM=dumb

README.adoc

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ Peti Koch
44
:project-name: jtrag
55
:github-branch: master
66
:github-user: Petikoch
7-
:bintray-user: petikoch
87

98
image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"]
10-
image:http://img.shields.io/badge/download-latest-bb00bb.svg[link="https://bintray.com/{bintray-user}/maven/{project-name}/_latestVersion"]
9+
image:http://img.shields.io/badge/download-latest-bb00bb.svg[link="https://search.maven.org/search?q=g:ch.petikoch.libs%20AND%20a:{project-name}"]
1110
image:https://travis-ci.org/{github-user}/{project-name}.svg?branch={github-branch}["Build Status", link="https://travis-ci.org/{github-user}/{project-name}"]
12-
image:http://img.shields.io/coveralls/{github-user}/{project-name}.svg["Coverage Status", link="https://coveralls.io/r/{github-user}/{project-name}"]
1311

1412
== Introduction
1513

@@ -122,16 +120,16 @@ If you would like to use jtwfg single-threaded and have performance issues, let
122120
=== Limitations of jtrag/jtwfg
123121

124122
* At the moment jtrag/jtwfg support only simple, synchronous dependencies in graphs.
125-
* jtrag doesn't fully encapsulate jtwfg (1.0.0). Therefore you need to program using the jtrag *and* the https://github.com/Petikoch/jtwfg[jtwfg] API and understand both of them.
123+
* jtrag doesn't fully encapsulate jtwfg. Therefore you need to program using the jtrag *and* the https://github.com/Petikoch/jtwfg[jtwfg] API and understand both of them.
126124
* The algorithms are not yet tuned and work more or less in a "brute force" manner. Please create a github issue if you have zillions of tasks/resources and run into performance/memory issues.
127125

128126
== Requirements
129127

130128
To use the *jtrag* library you need
131129

132-
* Java 7 or later
133-
* the https://github.com/Petikoch/jtwfg[jtwfg] library
134-
* no other libs
130+
* Java 8 or later
131+
132+
There is a transitive dependency to the https://github.com/Petikoch/jtwfg[jtwfg] library
135133

136134
== Installation
137135

@@ -144,13 +142,13 @@ Add the following dependency in your gradle build file:
144142
[source,groovy]
145143
----
146144
repositories {
147-
jcenter() // Bintray's JCenter repository
145+
mavenCentral()
148146
}
149147
150148
dependencies {
151-
compile 'ch.petikoch.libs:jtrag:x.y.z'
149+
compile 'ch.petikoch.libs:jtrag:x.y.z' // replace x.y.z with the real version
152150
153-
// or "latest" release, for the braves:
151+
// or "latest", for the braves:
154152
//compile 'ch.petikoch.libs:jtrag:+'
155153
}
156154
----
@@ -164,20 +162,13 @@ Add jtrag as dependency to your pom.xml:
164162
<dependency>
165163
<groupId>ch.petikoch.libs</groupId>
166164
<artifactId>jtrag</artifactId>
167-
<version>x.y.z</version>
168-
<!-- or latest release, for the braves
165+
<version>x.y.z</version> <!-- replace x.y.z with the real version -->
166+
<!-- or latest release (not snapshot), for the braves
169167
<version>RELEASE</version>
170168
-->
171169
</dependency>
172170
----
173171

174-
Be sure to have Bintray's JCenter repository in your maven settings.xml. If not, see "Set me up!" on the
175-
https://bintray.com/bintray/jcenter page for instructions to set it up.
176-
177-
==== Just the jar
178-
179-
image:http://img.shields.io/badge/download-latest-bb00bb.svg[link="https://bintray.com/{bintray-user}/maven/{project-name}/_latestVersion"] The jar of the latest version
180-
181172
== Release notes
182173

183174
See https://github.com/Petikoch/jtrag/releases.

build.gradle

Lines changed: 64 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
plugins {
2-
id "com.jfrog.bintray" version '1.6' // https://github.com/bintray/gradle-bintray-plugin
3-
id 'nu.studer.credentials' version '1.0.3' // https://github.com/etiennestuder/gradle-credentials-plugin
4-
id 'com.github.kt3k.coveralls' version '2.7.1' // https://github.com/kt3k/coveralls-gradle-plugin
5-
id 'com.github.hierynomus.license' version '0.11.0' // https://github.com/hierynomus/license-gradle-plugin
6-
id "com.github.ben-manes.versions" version "0.13.0"
2+
id 'nu.studer.credentials' version '2.1' // https://github.com/etiennestuder/gradle-credentials-plugin
3+
id 'com.github.hierynomus.license' version '0.15.0' // https://github.com/hierynomus/license-gradle-plugin
4+
id "com.github.ben-manes.versions" version "0.38.0"
75
}
86

97
apply plugin: 'java'
108
apply plugin: 'groovy'
11-
apply plugin: 'maven-publish'
12-
apply plugin: 'jacoco'
9+
apply plugin: 'maven'
10+
apply plugin: 'signing'
1311

14-
version = '1.0.4'
12+
group = "ch.petikoch.libs"
13+
archivesBaseName = "jtrag"
14+
version = '2.0.0'
1515

16-
ext.artifactGroupId = 'ch.petikoch.libs'
17-
ext.description = 'A small java 7+ library (on top of jtwfg) using a "task resource assignment graph" model to detect deadlocks'
16+
sourceCompatibility = 1.8
17+
targetCompatibility = 1.8
1818

19-
sourceCompatibility = 1.7
20-
targetCompatibility = 1.7
21-
22-
ext.fileEncoding = 'UTF-8'
19+
ext["fileEncoding"] = 'UTF-8'
20+
ext["signing.keyId"] = credentials.gpgKeyId
21+
ext["signing.password"] = credentials.gpgKeyPassword
22+
ext["signing.secretKeyRingFile"] = credentials.gpgKeyFile
23+
ext["ossrhUsername"] = credentials.ossrhUsername
24+
ext["ossrhPassword"] = credentials.ossrhPassword
2325

2426
repositories {
25-
jcenter()
27+
mavenCentral()
2628
}
2729

2830
dependencies {
29-
compile 'ch.petikoch.libs:jtwfg:1.0.4'
31+
compile 'ch.petikoch.libs:jtwfg:2.0.0'
3032

31-
testCompile 'org.codehaus.groovy:groovy-all:2.4.7'
32-
testCompile('org.spockframework:spock-core:1.0-groovy-2.4') {
33+
testCompile 'org.codehaus.groovy:groovy-all:2.5.14'
34+
testCompile('org.spockframework:spock-core:1.3-groovy-2.5') {
3335
exclude group: 'org.codehaus.groovy'
3436
}
35-
testCompile 'cglib:cglib-nodep:3.2.4' // spock mocks
36-
testCompile 'com.google.guava:guava:20.0' // provides e.g. nice Multimap
37+
testCompile 'cglib:cglib-nodep:3.3.0' // spock mocks
38+
testCompile 'com.google.guava:guava:30.1.1-jre' // provides e.g. nice Multimap
3739
}
3840

3941
jar {
@@ -56,13 +58,22 @@ sourceSets.test.java.srcDirs = []
5658
sourceSets.main.groovy.srcDirs = []
5759
sourceSets.test.groovy.srcDirs = ['src/test/groovy']
5860

61+
task javadocJar(type: Jar, dependsOn: classes) {
62+
classifier = 'javadoc'
63+
from javadoc
64+
}
65+
5966
task sourcesJar(type: Jar, dependsOn: classes) {
6067
classifier = 'sources'
6168
from sourceSets.main.allSource
6269
}
6370

6471
artifacts {
65-
archives sourcesJar
72+
archives javadocJar, sourcesJar
73+
}
74+
75+
signing {
76+
sign configurations.archives
6677
}
6778

6879
tasks.withType(GroovyCompile) {
@@ -79,127 +90,51 @@ tasks.withType(Test) {
7990
maxParallelForks = Runtime.getRuntime().availableProcessors()
8091
}
8192

82-
task sourceJar(type: Jar) {
83-
from sourceSets.main.allJava
84-
}
93+
// https://central.sonatype.org/pages/gradle.html
94+
uploadArchives {
95+
repositories {
96+
mavenDeployer {
97+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
8598

86-
def pomConfig = {
87-
name project.name
88-
description project.description
89-
url 'https://github.com/Petikoch/jtrag'
90-
inceptionYear '2015'
99+
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
100+
authentication(userName: ossrhUsername, password: ossrhPassword)
101+
}
91102

92-
scm { url 'https://github.com/Petikoch/jtrag.git' }
103+
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
104+
authentication(userName: ossrhUsername, password: ossrhPassword)
105+
}
93106

94-
developers {
95-
developer {
96-
id 'petikoch'
97-
name 'Peti Koch'
98-
99-
url 'https://www.google.com/+PetiKoch'
100-
}
101-
}
107+
pom.project {
108+
name project.archivesBaseName
109+
packaging 'jar'
110+
description 'A small java 8+ library (on top of jtwfg) using a "task resource assignment graph" model to detect deadlocks'
111+
url 'https://github.com/Petikoch/jtrag'
102112

103-
/* contributors {
104-
contributor {
105-
name 'John Doe'
106-
}
107-
}*/
108-
}
113+
scm {
114+
connection = 'https://github.com/Petikoch/jtrag.git'
115+
developerConnection = 'https://github.com/Petikoch/jtrag.git'
116+
url = 'https://github.com/Petikoch/jtrag'
117+
}
109118

110-
publishing {
111-
publications {
112-
mavenCustom(MavenPublication) {
113-
groupId project.artifactGroupId
114-
artifactId project.name
115-
version project.version
116-
from components.java
117-
118-
pom.withXml {
119-
120-
asNode().children().last() + pomConfig
121-
122-
def licencesNode = asNode().appendNode('licenses')
123-
def licenseNode = licencesNode.appendNode('license')
124-
licenseNode.appendNode('name', 'The Apache Software License, Version 2.0')
125-
licenseNode.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
126-
licenseNode.appendNode('distribution', 'repo')
127-
128-
// ugly dirty hack... build up the test dependencies ourselve
129-
// why? because maven-publish plugin creates crapy dependencies in pom.xml (gradle 2.2)
130-
// see http://stackoverflow.com/questions/20131915/publishing-artifact-from-gradle-project-to-bintray-maven-repository
131-
// solution: http://stackoverflow.com/questions/24743562/gradle-not-including-dependencies-in-published-pom-xml
132-
133-
node.remove(node.dependencies)
134-
135-
def dependenciesNode = node.appendNode('dependencies')
136-
configurations.testCompile.allDependencies.each {
137-
if (it.name != 'jtwfg') {
138-
def dependencyNode = dependenciesNode.appendNode('dependency')
139-
dependencyNode.appendNode('groupId', it.group)
140-
dependencyNode.appendNode('artifactId', it.name)
141-
if (it.version == '+') {
142-
dependencyNode.appendNode('version', 'RELEASE')
143-
} else {
144-
dependencyNode.appendNode('version', it.version)
145-
}
146-
dependencyNode.appendNode('scope', 'test')
147-
} else {
148-
def dependencyNode = dependenciesNode.appendNode('dependency')
149-
dependencyNode.appendNode('groupId', it.group)
150-
dependencyNode.appendNode('artifactId', it.name)
151-
if (it.version == '+') {
152-
dependencyNode.appendNode('version', 'RELEASE')
153-
} else {
154-
dependencyNode.appendNode('version', it.version)
155-
}
156-
dependencyNode.appendNode('scope', 'compile')
119+
licenses {
120+
license {
121+
name 'The Apache License, Version 2.0'
122+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
157123
}
158124
}
159125

160-
return node
161-
}
162-
163-
artifact sourceJar {
164-
classifier "sources"
126+
developers {
127+
developer {
128+
id = 'petikoch'
129+
name 'Peti Koch'
130+
131+
}
132+
}
165133
}
166134
}
167135
}
168136
}
169137

170-
model {
171-
tasks.generatePomFileForMavenCustomPublication {
172-
destination = file("$buildDir/generated_pom.xml")
173-
}
174-
}
175-
176-
bintray {
177-
user = credentials.bintrayUserName // https://github.com/etiennestuder/gradle-credentials-plugin
178-
key = credentials.bintrayApiKey // https://github.com/etiennestuder/gradle-credentials-plugin
179-
publications = ['mavenCustom'] // see publications closure
180-
181-
publish true
182-
183-
pkg {
184-
repo = 'maven'
185-
name = project.name
186-
desc = project.description // doesn't work
187-
websiteUrl = 'https://github.com/Petikoch/jtrag'
188-
issueTrackerUrl = 'https://github.com/Petikoch/jtrag/issues'
189-
vcsUrl = 'https://github.com/Petikoch/jtrag.git'
190-
licenses = ['Apache-2.0']
191-
labels = ['java']
192-
publicDownloadNumbers = true
193-
}
194-
}
195-
196-
jacocoTestReport {
197-
reports {
198-
xml.enabled = true // coveralls plugin depends on xml format report
199-
html.enabled = true
200-
}
201-
}
202-
203138
license {
204139
header = rootProject.file('config/HEADER')
205140
strictCheck = true

config/HEADER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2015 Peti Koch
1+
Copyright 2021 Peti Koch
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

gradle/wrapper/gradle-wrapper.jar

6.13 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Sat Nov 12 15:05:16 CET 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-all.zip

0 commit comments

Comments
 (0)