-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
155 lines (127 loc) · 4.47 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0"
}
}
apply plugin: 'io.codearte.nexus-staging'
allprojects {
group 'tech.harmonysoft'
version = '1.1.10'
ext {
junitJupiterVersion = '5.0.1'
junitPlatformVersion = '1.0.1'
setupBintray = {
bintray {
user = project.hasProperty('bintrayUser') ? bintrayUser : ''
key = project.hasProperty('bintrayApiKey') ? bintrayApiKey : ''
publications = ['MyPublication']
pkg {
repo = 'harmonysoft.tech'
name = archivesBaseName
licenses = ['MIT']
vcsUrl = 'https://github.com/denis-zhdanov/traute.git'
version {
name = version
released = new Date()
}
}
}
}
}
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'maven'
apply plugin: 'maven-publish'
def shouldSign = !System.getenv('CI_ENV') && project.hasProperty('signing.keyId')
if (shouldSign) {
apply plugin: 'signing'
}
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
jcenter()
// For android annotations
maven {
url "https://maven.google.com"
}
}
dependencies {
compile 'org.jetbrains:annotations:15.0'
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testCompile "org.junit.platform:junit-platform-runner:$junitPlatformVersion"
testCompile "org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion"
testCompileOnly 'org.apiguardian:apiguardian-api:1.0.0'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
if (shouldSign) {
signing {
sign configurations.archives
}
}
uploadArchives {
repositories {
mavenDeployer {
if (!System.getenv('CI_ENV')) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: project.hasProperty('ossrhUsername') ? ossrhUsername : '',
password: project.hasProperty('ossrhPassword') ? ossrhPassword : '')
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: project.hasProperty('ossrhUsername') ? ossrhUsername : '',
password: project.hasProperty('ossrhPassword') ? ossrhPassword : '')
}
pom.project {
packaging 'jar'
scm {
connection 'scm:git:git://github.com/denis-zhdanov/traute.git'
developerConnection 'scm:git:git://github.com/denis-zhdanov/traute.git'
url 'https://github.com/denis-zhdanov/traute'
}
licenses {
license {
name 'The MIT License (MIT)'
url 'http://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'denis'
name 'Denis Zhdanov'
email 'denzhdanov@gmail.com'
}
}
}
}
}
}
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'tech.harmonysoft'
artifactId archivesBaseName
version version
}
}
}
}