-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathbuild.gradle
156 lines (127 loc) · 4.61 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
buildscript {
ext.caver_version = '1.6.3'
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
id 'idea'
id 'io.codearte.nexus-staging' version "0.30.0"
}
//It should only be applied on the ROOT project in a build.
apply plugin: 'io.codearte.nexus-staging'
allprojects {
version '1.10.0'
group 'xyz.groundx.caver'
description 'An extension library of caver-java for using KAS (Klaytn API Service).'
sourceCompatibility = 1.8
targetCompatibility = 1.8
apply plugin: 'java'
apply plugin: 'signing'
apply plugin: 'maven-publish'
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
javadoc {
options.encoding = 'UTF-8'
}
// Deploy
task javadocJar(type: Jar) {
archiveClassifier = "javadoc"
from javadoc
}
task sourcesJar(type: Jar) {
archiveClassifier = "sources"
from sourceSets.main.allSource
}
task testQA(type: Test) {
systemProperty "TEST_ENV", "QA"
}
task testDEV(type: Test) {
systemProperty "TEST_ENV", "DEV"
}
task testPROD(type: Test) {
systemProperty "TEST_ENV", "PROD"
}
ext {
ossrhUsername = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ossrhPassword = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
ossrhSigningKey_base64 = project.hasProperty('signingKey')? project.property('signingKey') : System.getenv('ORG_GRADLE_PROJECT_signingKey')
ossrhSigningPassword = project.hasProperty('signingKey')? project.property('signingPassword') : System.getenv('ORG_GRADLE_PROJECT_signingPassword')
isAndroidBuild = project.version.endsWith("-android")
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.name
description = project.description
version = project.version
url = "https://www.klaytnapi.com"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
developers {
developer {
id = "groundxDev"
name = "caver-java-ext-kas Authors"
email = "developer@groundx.xyz"
}
}
scm {
connection = "scm:git:https://*.git"
developerConnection = "scm:git://*.git"
url = "https://*.git"
}
}
}
}
repositories {
maven {
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
signing {
def signingPassword = ossrhSigningPassword
def signingKey_base64 = ossrhSigningKey_base64
def signingKey = (signingKey_base64 == null? null:
new String(Base64.getMimeDecoder().decode(signingKey_base64.toString()), "utf-8"))
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
nexusStaging {
username= ossrhUsername
password= ossrhPassword
}
dependencies {
if(isAndroidBuild) {
compile "com.klaytn.caver:core:$caver_version-android"
} else {
compile "com.klaytn.caver:core:$caver_version"
}
compile 'io.swagger.core.v3:swagger-annotations:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.google.code.gson:gson:2.8.1'
compile 'io.gsonfire:gson-fire:1.8.0'
compile 'org.threeten:threetenbp:1.3.5'
compile 'io.github.cdimascio:dotenv-java:2.2.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.mockito:mockito-core:3.6.28'
testCompile "ch.qos.logback:logback-core:1.2.3",
"ch.qos.logback:logback-classic:1.2.3"
}
}