This repository was archived by the owner on Sep 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
188 lines (169 loc) · 5.6 KB
/
build.gradle
File metadata and controls
188 lines (169 loc) · 5.6 KB
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
import java.text.SimpleDateFormat
plugins {
id 'java-library'
id 'java-library-distribution'
id 'maven-publish'
id 'org.jreleaser' version '1.13.1'
id "com.google.protobuf" version "0.9.4"
}
group = 'io.contract-testing.contractcase'
version = "0.1.0" // x-release-please-version
sourceCompatibility = '17'
repositories {
mavenCentral()
mavenLocal()
}
def caseCoreVersion = "0.15.6"
def grpcVersion = "1.65.1"
dependencies {
api "io.contract-testing.contractcase:case_example_mock_types:${caseCoreVersion}"
api "io.contract-testing.contractcase:test-equivalence-matchers:${caseCoreVersion}"
implementation 'com.diogonunes:JColor:5.5.1'
implementation 'com.google.protobuf:protobuf-java:4.27.2'
implementation 'com.google.protobuf:protobuf-java-util:4.27.2'
implementation 'com.google.protobuf:protoc:4.27.2'
implementation "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
implementation "io.grpc:grpc-core:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "io.grpc:grpc-netty-shaded:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
implementation 'org.jetbrains:annotations:24.1.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.3'
testImplementation 'com.google.protobuf:protobuf-gradle-plugin:0.9.4'
}
test {
useJUnitPlatform()
}
jar {
duplicatesStrategy(DuplicatesStrategy.WARN)
manifest {
attributes(
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Implementation-Version': version,
'Implementation-Title': 'ContractCase Java DSL, for defining and verifying contracts with ContractCase',
'Specification-Title': 'ContractCase Java DSL, for defining and verifying contracts with ContractCase',
'Specification-Version': version,
)
}
}
sourceSets {
main {
java {}
}
}
protobuf {
plugins {
// Locate a plugin with name 'grpc'. This step is optional.
// If you leave it empty, it uses the current directory.
// If you don't specify it, protoc will try to use "protoc-gen-grpc" from
// system search path.
'grpc' {
artifact = 'io.grpc:protoc-gen-grpc-java:1.65.1'
}
}
protoc {
// Download from repositories
artifact = 'com.google.protobuf:protoc:4.27.2'
}
generateProtoTasks {
all().configureEach { task ->
task.builtins {
java {}
}
task.plugins {
grpc {
outputSubDir = 'grpcjava'
}
}
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
contractcase(MavenPublication) {
groupId = 'io.contract-testing.contractcase'
artifactId = 'contract-case'
version = version
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'contract-case'
description = 'ContractCase Java DSL'
url = 'https://case.contract-testing.io/'
inceptionYear = '2022'
licenses {
license {
name = 'BSD-3-Clause'
url = 'https://spdx.org/licenses/BSD-3-Clause.html'
}
}
developers {
developer {
id = 'TimothyJones'
name = 'Timothy Jones'
}
}
scm {
connection = 'scm:git:https://github.com/case-contract-testing/java-dsl.git'
developerConnection = 'scm:git:ssh://github.com/case-contract-testing/java-dsl.git'
url = 'https://github.com/case-contract-testing/java-dsl'
}
}
}
}
repositories {
maven {
url = layout.buildDirectory.dir('staging-deploy')
}
mavenLocal()
}
/*
contractcase(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}*/
}
jreleaser {
signing {
active = 'ALWAYS'
armored = true
}
deploy {
maven {
nexus2 {
'maven-central' {
active = 'ALWAYS'
url = 'https://s01.oss.sonatype.org/service/local'
snapshotUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
closeRepository = true
releaseRepository = true
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
applyMavenCentralRules = true
stagingRepository('build/staging-deploy')
}
}
}
}
}