This repository was archived by the owner on Dec 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
159 lines (141 loc) · 4.79 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
plugins {
id 'java'
id 'maven-publish'
id 'signing'
id("com.apollographql.apollo").version("2.5.9")
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.bloxbean.cardano:cardano-client-lib:0.1.4'
implementation("com.apollographql.apollo:apollo-runtime:2.5.9")
implementation("com.apollographql.apollo:apollo-reactor-support:2.5.9")
implementation("com.squareup.okhttp3:okhttp:4.9.1")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.mockito:mockito-inline:3.7.7'
testImplementation 'org.mockito:mockito-junit-jupiter:3.7.7'
}
sourceSets {
main {
resources {
srcDirs "src/main/resources", "native"
}
}
integrationTest {
java {
compileClasspath += main.output + test.output + configurations.testCompile
runtimeClasspath += main.output + test.output + compileClasspath + configurations.testRuntime
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestImplementation.extendsFrom testImplementation
integrationTestRuntime.extendsFrom testRuntime
integrationTestRuntimeOnly.extendsFrom testRuntimeOnly
}
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
options.compilerArgs += ["-Aproject=${project.group}/${project.name}"]
}
apollo {
customTypeMapping = [
"JSON" : "com.fasterxml.jackson.databind.JsonNode"
]
}
task sourceJar(type: Jar) {
classifier "sources"
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier "javadoc"
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourceJar
archives javadocJar
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
task integrationTest(type: Test) {
description = 'Runs the integration tests.'
group = LifecycleBasePlugin.VERIFICATION_GROUP
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
// mustRunAfter(tasks.named('test'))
systemProperty('CARDANO_GRAPHQL_AUTH_KEY', findProperty("CARDANO_GRAPHQL_AUTH_KEY"))
testLogging {
showStandardStreams = true
}
}
integrationTest {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(sourceJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
pom {
name = 'Cardano Client Lib - GraphQL Backend'
description = 'Cardano Client Library - GraphQL Backend'
url = 'https://github.com/bloxbean/cardano-client-backend-com.bloxbean.cardano.client.backend.gql'
licenses {
license {
name = 'The MIT License'
url = 'http://www.opensource.org/licenses/mit-license.php'
}
}
developers {
developer {
id = 'satran004'
name = 'Satya'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/bloxbean/cardano-client-backend-com.bloxbean.cardano.client.backend.gql'
developerConnection = 'scm:git:ssh://[email protected]/bloxbean/cardano-client-backend-com.bloxbean.cardano.client.backend.gql'
url = 'https://github.com/bloxbean/cardano-client-backend-com.bloxbean.cardano.client.backend.gql'
}
}
}
}
repositories {
String ossrhUsername = System.getenv('MAVEN_USER')
String ossrhPassword = System.getenv('MAVEN_PASSWORD')
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
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
if (isReleaseVersion && !project.hasProperty("skipSigning")) {
signing {
// sign configurations.archives
sign publishing.publications
}
}