-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
103 lines (88 loc) · 3.35 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
apply plugin: 'java'
apply plugin: 'eclipse'
group = 'net.gredler'
version = '1.0.0'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.12'
}
sourceCompatibility = 7
targetCompatibility = 7
// When using JDK8+ as the primary JDK, JDK7 should be installed as a secondary JDK to compile
// against (to make sure that we're not inadvertently using newer APIs), and the JDK7_HOME
// environment variable should be set to the home directory of this secondary JDK
// https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
tasks.withType(JavaCompile) {
doFirst {
if (System.env.JDK7_HOME != null) {
options.fork = true
options.bootClasspath = "$System.env.JDK7_HOME/jre/lib/rt.jar"
}
}
}
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'
jar.dependsOn 'check'
task wrapper(type: Wrapper) {
gradleVersion = '2.13'
}
/*------------------------------------------------------------------------------------------------*/
/* CONFIGURATION FOR UPLOAD TO MAVEN CENTRAL REPO */
/* */
/* The signing credentials and Sonatype OSSRH credentials must be in the gradle.properties file. */
/* Upload to Maven Central with the command "gradlew uploadArchives". */
/* http://central.sonatype.org/pages/gradle.html */
/* http://central.sonatype.org/pages/ossrh-guide.html */
/* */
/*------------------------------------------------------------------------------------------------*/
apply plugin: 'maven'
apply plugin: 'signing'
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'JDK9 PNG Writer Backport'
description 'A backport of the PNG writer performance enhancements implemented in JDK-6488522.'
packaging 'jar'
url 'https://github.com/gredler/jdk9-png-writer-backport'
scm {
connection 'scm:git:git://github.com/gredler/jdk9-png-writer-backport.git'
url 'https://github.com/gredler/jdk9-png-writer-backport'
}
licenses {
license {
name 'GPL 2 + Classpath Exception'
url 'http://openjdk.java.net/legal/gplv2+ce.html'
}
}
developers {
developer {
id 'gredler'
name 'Daniel Gredler'
}
}
}
}
}