Skip to content

Commit 68da98d

Browse files
committed
Delay task dependsOn until after evaluate
It's possible to set up the changelog extension before the project has finished setting up lifecycle tasks such as `assemble`.
1 parent be42fb6 commit 68da98d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/groovy/net/minecraftforge/gradleutils/changelog/ChangelogUtils.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ class ChangelogUtils {
3737
project.tasks.register(GenerateChangelog.NAME, GenerateChangelog).tap { task ->
3838
project.configurations.register(GenerateChangelog.NAME) { Configuration c -> c.canBeResolved = false }
3939
project.artifacts.add(GenerateChangelog.NAME, task)
40-
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME).configure { it.dependsOn(task) }
4140
action.execute task
41+
42+
project.afterEvaluate {
43+
project.tasks.named(LifecycleBasePlugin.ASSEMBLE_TASK_NAME).configure { it.dependsOn(task) }
44+
}
4245
}
4346
}
4447

0 commit comments

Comments
 (0)