-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle
More file actions
115 lines (101 loc) · 3.64 KB
/
Copy pathbuild.gradle
File metadata and controls
115 lines (101 loc) · 3.64 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.nio.file.Paths
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.24'
id 'application'
id 'com.google.protobuf' version '0.9.4'
id 'groovy'
}
version = '0.0.0'
targetCompatibility = '17'
sourceCompatibility = '17'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation platform('org.jetbrains.kotlin:kotlin-bom')
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.24'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk9:1.8.1'
implementation 'io.grpc:grpc-protobuf:1.64.0'
implementation 'io.grpc:grpc-stub:1.64.0'
implementation 'io.grpc:grpc-netty:1.64.0'
implementation "io.grpc:grpc-kotlin-stub:1.4.1"
// implementation "javax.annotation:javax.annotation-api:1.3.2"
implementation('io.github.oshai:kotlin-logging-jvm:5.0.1') {
exclude group: 'org.jetbrains.kotlin'
}
implementation('com.michael-bull.kotlin-result:kotlin-result:1.1.12') {
exclude group: 'org.jetbrains.kotlin'
}
implementation 'au.com.dius.pact.core:support:4.6.9'
implementation 'au.com.dius.pact.core:model:4.6.9'
implementation 'au.com.dius.pact.core:matchers:4.6.9'
implementation 'com.google.protobuf:protobuf-java:4.26.1'
implementation 'ch.qos.logback:logback-classic:1.5.6'
implementation 'com.github.os72:protoc-jar:3.11.4'
implementation "io.pact.plugin.driver:core:0.4.2"
implementation "org.apache.commons:commons-lang3:3.14.0"
implementation 'com.google.guava:guava:33.2.0-jre'
implementation 'org.apache.tika:tika-core:2.9.2'
protobuf files('../../proto/')
testImplementation "org.codehaus.groovy:groovy:3.0.21"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.10.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation('org.spockframework:spock-core:2.3-groovy-4.0')
testImplementation 'net.bytebuddy:byte-buddy:1.9.16'
testImplementation 'org.objenesis:objenesis:3.4'
}
application {
mainClass = 'io.pact.protobuf.plugin.PluginAppKt'
}
tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
test {
useJUnitPlatform()
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:4.26.1" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:1.64.0" }
grpckt { artifact = "io.grpc:protoc-gen-grpc-kotlin:1.4.1:jdk17@jar" }
}
generateProtoTasks {
all()*.plugins {
grpc {}
grpckt {}
}
}
}
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
kotlin {
srcDirs 'build/generated/source/proto/main/grpckt'
}
}
}
tasks.register('unpackDist', Copy) {
dependsOn tasks.build
from zipTree("${project.buildDir}/distributions/pact-protobuf-plugin-${project.version}.zip")
eachFile { fcd ->
fcd.relativePath = new RelativePath(true, fcd.relativePath.segments.drop(1))
}
into file(Paths.get(System.getProperty('user.home')).resolve(".pact/plugins/protobuf-${project.version}"))
}
tasks.register('copyManifest', Copy) {
from 'pact-plugin.json'
into file(Paths.get(System.getProperty('user.home')).resolve(".pact/plugins/protobuf-${project.version}"))
}
tasks.register('installLocal') {
dependsOn 'unpackDist', 'copyManifest'
}