-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (117 loc) · 3.43 KB
/
Copy pathbuild.gradle
File metadata and controls
142 lines (117 loc) · 3.43 KB
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
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
google()
maven { url 'https://central.sonatype.com/repository/maven-snapshots/' }
}
dependencies {
}
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
jacoco {
toolVersion = "0.8.10"
}
checkstyle {
toolVersion = '10.12.0' // Version compatible with Java 17
configFile = rootProject.file("${rootDir}/config/checkstyle/checkstyle.xml")
configProperties = [
'checkstyle.suppressions.file': '',
'suppressions.file': ''
]
ignoreFailures = true
}
// This allows you to "Build and run using IntelliJ IDEA", an option in IDEA's Settings.
idea {
module {
outputDir file('build/classes/java/main')
testOutputDir file('build/classes/java/test')
}
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
google()
maven { url 'https://jitpack.io' }
}
}
configure(subprojects) {
apply plugin: 'java-library'
sourceCompatibility = 17
tasks.withType(Test).configureEach {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
// Generate per-module coverage reports
jacocoTestReport {
reports {
html.required = true
xml.required = true
csv.required = false
}
}
// From [https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/](https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/)
// The article can be helpful when using assets.txt in your project.
tasks.register('generateAssetList') {
inputs.dir("${project.rootDir}/assets/")
// projectFolder/assets
File assetsFolder = new File("${project.rootDir}/assets/")
// projectFolder/assets/assets.txt
File assetsFile = new File(assetsFolder, "assets.txt")
// delete that file in case we've already created it
assetsFile.delete()
// iterate through all files inside that folder
// convert it to a relative path
// and append it to the file assets.txt
fileTree(assetsFolder).collect { assetsFolder.relativePath(it) }.sort().each {
assetsFile.append(it + "\n")
}
}
processResources.dependsOn 'generateAssetList'
compileJava {
options.incremental = true
}
}
subprojects {
version = "$projectVersion"
ext.appName = 'TheDebugThugs'
repositories {
mavenCentral()
// maven { url 'https://s01.oss.sonatype.org' }
// You may want to remove the following line if you have errors downloading dependencies.
mavenLocal()
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
// maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://central.sonatype.com/repository/maven-snapshots/' }
maven { url 'https://jitpack.io' }
}
}
// Task to create JaCoCo report across all subprojects
tasks.register('jacocoRootReport', JacocoReport) {
dependsOn(subprojects.test, subprojects.jacocoTestReport)
dependsOn(':headless:startScripts', ':lwjgl3:startScripts')
executionData.setFrom(
fileTree(project.rootDir) {
include '**/build/jacoco/*.exec'
}
)
sourceDirectories.setFrom(
files(subprojects.sourceSets.main.allSource.srcDirs)
)
classDirectories.setFrom(
files(subprojects.sourceSets.main.output)
)
reports {
html.required = true
xml.required = true
csv.required = false
}
}
eclipse.project.name = 'TheDebugThugs' + '-parent'