-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
157 lines (129 loc) · 4.18 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
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'
ext.kotestVersion = '5.6.1'
ext.kotlinVersion = "1.8.21"
ext.mockkVersion = "1.13.5"
repositories {
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'
}
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.1'
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: 'signing'
// Required for JFrog Artifactory repository
apply plugin: 'maven-publish'
tasks.register('javadocJar', Jar) {
archiveClassifier.set('javadoc')
from javadoc
}
tasks.register('sourcesJar', Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
tasks.register('testJar', 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 {
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username=ossrhUsername
password=ossrhPassword
}
}
}
publications {
mavenJava(MavenPublication) {
groupId 'org.nervos.ckb'
version '2.1.1'
from components.java
pom {
name = 'ckb-sdk-java'
description = project.description
url = 'https://github.com/nervosnetwork/ckb-sdk-java.git'
scm {
connection = 'scm:git@github.com: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 = 'op@nervos.org'
}
}
}
}
}
}
tasks.register('uploadArchives') {
println "start publish ${project.name} ${it.name}"
dependsOn publish
}
signing {
required { gradle.taskGraph.hasTask('uploadArchives') }
// only execute as part of this task
sign configurations.archives
}
tasks.register('release') {
println("release ${it.name}")
dependsOn 'build'
dependsOn 'uploadArchives'
tasks.findByName('uploadArchives').mustRunAfter 'build'
}
}