Skip to content

Commit

Permalink
Merge pull request #17 from alpaca0984/fix-register-extension
Browse files Browse the repository at this point in the history
fix: register extension before evaluated
  • Loading branch information
gaelmarhic authored Feb 3, 2024
2 parents f3d911e + 763ca0b commit de8a13c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ class QuadrantPlugin : Plugin<Project> {
val extension = getExtension(extensionType)
val variants = block(extension)
val mainSourceSet = extension.sourceSet(MAIN_SOURCE_SET)
val quadrantExtension = registerConfigurationExtension()

gradle.projectsEvaluated {
registerTask(createGenerateActivityClassNameConstantsTask(), variants)
val task = createGenerateActivityClassNameConstantsTask(quadrantExtension)
registerTask(task, variants)
}
addTargetDirectoryToSourceSet(mainSourceSet)
}
Expand Down Expand Up @@ -68,10 +70,11 @@ class QuadrantPlugin : Plugin<Project> {
return getByType(type.java)
}

private fun Project.createGenerateActivityClassNameConstantsTask(): Task {
private fun Project.createGenerateActivityClassNameConstantsTask(
extension: QuadrantConfigurationExtension
): Task {
val taskType = GenerateActivityClassNameConstants::class.java
val taskName = taskType.simpleName.decapitalize()
val extension = registerConfigurationExtension()
return tasks.create(taskName, taskType) { task ->
val rawModuleList = retrieveRawModuleList(this)
task.apply {
Expand Down

0 comments on commit de8a13c

Please sign in to comment.