-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
build.gradle
120 lines (102 loc) · 3.25 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
apply plugin:'base'
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://jitpack.io'
}
// required by (at least) com.jaredsburrows.license:
// https://github.com/jaredsburrows/gradle-license-plugin/issues/148
google()
}
dependencies {
classpath "com.jaredsburrows:gradle-license-plugin:0.8.90"
classpath "com.github.ben-manes:gradle-versions-plugin:0.41.0"
classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3"
classpath "org.javamodularity:moduleplugin:1.8.10"
classpath 'com.github.johni0702:gradle-reproducible-builds-plugin:a524ada411315aa9b2a58eedcaaa834015e56721'
}
}
apply plugin: "com.github.ben-manes.versions"
allprojects {
version = '2.4.1'
repositories {
jcenter()
mavenCentral()
maven { url 'https://jitpack.io' }
}
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'de.johni0702.reproducible-builds'
}
subprojects {
apply plugin: 'java'
// apply plugin: "org.javamodularity.moduleplugin"
sourceCompatibility = 17
targetCompatibility = 17
compileJava.options.encoding = 'UTF-8'
sourceSets {
main {
java {
srcDirs = ['src/main/java']
}
resources {
srcDirs = ['src/main/resources', "./../BlockMap-internal/build/generated-resources/${project.name}/generated-resources-main"]
}
}
}
def jacocoExecutionDataFiles = fileTree(buildDir).include("/jacoco/*.exec")
jacocoTestReport {
executionData.from = jacocoExecutionDataFiles
}
}
project.tasks["sonarqube"].dependsOn "jacocoRootReport"
task jacocoRootReport(type: JacocoReport) {
group 'verification'
description = 'Generates an aggregate report from all subprojects'
additionalSourceDirs.from = subprojects.sourceSets.main.allSource.srcDirs
sourceDirectories.from = subprojects.sourceSets.main.allSource.srcDirs
classDirectories.from = subprojects.sourceSets.main.output
executionData.from = subprojects.jacocoTestReport.executionData
reports {
xml.enabled = true
}
}
task regenerate(type: GradleBuild) {
group 'Generation'
description 'Regenerate all resources except screenshots'
// All other generators are called as transitive dependencies
tasks = ['BlockMap-internal:generateSources', 'BlockMap-internal:generateData']
}
task initEclipse(type: GradleBuild) {
group 'IDE'
tasks = ['regenerate', 'cleanEclipse', 'eclipse']
}
task initIdea(type: GradleBuild) {
group 'IDE'
tasks = ['regenerate', 'cleanIdea', 'idea']
}
task release(type: GradleBuild) {
group 'Distribution'
description 'Generate a fat jar to publish on GitHub (or to execute) after having run all tests'
tasks = ['build', 'previewRelease']
}
task previewRelease(type: GradleBuild) {
group 'Distribution'
description 'Generate jar files without running the tests (NOT FOR DEPLOYMENT!)'
tasks = [':BlockMap-cli:shadowJar', ':BlockMap-gui:shadowJar']
}
task copyLibs(type: Copy) {
description 'Copy all dependencies into a folder to package this application'
from project(':BlockMap-cli').configurations.runtimeClasspath, project(':BlockMap-gui').configurations.runtimeClasspath
into "$buildDir/libs"
}
clean {
delete 'screenshots'
}