-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
172 lines (143 loc) · 4.1 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.4"
}
}
// Artifact publishing and versoning
plugins {
id 'nebula.release' version '6.0.2'
id "nebula.project" version "3.4.0"
id "nebula.maven-base-publish" version "5.1.4"
id "org.sonarqube" version "2.6.2"
}
allprojects {
//Shadow for fat-jars
apply plugin: "com.github.johnrengelman.shadow"
//IDE
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
//Other
apply plugin: "maven"
apply plugin: "jacoco"
apply plugin: "signing"
//Nebula
apply plugin: 'nebula.project'
apply plugin: 'nebula.nebula-release'
apply plugin: 'nebula.maven-base-publish'
//Java version
sourceCompatibility = 1.8
targetCompatibility = 1.8
//Project properties
project.group = 'org.api4'
project.version = '0.0.1'
ext {
ossrhUsername = hasProperty('ossrhUsername') ? ossrhUsername : System.getenv("ossrhUsername")
ossrhPassword = hasProperty('ossrhPassword') ? ossrhPassword : System.getenv("ossrhPassword")
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'conf'
srcDir 'resources'
}
}
test {
java {
srcDir 'src/test/java'
srcDir 'src/example/java'
}
}
}
//Repositories
repositories {
mavenCentral()
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
}
//Dependencies for all(!) projects
dependencies {
// configuration
compile group: 'org.aeonbits.owner', name: 'owner-java8', version:'1.0.10'
// event bus
compile group: 'com.google.guava', name: 'guava', version: '27.0-jre'
//Logger
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
runtimeOnly group: 'org.slf4j', name:'slf4j-log4j12', version:'1.7.25'
//Testing
testCompile group: 'junit', name: 'junit', version: '4.12'
//testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.0-M1'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
//Always check for updates in SNAPSHOT versions, do not cache
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
exclude module: 'all'
}
//Nebula releases
nebulaRelease { addReleaseBranchPattern('/dev/') }
//Sonarqube config
sonarqube {
properties {
properties["sonar.projectKey"] = "api4.org"
properties["sonar.projectName"] = project.name
properties["sonar.projectDescription"] = project.description
properties["sonar.projectVersion"] = project.version
properties["sonar.projectBaseDir"] = project.projectDir
properties["sonar.working.directory"] = "$project.buildDir/sonar"
properties["sonar.sourceEncoding"] = project.compileJava.options.encoding
properties["sonar.java.source"] = project.sourceCompatibility
properties["sonar.java.target"] = project.targetCompatibility
properties["sonar.java.binaries"] = sourceSets.main.output.classesDir
properties["sonar.java.test.binaries"] = sourceSets.test.output.classesDir
}
}
// This task creates a jar with test classes.
task testClassesJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// Add a new configuration named testArtifacts
configurations {
testArtifacts
}
artifacts {
testArtifacts testClassesJar
archives sourcesJar, javadocJar
}
// generate JavaDoc for each project
task generateJavadoc(type: Javadoc) {
source = sourceSets.main.allJava
classpath = files(sourceSets.main.compileClasspath)
destinationDir = file("docs/javadoc")
// failOnError = true
}
signing {
sign configurations.archives
}
}
dependencies{
compile project(":common")
compile project(":algorithm")
compile project(":datastructure")
compile project(":ai-ml")
compile project(":ai-graphsearch")
}
test{
maxHeapSize = "4g"
}
publish.dependsOn shadowJar