forked from nervosnetwork/ckb-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
161 lines (132 loc) · 4.31 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
156
157
158
159
160
161
buildscript {
ext.bouncycastleVersion = '1.65'
ext.rxjavaVersion = '2.2.21'
ext.gsonVersion = '2.9.1'
ext.okhttpVersion = '4.10.0'
ext.loggingOkhttpVersion = '4.10.0'
ext.slf4jVersion = '2.0.0'
ext.guavaVersion = '31.1-jre'
ext.junitVersion = '5.9.0'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:6.0.0'
}
}
plugins {
id 'com.github.johnrengelman.shadow' version '6.1.0'
id 'java'
id 'com.jfrog.bintray' version '1.8.5'
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'application'
apply plugin: 'io.codearte.nexus-staging'
mainClassName = 'org.nervos.ckb.example.RpcExample'
applicationName = 'ckb-sdk-java'
description 'ckb-sdk-java base project'
allprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group 'org.nervos.ckb'
version '2.1.0'
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testImplementation "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
test {
ignoreFailures = true
useJUnitPlatform()
}
apply from: rootProject.file('gradle/checkstyle.gradle')
}
configure(subprojects.findAll { it.name != 'tests' }) {
// Required for Maven Nexus repository
apply plugin: 'maven'
apply plugin: 'signing'
// Required for JFrog Artifactory repository
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task testJar(type: Jar) {
archiveClassifier.set('test-sources')
from sourceSets.test.output
}
artifacts {
archives sourcesJar, javadocJar, testJar
}
ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'org.nervos.ckb'
version '2.1.0'
from components.java
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(
userName: ossrhUsername,
password: ossrhPassword
)
}
pom.project {
name 'ckb-sdk-java'
packaging 'jar'
description project.description
url 'https://github.com/nervosnetwork/ckb-sdk-java.git'
scm {
connection 'scm:[email protected]:nervosnetwork/ckb-sdk-java.git'
url 'https://github.com/nervosnetwork/ckb-sdk-java.git'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'nervos'
name 'nervos developer'
email '[email protected]'
}
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask('uploadArchives') }
// only execute as part of this task
sign configurations.archives
}
task release {
dependsOn 'build'
dependsOn 'uploadArchives'
dependsOn 'bintrayUpload'
tasks.findByName('uploadArchives').mustRunAfter 'build'
tasks.findByName('bintrayUpload').mustRunAfter 'build'
}
}