60 lines
2.0 KiB
Groovy
60 lines
2.0 KiB
Groovy
plugins {
|
|
id 'java-library'
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'junit:junit:4.13.2'
|
|
}
|
|
|
|
def levelsDirectory = layout.projectDirectory.dir('src/main/resources/levels')
|
|
def contentMatrixFile = layout.projectDirectory.file(
|
|
'src/main/resources/content/production-content-matrix.tsv')
|
|
def configuredLevelsDirectory = providers.gradleProperty('levelDirectory')
|
|
.map { file(it) }
|
|
.orElse(levelsDirectory.asFile)
|
|
|
|
tasks.register('validateLevels', JavaExec) {
|
|
group = 'verification'
|
|
description = 'Validates every versioned level resource before Android packaging.'
|
|
dependsOn classes
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass = 'com.projectsacrifice.game.LevelContentTool'
|
|
inputs.dir configuredLevelsDirectory
|
|
doFirst {
|
|
setArgs(['validate', configuredLevelsDirectory.get().absolutePath])
|
|
}
|
|
}
|
|
|
|
tasks.register('validateContentMatrix', JavaExec) {
|
|
group = 'verification'
|
|
description = 'Validates the four-world production plan and its authored level prefix.'
|
|
dependsOn classes
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass = 'com.projectsacrifice.game.LevelContentTool'
|
|
inputs.file contentMatrixFile
|
|
inputs.dir configuredLevelsDirectory
|
|
doFirst {
|
|
setArgs(['validate-matrix', contentMatrixFile.asFile.absolutePath,
|
|
configuredLevelsDirectory.get().absolutePath])
|
|
}
|
|
}
|
|
|
|
tasks.register('previewLevels', JavaExec) {
|
|
group = 'verification'
|
|
description = 'Exports deterministic SVG and TSV previews for every level.'
|
|
dependsOn classes
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass = 'com.projectsacrifice.game.LevelContentTool'
|
|
inputs.dir configuredLevelsDirectory
|
|
outputs.dir layout.buildDirectory.dir('level-previews')
|
|
doFirst {
|
|
setArgs(['preview', configuredLevelsDirectory.get().absolutePath,
|
|
layout.buildDirectory.dir('level-previews').get().asFile.absolutePath])
|
|
}
|
|
}
|