forked from scalar-labs/cassy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (131 loc) · 4.96 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'java-library-distribution'
apply plugin: 'application'
apply plugin: 'com.google.protobuf'
startScripts.enabled = false
repositories {
mavenCentral()
jcenter()
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}
def grpcVersion = '1.13.2'
def protobufVersion = '3.6.0'
def protocVersion = '3.6.0'
def nettyTcNativeVersion = '2.0.7.Final'
dependencies {
compile(group: 'org.apache.cassandra', name: 'cassandra-all', version: '3.11.4') {
exclude group: 'io.netty', module: 'netty-all'
}
compile group: 'com.google.guava', name: 'guava', version: '27.1-jre'
compile group: 'com.google.inject', name: 'guice', version: '4.2.2'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
compile group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.560'
compile group: 'info.picocli', name: 'picocli', version: '4.0.1'
compile group: 'com.google.api.grpc', name: 'proto-google-common-protos', version: '1.0.0'
compile group: 'com.google.api.grpc', name: 'googleapis-common-protos', version: '0.0.3'
compile group: 'io.grpc', name: 'grpc-alts', version: "${grpcVersion}"
compile group: 'io.grpc', name: 'grpc-netty', version: "${grpcVersion}"
compile group: 'io.grpc', name: 'grpc-protobuf', version: "${grpcVersion}"
compile group: 'io.grpc', name: 'grpc-stub', version: "${grpcVersion}"
compile group: 'com.google.protobuf', name: 'protobuf-java-util', version: "${protobufVersion}"
compileOnly group: 'javax.annotation', name: 'javax.annotation-api', version: '1.2'
compile group: 'io.grpc', name: 'grpc-services', version: "${grpcVersion}"
compile group: 'com.palantir.giraffe', name: 'giraffe-ssh', version: '0.10.0'
compile group: 'org.xerial', name: 'sqlite-jdbc', version: '3.27.2.1'
compile group: 'dnsjava', name: 'dnsjava', version: '2.1.9'
compile group: 'com.azure', name: 'azure-storage-blob', version: '12.1.0'
compile group: 'com.azure', name: 'azure-identity', version: '1.0.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.9.1'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.16.0'
testCompile group: 'io.grpc', name: 'grpc-testing', version: "${grpcVersion}"
}
test {
maxHeapSize "512m"
testLogging.showStandardStreams = true
}
javadoc {
options.addStringOption("notimestamp", "com.scalar.cassy")
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task testJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
task integrationTest(type: Test) {
description = 'Runs the integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false } // ensures integration tests are run every time when called
shouldRunAfter test
}
task BackupCommand(type: CreateStartScripts) {
mainClassName = 'com.scalar.cassy.command.BackupCommand'
applicationName = 'cassy-backup'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task RestoreCommand(type: CreateStartScripts) {
mainClassName = 'com.scalar.cassy.command.RestoreCommand'
applicationName = 'cassy-restore'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task Server(type: CreateStartScripts) {
mainClassName = 'com.scalar.cassy.server.CassyServer'
applicationName = 'cassy-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into('bin') {
from(BackupCommand)
from(RestoreCommand)
from(Server)
fileMode = 0755
}
// build should not depend on the integration tests
check.dependsOn -= integrationTest
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
generatedFilesBaseDir = "$projectDir/src"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8