diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2026-01-23 20:22:30 -0800 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2026-01-23 20:22:30 -0800 |
| commit | 52864cb701e59a1d847fd5586245519eb5e3b3bc (patch) | |
| tree | 1d3df85b939e2c50ebf154ab4fcac6f02ad087c2 /build.gradle | |
| download | the-abstraction-engine-v2-52864cb701e59a1d847fd5586245519eb5e3b3bc.tar.gz the-abstraction-engine-v2-52864cb701e59a1d847fd5586245519eb5e3b3bc.zip | |
Move code over
Diffstat (limited to 'build.gradle')
| -rw-r--r-- | build.gradle | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..98fe629 --- /dev/null +++ b/build.gradle @@ -0,0 +1,110 @@ +buildscript { + repositories { + mavenCentral() + gradlePluginPortal() + mavenLocal() + google() + maven { url = 'https://central.sonatype.com/repository/maven-snapshots/' } + } + dependencies { + } +} + +plugins { + id 'com.diffplug.spotless' version '6.25.0' apply false +} + +allprojects { + apply plugin: 'eclipse' + apply plugin: 'idea' + + // 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') + } + } +} + +configure(subprojects) { + apply plugin: 'java-library' + apply plugin: 'com.diffplug.spotless' + + java { + toolchain { + languageVersion = JavaLanguageVersion.of(24) + } + } + java.sourceCompatibility = 24 + + // Spotless code formatting + spotless { + java { + eclipse() + target '**/src/**/*.java' + } + } + + // Lombok configuration + dependencies { + compileOnly 'org.projectlombok:lombok:1.18.42' + compileOnly 'jakarta.annotation:jakarta.annotation-api:2.1.1' + annotationProcessor 'org.projectlombok:lombok:1.18.42' + testCompileOnly 'org.projectlombok:lombok:1.18.42' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.42' + + // JUnit 5 + Mockito testing + testImplementation platform('org.junit:junit-bom:5.14.2') + testImplementation 'org.junit.jupiter:junit-jupiter' + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + testImplementation 'org.mockito:mockito-core:5.8.0' + testImplementation 'org.mockito:mockito-junit-jupiter:5.8.0' + } + + test { + testLogging { + events 'passed', 'skipped', 'failed' + } + useJUnitPlatform() + jvmArgs '-Dnet.bytebuddy.experimental=true' + } + + // From 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 = 'The Abstraction Engine' + repositories { + mavenCentral() + // You may want to remove the following line if you have errors downloading dependencies. + mavenLocal() + maven { url = 'https://central.sonatype.com/repository/maven-snapshots/' } + maven { url = 'https://jitpack.io' } + } +} + +eclipse.project.name = 'The Abstraction Engine' + '-parent' |
