-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
131 lines (111 loc) · 3.51 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
plugins {
id 'java'
id 'eclipse'
id 'idea'
id 'application'
id 'java-library-distribution'
id 'com.google.protobuf' version '0.9.1'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.palantir.docker' version '0.25.0'
}
startScripts.enabled = false
repositories {
mavenCentral()
}
def grpcVersion = '1.66.0'
def protobufVersion = '3.24.4'
def slf4jVersion = '1.7.36'
def log4jVersion = '2.19.0'
dependencies {
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}"
implementation 'info.picocli:picocli:4.0.1'
implementation 'javax.json:javax.json-api:1.1.4'
implementation 'org.glassfish:javax.json:1.1.4'
implementation 'com.google.api.grpc:proto-google-common-protos:1.0.0'
implementation 'com.google.api.grpc:googleapis-common-protos:0.0.3'
implementation "io.grpc:grpc-alts:${grpcVersion}"
implementation "io.grpc:grpc-netty:${grpcVersion}"
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
implementation 'dnsjava:dnsjava:3.6.1'
implementation 'javax.annotation:javax.annotation-api:1.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.9.1'
testImplementation 'org.mockito:mockito-core:2.16.0'
testImplementation "io.grpc:grpc-testing:${grpcVersion}"
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protobufVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
generatedFilesBaseDir = "$projectDir/src"
}
// The processResources task needs to depend on the generateProto task because it uses the output
// of the the generateProto task
processResources {
dependsOn generateProto
}
task AdminCommand(type: CreateStartScripts) {
mainClassName = 'com.scalar.admin.AdminCommand'
applicationName = 'scalar-admin'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}
applicationDistribution.into('bin') {
from(AdminCommand)
fileMode = 0755
}
application {
mainClassName = 'com.scalar.admin.AdminCommand'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
distZip {
archiveFileName = "${project.name}.zip"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
distTar {
archiveFileName = "${project.name}.tar"
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
installDist {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
sourcesJar {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
docker {
name "${project.name}"
files tasks.distTar.outputs
}
shadowJar {
mergeServiceFiles()
}
java {
withJavadocJar()
withSourcesJar()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = "com.scalar-labs"
archivesBaseName = "scalar-admin"
version = "2.2.1"
// for archiving and uploading to maven central
if (!project.gradle.startParameter.taskNames.isEmpty() &&
(project.gradle.startParameter.taskNames[0].endsWith('publish') ||
project.gradle.startParameter.taskNames[0].endsWith('publishToMavenLocal'))) {
apply from: 'archive.gradle'
}