diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt index 19fbfb2..da0ab1c 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretBuildScriptTask.kt @@ -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")) } diff --git a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt index 0c025c8..8c1dddd 100644 --- a/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt +++ b/sekret-gradle-plugin/src/main/java/dev/datlag/sekret/gradle/tasks/GenerateSekretTask.kt @@ -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( @@ -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))