Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Do not include extra samples if DISABLED_EXTRA_KORGE_LIBS is enabled (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz-invideo authored Mar 18, 2022
1 parent 580e184 commit 6ebcc09
Showing 1 changed file with 26 additions and 30 deletions.
56 changes: 26 additions & 30 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ pluginManagement {
}
}

val inCI = System.getProperty("CI") == "true"
fun isPropertyTrue(name: String): Boolean =
System.getenv(name) == "true" || System.getProperty(name) == "true"

val inCI = isPropertyTrue("CI")
val includeKorlibsSamples = isPropertyTrue("INCLUDE_KORLIBS_SAMPLES")
val disabledExtraKorgeLibs = isPropertyTrue("DISABLED_EXTRA_KORGE_LIBS")

/*
for (file in rootDir.listFiles()) {
Expand Down Expand Up @@ -46,7 +51,11 @@ include(":korgw")
include(":korvi")
include(":korge")

if (System.getenv("DISABLED_EXTRA_KORGE_LIBS") != "true") {
if (!inCI) {
include(":korge-sandbox")
}

if (!disabledExtraKorgeLibs) {
include(":luak")
include(":kbox2d")
include(":korge-dragonbones")
Expand All @@ -55,37 +64,24 @@ if (System.getenv("DISABLED_EXTRA_KORGE_LIBS") != "true") {
include(":korge-box2d")
include(":korge-gradle-plugin")
include(":korge-fleks")
}

//include(":tensork")
//include(":samples:parallax-scrolling-aseprite")
//include(":samples:tiled-background")
include(":samples:fleks-ecs")

if (!inCI) {
include(":korge-sandbox")
}

/*
for (sample in (File(rootProject.projectDir, "samples").takeIf { it.isDirectory }?.listFiles() ?: arrayOf())) {
if (File(sample, "build.gradle.kts").exists() || File(sample, "build.gradle").exists()) {
include(":samples:${sample.name}")
}
}
*/
//include(":samples:parallax-scrolling-aseprite")
//include(":samples:tiled-background")
//include(":samples:fleks-ecs")

//val skipKorgeSamples = System.getenv("SKIP_KORGE_SAMPLES") == "true"
val skipKorgeSamples = true
// This is required because having tons of gradle modules is super slow
val skipKorgeSamples = !includeKorlibsSamples

if (!skipKorgeSamples && !inCI) {
fileTree(File(rootProject.projectDir, "samples")) {
include("**" + "/build.gradle.kts")
include("**" + "/build.gradle")
exclude("**" + "/build/**")
}.forEach {
val sample = moduleName(it.parentFile)
include(":$sample")
//project(":$sample").projectDir = File(relativePath(it.parent))
if (!skipKorgeSamples && !inCI) {
fileTree(File(rootProject.projectDir, "samples")) {
include("**" + "/build.gradle.kts")
include("**" + "/build.gradle")
exclude("**" + "/build/**")
}.forEach {
val sample = moduleName(it.parentFile)
include(":$sample")
//project(":$sample").projectDir = File(relativePath(it.parent))
}
}
}

Expand Down

0 comments on commit 6ebcc09

Please sign in to comment.