CatgirlIntelligenceAgency/build.gradle
Viktor Lofgren 302c53a8e7 (build) Enable reproducible builds in build.gradle
Settings for enabling reproducible builds for all subprojects were added to improve build consistency. This includes preserving file timestamps and ordering files reproducibly.

This is primarily of help for docker, since it uses hashes to determine if a file or image layer has changed.
2024-01-05 13:22:13 +01:00

81 lines
2.2 KiB
Groovy

plugins {
id 'java'
id("org.jetbrains.gradle.plugin.idea-ext") version "1.0"
id "io.freefair.lombok" version "8.3"
id "me.champeau.jmh" version "0.6.6"
}
group 'marginalia'
version 'SNAPSHOT'
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
subprojects.forEach {it ->
// Enable preview features for the entire project
it.tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['--enable-preview']
}
it.tasks.withType(JavaExec).configureEach {
jvmArgs += ['--enable-preview']
}
it.tasks.withType(Test).configureEach {
jvmArgs += ['--enable-preview']
}
// Enable reproducible builds for the entire project
it.tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'io.freefair.lombok'
dependencies {
implementation libs.lombok
testImplementation libs.lombok
annotationProcessor libs.lombok
lombok libs.lombok // prevent plugin from downgrading the version to something incompatible with '19
}
test {
maxHeapSize = "8G"
useJUnitPlatform()
}
tasks.register('fastTests', Test) {
maxHeapSize = "8G"
useJUnitPlatform {
excludeTags "slow"
}
}
}
idea {
module {
// Exclude these directories from being indexed by IntelliJ
// as they tend to bring the IDE to its knees and use up all
// Inotify spots in a hurry
excludeDirs.add(file("$projectDir/run/node-1"))
excludeDirs.add(file("$projectDir/run/node-2"))
excludeDirs.add(file("$projectDir/run/model"))
excludeDirs.add(file("$projectDir/run/dist"))
excludeDirs.add(file("$projectDir/run/db"))
excludeDirs.add(file("$projectDir/run/logs"))
excludeDirs.add(file("$projectDir/run/install"))
excludeDirs.add(file("$projectDir/run/data"))
excludeDirs.add(file("$projectDir/run/conf"))
excludeDirs.add(file("$projectDir/run/test-data"))
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}