forked from woo-j/OkapiBarcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
132 lines (116 loc) · 4.22 KB
/
build.gradle
File metadata and controls
132 lines (116 loc) · 4.22 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'jacoco'
group = 'uk.org.okapibarcode'
archivesBaseName = 'okapibarcode'
version = '0.2.6'
repositories {
mavenCentral()
}
dependencies {
compile 'com.beust:jcommander:1.48'
testCompile 'junit:junit:4.12'
testCompile 'com.google.zxing:javase:3.3.0'
testCompile 'org.reflections:reflections:0.9.10'
}
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'
manifest.attributes(
'Main-Class': 'uk.org.okapibarcode.OkapiBarcode',
'Implementation-Title': 'Okapi Barcode',
'Implementation-Version': version
)
}
// Enable JaCoCo XML output for Codecov, and exclude GUI classes from the coverage reports
jacocoTestReport {
reports {
xml.enabled true
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['uk/org/okapibarcode/*.class', 'uk/org/okapibarcode/gui/**/*.class'])
}))
}
}
wrapper {
gradleVersion = '6.7'
}
/*------------------------------------------------------------------------------------------------*/
/* 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 javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
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 'Okapi Barcode'
description 'Okapi Barcode is an open-source barcode generator written entirely in Java, ' +
'supporting over 50 encoding standards including all ISO standards.'
packaging 'jar'
url 'https://github.com/woo-j/OkapiBarcode'
scm {
connection 'scm:git:git://github.com/woo-j/OkapiBarcode.git'
url 'https://github.com/woo-j/OkapiBarcode'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'woo-j'
name 'Robin Stuart'
}
developer {
id 'gredler'
name 'Daniel Gredler'
}
}
}
}
}