forked from diem/client-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
155 lines (141 loc) · 4.66 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
/*
* 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/6.5.1/userguide/java_library_plugin.html
*/
repositories {
mavenCentral()
}
group 'com.diem'
version '1.1.0'
apply plugin: 'java-library'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
apply plugin: 'io.codearte.nexus-staging'
task sourceJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'Diem Client SDK'
description = 'The official Diem Client SDK for the Java programming language.'
url = 'https://github.com/diem/client-sdk-java'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'Diem Open Source'
url = 'https://developers.diem.com'
}
}
scm {
connection = 'scm:git:git@github.com:diem/client-sdk-java.git'
url = 'https://github.com/diem/client-sdk-java'
}
}
tasks.withType(Jar) {
from(project.projectDir) {
include 'LICENSE'
into 'META-INF'
}
}
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
credentials {
username System.getenv('ossrhUsername')
password System.getenv('ossrhPassword')
}
}
}
}
dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.bouncycastle:bcprov-jdk15on:1.66'
implementation 'org.bitcoinj:bitcoinj-core:0.15.8'
implementation 'design.contract:libbech32:1.0.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.10'
implementation 'org.apache.commons:commons-lang3:3.11'
implementation 'com.google.protobuf:protobuf-java:3.13.0'
implementation 'com.google.protobuf:protobuf-java-util:3.13.0'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.13'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
javadoc {
options.addBooleanOption('Xdoclint:none', true)
}
signing {
def signingKey = System.getenv("signingKey")
def signingPassword = System.getenv("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
task gen {
doLast {
exec {
workingDir 'diem'
executable "sh"
args "-c", "cargo build -p transaction-builder-generator"
}
exec {
workingDir 'diem'
executable "sh"
args '-c', 'target/debug/generate-transaction-builders' +
' --language java' +
' --module-name com.diem.stdlib' +
' --with-diem-types "testsuite/generate-format/tests/staged/diem.yaml"' +
' --with-custom-diem-code language/transaction-builder/generator/examples/java/custom_diem_code/*.java' +
' --target-source-dir "./../src/main/java"' +
' "language/diem-framework/releases/legacy" "language/diem-framework/releases/artifacts/current"'
}
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.13'
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0"
}
}
protobuf {
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:3.0.0'
}
generatedFilesBaseDir = "$projectDir/src"
}
jacocoTestReport {
reports {
html.enabled(true)
}
}
nexusStaging {
username = System.getenv("nexusUsername")
password = System.getenv("nexusPassword")
}