universal-ci-cd-scripts/build.gradle
2025-03-04 15:35:36 +03:00

49 lines
1.6 KiB
Groovy

plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
}
group project.artifact_group
version project.artifact_version
java {
withSourcesJar()
sourceCompatibility = targetCompatibility = project.java_min_version
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'https://git.tswf.io/api/packages/public-repos/maven'}
}
dependencies {
api group: "io.tswf.groovy.better-groovy", name: "better-groovy-scripting-shell", version: project.better_groovy_scripting_shell_version
api group: "io.tswf.groovy.better-groovy", name: "better-groovy-scripting-gitea", version: project.better_groovy_scripting_gitea_version
}
// Apply to all groovy source sets
tasks.withType(GroovyCompile).each {task ->
task.doFirst {
// Append compile classpath to groovy classpath to access compile classpath dependencies in compiler configuration script
it.groovyClasspath += it.classpath
// Transfers all groovyc options to compiler configuration script as system properties that can be accessed via System.getProperty("name") from the script file
for (def property : project.properties) {
if (property.key.startsWith("groovycOption")) {
task.groovyOptions.forkOptions.jvmArgs += "-D${property.key}=${property.value}" as String
}
}
}
task.groovyOptions.javaAnnotationProcessing = true
task.options.encoding = "UTF-8"
task.groovyOptions.configurationScript = file('gradle/config/groovyc-static.groovy')
}
compileJava.options.encoding = project.source_files_encoding