forked from bcgit/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
123 lines (102 loc) · 3.62 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
plugins {
// OSGI
id "biz.aQute.bnd.builder" version "7.0.0"
// Provide convenience executables for trying out the examples.
id 'application'
id 'com.google.protobuf' version '0.9.4'
// Generate IntelliJ IDEA's .idea & .iml project files
id 'idea'
}
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
// Set Java version to 1.8
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
implementation project(':core')
implementation project(':util')
implementation project(':pkix')
implementation project(':prov')
//Provided
implementation(files("../test/libs/annotations-api-6.0.53.jar"))
// implementation(files("../test/libs/protobuf-java-util-3.22.3.jar"))
implementation(files("../test/libs/guava-32.0.1-android.jar"))
implementation(files("../test/libs/grpc-stub-1.58.0.jar"))
implementation(files("../test/libs/protobuf-java-3.22.3.jar"))
implementation(files("../test/libs/grpc-api-1.58.0.jar"))
implementation(files("../test/libs/grpc-protobuf-lite-1.58.0.jar"))
implementation(files("../test/libs/failureaccess-1.0.1.jar"))
implementation(files("../test/libs/grpc-protobuf-1.58.0.jar"))
//Compile
compileOnly(files("../test/libs/grpc-services-1.58.0.jar"))
//Runtime
runtimeOnly(files("../test/libs/grpc-netty-shaded-1.58.0.jar"))
runtimeOnly(files("../test/libs/grpc-core-1.58.0.jar"))
runtimeOnly(files("../test/libs/perfmark-api-0.26.0.jar"))
//Download jars online
// implementation "io.grpc:grpc-protobuf:${grpcVersion}"
// implementation "io.grpc:grpc-services:${grpcVersion}"
// implementation "io.grpc:grpc-stub:${grpcVersion}"
// compileOnly "org.apache.tomcat:annotations-api:6.0.53"
// runtimeOnly "io.grpc:grpc-netty-shaded:${grpcVersion}"
// implementation "com.google.protobuf:protobuf-java-util:${protocVersion}"
}
def grpcVersion = '1.58.0' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
checkstyleMain {
source = fileTree('src/main/java')
}
compileJava {
options.errorprone.disableWarningsInGeneratedCode = true
options.errorprone.errorproneArgs = ["-Xep:IgnoredPureGetter:OFF"]
options.errorprone.errorproneArgs.add("-XepExcludedPaths:.*/build/generated/.*")
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
jar.archiveBaseName = "bcmls-$vmrange"
sourceSets {
main {
java {
srcDirs 'build/generated/source/proto/main/grpc'
srcDirs 'build/generated/source/proto/main/java'
}
}
}
startScripts.enabled = false
// Creates start scripts for a class name and adds it to the distribution.
def createStartScripts(String mainClassName) {
String bareName = mainClassName.substring(mainClassName.lastIndexOf('.') + 1);
String taskName = bareName.uncapitalize();
def newTask = tasks.register(taskName, CreateStartScripts) {
mainClass = mainClassName
applicationName = taskName.replaceAll('([A-Z])') { '-' + it[0].uncapitalize() }
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
// classpath = startScripts.classpath
}
application {
applicationDistribution.into('bin') {
from(newTask)
fileMode = 0755
}
}
}
extractIncludeProto {
dependsOn(":prov:jar",":util:jar")
}
extractIncludeTestProto {
dependsOn(":prov:jar",":util:jar")
}
createStartScripts('org.bouncycastle.mls.client.impl.MLSClient')