Skip to content

Commit 5cf584b

Browse files
committed
rather copy the resources that need to be duplicated into a directory in the build directory than to duplicate them in the repo
1 parent 34b4e0e commit 5cf584b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+30
-2037
lines changed

app/build.gradle.kts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ android {
297297
}
298298
}
299299

300+
// we need to copy some resources from composeResources to android resources, see task
301+
// copySharedResToAndroid. This can be removed when the map has been migrated to compose
302+
sourceSets {
303+
getByName("main") {
304+
res.srcDir(layout.buildDirectory.dir("generated/androidMain/res"))
305+
}
306+
}
307+
300308
buildFeatures {
301309
viewBinding = true
302310
compose = true
@@ -467,3 +475,25 @@ tasks.register("copyDefaultStringsToEnStrings") {
467475
sourceStrings.copyTo(File("$projectDir/src/androidMain/res/values/strings.xml"), true)
468476
}
469477
}
478+
479+
val copySharedResToAndroid by tasks.registering(Copy::class) {
480+
val target = "build/generated/androidMain/res/drawable"
481+
from("src/commonMain/composeResources/drawable")
482+
into(target)
483+
include {
484+
it.name.startsWith("building_") ||
485+
it.name == "sport_volleyball.xml" ||
486+
it.name == "religion_christian.xml" ||
487+
it.name == "religion_jewish.xml" ||
488+
it.name == "religion_muslim.xml"
489+
}
490+
doFirst {
491+
File(target).mkdirs()
492+
}
493+
}
494+
495+
project.afterEvaluate {
496+
tasks.named("preBuild") {
497+
dependsOn(copySharedResToAndroid)
498+
}
499+
}

app/src/androidMain/res/drawable/building_abandoned.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_allotment_house.xml

Lines changed: 0 additions & 68 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_apartments.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_barn.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_boathouse.xml

Lines changed: 0 additions & 47 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_bridge.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_bungalow.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_bunker.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/src/androidMain/res/drawable/building_carport.xml

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)