Skip to content

Commit

Permalink
Fix icons klib with empty source module (#274)
Browse files Browse the repository at this point in the history
Co-authored-by: hfhbd <hfhbd@users.noreply.github.com>
  • Loading branch information
hfhbd and hfhbd committed Sep 13, 2022
1 parent 7e78fc1 commit c8c5abe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bootstrap-compose-icons/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ kotlin {
}
tasks {
val generateSVG by registering(app.softwork.bootstrapcompose.icons.ConvertSvg::class) {
dependsOn(rootProject.tasks.getByName("kotlinNpmInstall"))
icons.set(rootProject.file("build/js/node_modules/bootstrap-icons/icons"))
outputDir.set(File(project.buildDir, "generated/icons"))
kotlin.sourceSets["main"].kotlin.srcDir(outputDir)
}
assemble {
getByName("compileKotlinJs") {
dependsOn(generateSVG)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ abstract class ConvertSvg : DefaultTask() {
icons.asFileTree.forEachIndexed { index, file ->
val name = file.nameWithoutExtension
println("$index $name")
File(outputDir, "$name.kt")
val packageFile = File(outputDir, "app/softwork/bootstrapcompose/icons")
packageFile.mkdirs()
File(packageFile, "$name.kt")
.writeText(convertSvgToComposeSvg(file.readText(), name))
}
}
Expand Down

0 comments on commit c8c5abe

Please sign in to comment.