@@ -20,6 +20,7 @@ import org.gradle.api.GradleException
2020import org.gradle.api.file.DirectoryProperty
2121import org.gradle.api.file.RegularFileProperty
2222import org.gradle.api.provider.ListProperty
23+ import org.gradle.api.provider.Property
2324import org.gradle.api.tasks.Input
2425import org.gradle.api.tasks.Internal
2526import org.gradle.api.tasks.TaskAction
@@ -55,6 +56,12 @@ public abstract class StabilityCheckTask : DefaultTask() {
5556 @get:Input
5657 public abstract val ignoredClasses: ListProperty <String >
5758
59+ /* *
60+ * Project name (captured at configuration time for configuration cache compatibility).
61+ */
62+ @get:Input
63+ public abstract val projectName: Property <String >
64+
5865 init {
5966 group = " verification"
6067 description = " Check composable stability against reference file"
@@ -66,7 +73,9 @@ public abstract class StabilityCheckTask : DefaultTask() {
6673 if (inputFile == null || ! inputFile.exists()) {
6774 // If the file doesn't exist, it means the module has no composable functions
6875 // This is expected for modules like activities or utilities without composables
69- logger.lifecycle(" ℹ️ No composables found in :${project.name} , skipping stability check" )
76+ logger.lifecycle(
77+ " ℹ️ No composables found in :${projectName.get()} , skipping stability check" ,
78+ )
7079 return
7180 }
7281
@@ -75,19 +84,23 @@ public abstract class StabilityCheckTask : DefaultTask() {
7584 // Directory doesn't exist - no baseline has been created yet
7685 // This is expected for new modules or before the first stabilityDump
7786 logger.lifecycle(
78- " ℹ️ No stability baseline found for :${project.name} , skipping stability check" ,
87+ " ℹ️ No stability baseline found for :${projectName.get()} , skipping stability check" ,
88+ )
89+ logger.lifecycle(
90+ " Run './gradlew :${projectName.get()} :stabilityDump' to create the baseline" ,
7991 )
80- logger.lifecycle(" Run './gradlew :${project.name} :stabilityDump' to create the baseline" )
8192 return
8293 }
8394
84- val referenceFile = stabilityDirectory.resolve(" ${project.name } .stability" )
95+ val referenceFile = stabilityDirectory.resolve(" ${projectName.get() } .stability" )
8596 if (! referenceFile.exists()) {
8697 // Directory exists but file doesn't - unusual but handle gracefully
8798 logger.lifecycle(
88- " ℹ️ No stability baseline found for :${project.name} , skipping stability check" ,
99+ " ℹ️ No stability baseline found for :${projectName.get()} , skipping stability check" ,
100+ )
101+ logger.lifecycle(
102+ " Run './gradlew :${projectName.get()} :stabilityDump' to create the baseline" ,
89103 )
90- logger.lifecycle(" Run './gradlew :${project.name} :stabilityDump' to create the baseline" )
91104 return
92105 }
93106
0 commit comments