Skip to content

Commit 2943545

Browse files
committed
release pdf-test 1.7.0
* upgrade to Gradle 7.2 * migrate to maven-publish plugin
1 parent de369c1 commit 2943545

File tree

10 files changed

+298
-264
lines changed

10 files changed

+298
-264
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ If you use **Maven**, add the following dependency to pom.xml:
4747
<dependency>
4848
<groupId>com.codeborne</groupId>
4949
<artifactId>pdf-test</artifactId>
50-
<version>1.6.1</version>
50+
<version>1.7.0</version>
5151
</dependency>
5252
```
5353

5454
If you use **Gradle**, add the following dependency to build.gradle:
5555

5656
```groovy
57-
testCompile 'com.codeborne:pdf-test:1.6.1'
57+
testCompile 'com.codeborne:pdf-test:1.7.0'
5858
```
5959

6060
## How to contribute

build.gradle

Lines changed: 6 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -9,92 +9,16 @@ buildscript {
99
}
1010

1111
apply plugin: 'java'
12-
apply plugin: 'maven'
1312
apply plugin: 'jacoco'
1413
apply plugin: 'com.github.kt3k.coveralls'
1514

16-
group='com.codeborne'
15+
group = 'com.codeborne'
1716
archivesBaseName = 'pdf-test'
18-
version='1.6.1'
19-
20-
[compileJava, compileTestJava]*.options.collect {options -> options.encoding = 'UTF-8'}
21-
[compileJava, compileTestJava]*.options.collect {options -> options.debug = true}
22-
compileJava.options.debugOptions.debugLevel = "source,lines,vars"
23-
24-
sourceCompatibility = 1.8
25-
targetCompatibility = 1.8
17+
version = '1.7.0'
2618

2719
defaultTasks 'test', 'install'
2820

29-
dependencies {
30-
implementation group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.24', transitive: true
31-
implementation group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3', transitive: false
32-
testImplementation group: 'junit', name: 'junit', version: '4.13.2', transitive: false
33-
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3', transitive: false
34-
implementation group: 'org.assertj', name: 'assertj-core', version: '3.21.0', transitive: false
35-
}
36-
37-
repositories{
38-
mavenCentral()
39-
}
40-
41-
task libsProd(type: Sync) {
42-
from configurations.compileClasspath
43-
into "$buildDir/lib-prod"
44-
}
45-
46-
task libsTest(type: Sync) {
47-
from configurations.testRuntimeClasspath - configurations.compileClasspath
48-
into "$buildDir/lib-test"
49-
}
50-
51-
compileJava.dependsOn libsProd, libsTest
52-
53-
test {
54-
include 'com/codeborne/pdftest/**/*'
55-
systemProperties['file.encoding'] = 'UTF-8'
56-
testLogging.showStandardStreams = true
57-
jacoco {
58-
enabled = true
59-
}
60-
}
61-
62-
jar {
63-
manifest {
64-
attributes(
65-
"Implementation-Title": project.group + '.' + project.name,
66-
"Implementation-Version": version,
67-
"Implementation-Vendor": "Codeborne")
68-
}
69-
}
70-
71-
task sourcesJar(type: Jar, dependsOn:classes) {
72-
classifier = 'sources'
73-
from sourceSets.main.allSource
74-
}
75-
76-
javadoc {
77-
failOnError=false
78-
}
79-
80-
task javadocJar(type: Jar, dependsOn:javadoc) {
81-
classifier = 'javadoc'
82-
from javadoc.destinationDir
83-
}
84-
85-
artifacts {
86-
archives jar
87-
archives sourcesJar
88-
archives javadocJar
89-
}
90-
91-
jacocoTestReport {
92-
reports {
93-
xml.enabled true
94-
html.enabled true
95-
}
96-
}
97-
98-
tasks.coveralls {
99-
onlyIf { System.env.'CI' }
100-
}
21+
apply from: file('gradle/compilation.gradle')
22+
apply from: file('gradle/dependencies.gradle')
23+
apply from: file('gradle/tests.gradle')
24+
apply from: file('gradle/publish.gradle')

deploy.gradle

Lines changed: 0 additions & 75 deletions
This file was deleted.

gradle/compilation.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[compileJava, compileTestJava]*.options.collect {options -> options.encoding = 'UTF-8'}
2+
[compileJava, compileTestJava]*.options.collect {options -> options.debug = true}
3+
compileJava.options.debugOptions.debugLevel = "source,lines,vars"
4+
5+
sourceCompatibility = 1.8
6+
targetCompatibility = 1.8

gradle/dependencies.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dependencies {
2+
implementation group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.24', transitive: true
3+
implementation group: 'org.hamcrest', name: 'hamcrest-core', version: '1.3', transitive: false
4+
testImplementation group: 'junit', name: 'junit', version: '4.13.2', transitive: false
5+
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3', transitive: false
6+
implementation group: 'org.assertj', name: 'assertj-core', version: '3.21.0', transitive: false
7+
}
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
task libsProd(type: Sync) {
14+
from configurations.compileClasspath
15+
into "$buildDir/lib-prod"
16+
}
17+
18+
task libsTest(type: Sync) {
19+
from configurations.testRuntimeClasspath - configurations.compileClasspath
20+
into "$buildDir/lib-test"
21+
}
22+
23+
compileJava.dependsOn libsProd, libsTest

gradle/publish.gradle

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
jar {
2+
manifest {
3+
attributes(
4+
"Implementation-Title": project.group + '.' + project.name,
5+
"Implementation-Version": version,
6+
"Implementation-Vendor": "Codeborne")
7+
}
8+
}
9+
10+
task sourcesJar(type: Jar) {
11+
classifier = 'sources'
12+
from sourceSets.main.allJava
13+
}
14+
15+
javadoc {
16+
options.encoding = 'UTF-8'
17+
failOnError = false
18+
}
19+
20+
task javadocJar(type: Jar, dependsOn: javadoc) {
21+
classifier = 'javadoc'
22+
from javadoc.destinationDir
23+
}
24+
25+
if (project.hasProperty("signing.keyId")) {
26+
apply plugin: 'signing'
27+
apply plugin: 'maven-publish'
28+
29+
signing {
30+
afterEvaluate {
31+
sign publishing.publications.mavenJava
32+
}
33+
}
34+
35+
artifacts {
36+
archives jar
37+
archives sourcesJar
38+
archives javadocJar
39+
}
40+
41+
publishing {
42+
repositories {
43+
maven {
44+
name 'Maven'
45+
url project.version.endsWith("-SNAPSHOT") ?
46+
'https://oss.sonatype.org/content/repositories/snapshots/' :
47+
'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
48+
credentials {
49+
username "$sonatypeUsername"
50+
password "$sonatypePassword"
51+
}
52+
}
53+
}
54+
publications {
55+
mavenJava(MavenPublication) {
56+
groupId "${project.group}"
57+
artifactId "${project.name}"
58+
59+
from components.java
60+
artifact(sourcesJar)
61+
artifact(javadocJar)
62+
63+
pom {
64+
name = archivesBaseName
65+
description = 'PDF Test: PDF testing library'
66+
url = 'https://github.com/codeborne/pdf-test'
67+
licenses {
68+
license {
69+
name = 'MIT'
70+
url = 'https://opensource.org/licenses/MIT'
71+
}
72+
}
73+
developers {
74+
developer {
75+
id = 'asolntsev'
76+
name = 'Andrei Solntsev'
77+
}
78+
}
79+
scm {
80+
connection = 'scm:[email protected]:codeborne/pdf-test.git'
81+
developerConnection = 'scm:[email protected]:codeborne/pdf-test.git'
82+
url = 'https://github.com/codeborne/pdf-test'
83+
}
84+
}
85+
}
86+
}
87+
}
88+
}

gradle/tests.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
test {
2+
include 'com/codeborne/pdftest/**/*'
3+
systemProperties['file.encoding'] = 'UTF-8'
4+
testLogging.showStandardStreams = true
5+
jacoco {
6+
enabled = true
7+
}
8+
}
9+
10+
jacocoTestReport {
11+
reports {
12+
xml.enabled true
13+
html.enabled true
14+
}
15+
}
16+
17+
tasks.coveralls {
18+
onlyIf { System.env.'CI' }
19+
}

gradle/wrapper/gradle-wrapper.jar

333 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)