-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbuild.gradle
128 lines (101 loc) · 3.05 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
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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
plugins {
id "maven-publish"
id 'net.researchgate.release' version '2.5.0'
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}
release {
failOnUnversionedFiles = false
failOnCommitNeeded = false
tagTemplate = '$name-$version'
newVersionCommitMessage = '[Gradle Release Plugin][ci skip] new version release:'
}
wrapper {
gradleVersion = '5.2.1'
}
allprojects {
group = 'com.yahoo.parsec'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'maven'
repositories {
mavenCentral()
}
}
//maven central settings
ext.'nexusUsername' = System.env.OSS_USER
ext.'nexusPassword' = System.env.OSS_PW
ext.'signing.keyId' = System.env.SIGNING_KEYID
ext.'signing.password' = System.env.SIGNING_PWD
//the encrypted secret key ring file is checked in and will be decrypted by travis
ext.'signing.secretKeyRingFile' = "${project.rootDir}/maintainer-secring.gpg"
subprojects {
apply plugin: 'signing'
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
id "parsec-maintainers"
name "parsec-maintainers"
email "[email protected]"
}
}
scm {
connection 'scm:git:https://github.com/yahoo/parsec-libraries.git'
developerConnection 'scm:git:https://github.com/yahoo/parsec-libraries.git'
url 'https://github.com/yahoo/parsec-libraries/'
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
//prepare for upload
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact javadocJar
artifact sourcesJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'The Parsec Java Libraries.')
root.appendNode('name', project.name)
root.appendNode('url', 'https://github.com/yahoo/parsec-libraries')
root.children().last() + pomConfig
}
}
}
}
signing {
sign publishing.publications
}
afterReleaseBuild.dependsOn check
}
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
username = project.nexusUsername
password = project.nexusPassword
}
}
}