-
Notifications
You must be signed in to change notification settings - Fork 92
/
build.gradle
158 lines (133 loc) · 3.58 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
151
152
153
154
155
156
157
158
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'com.google.protobuf'
// Include support for S3 syncing
apply from: "gradle/s3sync.gradle"
// This build script dependencies
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
classpath 'net.researchgate:gradle-release:2.4.1'
classpath "be.insaneprogramming.gradle:animalsniffer-gradle-plugin:+"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.5'
classpath 'de.undercouch:gradle-download-task:2.1.0'
}
}
//
// Configure project properties
//
ext {
buildOnlyBackendApi = project.hasProperty("buildOnlyBackendApi")
// List of all published projects
publishedProjects = [
project(':deepwater-backend-api'),
]
}
allprojects {
ext {
// Safe-flag to be sure that we are really performing release
isRelease = rootProject.hasProperty("doRelease")
}
// Technical task to list all artifacts
apply from: "$rootDir/gradle/artifacts.gradle"
// Global repositories to fetch this project artifacts
repositories {
mavenCentral()
}
protobuf {
generatedFilesBaseDir = "$projectDir/src/"
protoc {
artifact = "com.google.protobuf:protoc:3.2.0"
}
plugins {
grpc {
artifact = 'io.grpc:protoc-gen-grpc-java:1.0.2'
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
}
//
// Apply support for releasing
//
if (isRelease) {
apply from: "$rootDir/gradle/release.gradle"
}
//
// Configure all submodules
//
subprojects {
// The projects share the same provider
group = rootProject.group
// Enable Java6 bytecode rewritting
if (project.hasProperty("doJava6Bytecode")) {
if (project.doJava6Bytecode == "true"
|| (project.doJava6Bytecode == "auto"
&& System.getProperty("user.name").equals("jenkins")
&& System.getenv("JAVA_6_HOME"))) {
apply from: "$rootDir/gradle/java6bytecode.gradle"
// Always do animal sniffing for java6
ext.doAnimalSniffer = "true"
}
}
// Publication
if (project in publishedProjects) {
// Support for artifact publication
apply from: "$rootDir/gradle/publish.gradle"
}
// This expects that all projects are Java projects
if (project.hasProperty("doAnimalSniffer") && project.doAnimalSniffer == "true") {
apply from: "$rootDir/gradle/animalSniffer.gradle"
}
plugins.withType(JavaPlugin) {
dependencies {
compile "org.slf4j:slf4j-log4j12:1.7.5"
}
}
sourceSets {
main {
resources {
srcDirs "config"
}
}
}
}
//
// Top-level project build just an assembly of all required parts
//
// Support for FatJars
apply plugin: 'com.github.johnrengelman.shadow'
// Top-level project dependencies
dependencies {
compile project(":deepwater-backend-api")
if (!buildOnlyBackendApi) {
compile project('deepwater-mxnet')
compile project('deepwater-tensorflow')
}
// Test stuff
testCompile group: 'junit', name: 'junit', version: '4.11'
}
shadowJar {
archiveName = "deepwater-all.jar"
}
// We do not need jar for this project since we are generating FatJar
jar {
enabled = false
}
artifacts {
archives shadowJar
}
// TODO: upgrade me !
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}