-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
61 lines (47 loc) · 1.27 KB
/
build.gradle
File metadata and controls
61 lines (47 loc) · 1.27 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
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id "com.github.ben-manes.versions" version "0.51.0"
}
group projectGroupId
version projectVersion
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
javadoc {
options.encoding = 'UTF-8'
}
String getBuildProperty(String property) {
project.findProperty (property) ?: System.getenv (property) ?: 'n/a'
}
String getBuildSignKey(String property) {
project.findProperty (property) ?:
System.getenv (property) ? System.getenv (property).replace("\\n", "\n"): 'n/a'
}
ext {
publishUser = getBuildProperty ('PUBLISH_USER')
publishKey = getBuildProperty ('PUBLISH_KEY')
signKey = getBuildSignKey ('SIGN_KEY')
signPwd = getBuildProperty ('SIGN_PWD')
isReleaseVersion = !version.endsWith("SNAPSHOT")
}
repositories {
mavenCentral()
}
dependencies {
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set ('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set ('javadoc')
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
apply from: "${rootProject.rootDir}/gradle/publishing.gradle"