-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
133 lines (113 loc) · 4.74 KB
/
build.gradle.kts
File metadata and controls
133 lines (113 loc) · 4.74 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
import com.google.protobuf.gradle.id
plugins {
id("build-logic.java-published-library")
id("build-logic.test-junit5")
id("build-logic.build-info")
id("org.jsonschema2dataclass") version "5.0.0"
id("com.google.protobuf") version "0.9.5"
}
description = "A Java client for signing and verifying using Sigstore"
dependencies {
compileOnly("org.immutables:gson:2.10.1")
compileOnly("org.immutables:value-annotations:2.10.1")
annotationProcessor("org.immutables:value:2.10.1")
implementation(platform("com.google.http-client:google-http-client-bom:1.47.1"))
implementation("com.google.http-client:google-http-client-apache-v2")
implementation("com.google.http-client:google-http-client-gson")
implementation("io.github.erdtman:java-json-canonicalization:1.1")
// this requires inclusion of protos is src/main/proto
protobuf("dev.sigstore:protobuf-specs:0.4.3")
implementation(platform("com.google.protobuf:protobuf-bom:4.30.2"))
implementation("com.google.protobuf:protobuf-java-util")
// grpc deps
implementation(platform("io.grpc:grpc-bom:1.71.0"))
implementation("io.grpc:grpc-protobuf")
implementation("io.grpc:grpc-stub")
runtimeOnly("io.grpc:grpc-netty-shaded")
compileOnly("org.apache.tomcat:annotations-api:6.0.53") // java 9+ only
implementation("commons-codec:commons-codec:1.18.0")
implementation("com.google.code.gson:gson:2.13.1")
implementation("org.bouncycastle:bcutil-jdk18on:1.80")
implementation("org.bouncycastle:bcpkix-jdk18on:1.80")
implementation(platform("com.google.oauth-client:google-oauth-client-bom:1.39.0"))
implementation("com.google.oauth-client:google-oauth-client")
implementation("com.google.oauth-client:google-oauth-client-jetty")
implementation("com.google.oauth-client:google-oauth-client-java6")
testImplementation(project(":sigstore-testkit"))
testImplementation(platform("org.junit:junit-bom:5.12.2"))
testImplementation(platform("org.mockito:mockito-bom:5.16.1"))
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
testImplementation("no.nav.security:mock-oauth2-server:0.5.10")
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
testImplementation("net.sourceforge.htmlunit:htmlunit:2.70.0")
testImplementation("org.eclipse.jetty:jetty-server:11.0.26")
testImplementation("io.github.netmikey.logunit:logunit-core:2.0.0")
testRuntimeOnly("io.github.netmikey.logunit:logunit-jul:2.0.0")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:4.30.2"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.71.0"
}
}
generateProtoTasks {
ofSourceSet("main").configureEach {
plugins {
id("grpc")
}
builtins {
named("java") {
// Adds @javax.annotation.Generated annotation to the generated code
option("annotate_code")
}
}
}
}
}
spotless {
java {
targetExclude(
"build/**/*.java",
"src/*/java/dev/sigstore/encryption/certificates/transparency/*.java",
"src/*/java/dev/sigstore/json/canonicalizer/*.java",
)
}
format("conscrypt", com.diffplug.gradle.spotless.JavaExtension::class.java) {
googleJavaFormat("1.24.0")
licenseHeaderFile("$rootDir/config/conscryptLicenseHeader")
target("src/*/java/dev/sigstore/encryption/certificates/transparency/*.java")
}
format("webPki", com.diffplug.gradle.spotless.JavaExtension::class.java) {
googleJavaFormat("1.24.0")
licenseHeaderFile("$rootDir/config/webPKILicenseHeader")
target("src/*/java/dev/sigstore/json/canonicalizer/*.java")
}
}
jsonSchema2Pojo {
executions {
create("rekor") {
source.setFrom(files("${sourceSets.main.get().output.resourcesDir}/rekor/model"))
targetDirectoryPrefix.set(layout.buildDirectory.dir("generated/sources/rekor-model/"))
targetPackage.set("dev.sigstore.rekor")
generateBuilders.set(true)
annotationStyle.set("gson")
}
}
}
forbiddenApis {
// Don't allow sigstore-java developers to directly call JsonFormat.parser(), use our wrapper instead
// which allows for ignored fields.
signaturesFiles = files("$rootDir/config/forbiddenApis.txt")
suppressAnnotations = setOf("dev.sigstore.forbidden.SuppressForbidden")
}
// TODO: keep until these code gen plugins explicitly declare dependencies
tasks.named("sourcesJar") {
dependsOn("generateJsonSchema2DataClassConfigRekor")
}
tasks.generateBuildInfo {
packageName.set("dev.sigstore.buildinfo")
}