Skip to content

Commit

Permalink
lazy target resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Dec 8, 2024
1 parent 2aa0e15 commit ecc3f0c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,12 @@ open class GenerateSekretBuildScriptTask : DefaultTask() {
fun apply(project: Project, extension: SekretPluginExtension = project.sekretExtension) {
enabled.set(extension.properties.enabled)
packageName.set(extension.properties.packageName)
targets.set(project.targetsMapped)
sourceSets.set(project.sourceSets.map { it.name })
targets.set(project.provider {
project.targetsMapped
})
sourceSets.set(project.provider {
project.sourceSets.map { it.name }
})
outputDirectory.set(project.findProject("sekret")?.projectDir ?: File(project.projectDir, "sekret"))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ open class GenerateSekretTask : DefaultTask() {
Target.fromSourceSetNames(sourceSets.get())
).flatten().filterNotNull()

println("Used targets: ${allTargets.joinToString { it.name }}")
println("\n\n")

val sekretDir = ModuleGenerator.createBase(outputDir)
val requiredTargets = Target.addDependingTargets(allTargets)
BuildFileGenerator.generate(
Expand Down Expand Up @@ -124,8 +127,12 @@ open class GenerateSekretTask : DefaultTask() {
fun apply(project: Project, extension: SekretPluginExtension = project.sekretExtension) {
enabled.set(extension.properties.enabled)
packageName.set(extension.properties.packageName)
targets.set(project.targetsMapped)
sourceSets.set(project.sourceSets.map { it.name })
targets.set(project.provider {
project.targetsMapped
})
sourceSets.set(project.provider {
project.sourceSets.map { it.name }
})
encryptionKey.set(extension.properties.encryptionKey)
outputDirectory.set(project.findProject("sekret")?.projectDir ?: File(project.projectDir, "sekret"))
propertiesFile.set(propertiesFile(project, extension.properties))
Expand Down

0 comments on commit ecc3f0c

Please sign in to comment.