-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle
125 lines (109 loc) · 3.82 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.6.1/userguide/java_library_plugin.html
*/
plugins {
id 'java-library' // Apply the java-library plugin to add support for Java Library
id 'maven-publish'
id 'signing'
}
group = 'io.github.conflux-chain'
version = '1.3.0' // SNAPSHOT
repositories {
// jcenter()
mavenCentral()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
compile 'org.web3j:core:4.9.3'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
}
test {
useJUnitPlatform()
}
tasks.register('sourcesJar', Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}
tasks.register('javadocJar', Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
tasks.register('printEnvironmentVariable') {
doLast {
println "MY_ENV_VAR: " + findProperty("signing.secretKey") as String
}
}
signing {
useInMemoryPgpKeys(
findProperty("signing.secretKey") as String,
findProperty("signing.password") as String
)
sign publishing.publications;
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'conflux.web3j'
artifact sourcesJar
artifact javadocJar
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'java-conflux-sdk'
description = 'Java SDK for conflux network'
url = 'https://github.com/Conflux-Chain/java-conflux-sdk'
properties = [
tags: "blockchain, conflux"
]
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://github.com/Conflux-Chain/conflux-rust/blob/master/LICENSE'
}
}
developers {
developer {
id = 'Pana'
name = 'Pana.W'
email = 'pana.wang@outlook.com'
}
}
scm {
connection = 'scm:https://github.com/Conflux-Chain/java-conflux-sdk.git'
developerConnection = 'scm:git://github.com/Conflux-Chain/java-conflux-sdk.git'
url = 'https://github.com/conflux-chain/java-conflux-sdk'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
name = "OSSRH"
credentials {
username = findProperty("maven.username")
password = findProperty("maven.password")
}
}
}
}
// ref https://docs.github.com/en/actions/guides/publishing-java-packages-with-gradle