Use buildSrc to deduplicate build logic (#262)
This commit is contained in:
@@ -2,31 +2,31 @@ plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val preload by creating {
|
||||
this.java {
|
||||
srcDir("src/preload/kotlin")
|
||||
}
|
||||
}
|
||||
val main by getting
|
||||
}
|
||||
val preload: SourceSet by sourceSets.creating
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
val openrndrVersion =
|
||||
(findProperty("OPENRNDR.version")?.toString() ?: System.getenv("OPENRNDR_VERSION"))?.replace("v", "")
|
||||
val openrndrVersion: String =
|
||||
(extra.properties["OPENRNDR.version"] as String? ?: System.getenv("OPENRNDR_VERSION"))?.removePrefix("v")
|
||||
?: "0.5.1-SNAPSHOT"
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy.eachDependency {
|
||||
if (requested.group == "org.openrndr") useVersion(openrndrVersion)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20")
|
||||
implementation("org.jetbrains.kotlin:kotlin-serialization:1.6.20")
|
||||
val preloadImplementation by configurations.getting
|
||||
preloadImplementation("org.openrndr:openrndr-application:$openrndrVersion")
|
||||
preloadImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
|
||||
implementation(libs.kotlin.gradle.plugin)
|
||||
implementation(libs.dokka.gradle.plugin)
|
||||
implementation(libs.kotlin.serialization.gradle.plugin)
|
||||
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
|
||||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
|
||||
"preloadImplementation"(libs.openrndr.application)
|
||||
"preloadImplementation"(libs.openrndr.extensions)
|
||||
}
|
||||
|
||||
tasks.getByName("compileKotlin").dependsOn("compilePreloadKotlin")
|
||||
Reference in New Issue
Block a user