File tree Expand file tree Collapse file tree
main/kotlin/com/github/gmazzo/buildconfig
test/kotlin/com/github/gmazzo/buildconfig Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ public abstract class BuildConfigTask : DefaultTask() {
2121 @get:OutputDirectory
2222 public abstract val outputDir: DirectoryProperty
2323
24- private var supersededBy: String? = null
25-
2624 init {
2725 onlyIf(" There are build config fields to generate" ) { task ->
2826 (task as BuildConfigTask ).specs.get()
@@ -33,8 +31,6 @@ public abstract class BuildConfigTask : DefaultTask() {
3331
3432 @TaskAction
3533 public fun generateBuildConfigFile () {
36- check(supersededBy == null ) { " This has been superseeded by $supersededBy " }
37-
3834 val dir = outputDir.get().asFile
3935 dir.deleteRecursively()
4036
@@ -61,8 +57,4 @@ public abstract class BuildConfigTask : DefaultTask() {
6157 }
6258 }
6359
64- internal fun supersededBy (other : BuildConfigClassSpec ) {
65- this .supersededBy = other.name
66- }
67-
6860}
Original file line number Diff line number Diff line change @@ -64,9 +64,11 @@ internal abstract class DefaultBuildConfigSourceSet(
6464 check(other != this ) { " A source set cannot supersede itself: '$name '" }
6565
6666 if (! isSuperseded) {
67+ val message = " '${this @DefaultBuildConfigSourceSet.name} ' was superseded by '${other.name} ' source set"
68+
6769 isSuperseded = true
68- generateTask.configure { t ->
69- t.supersededBy(other)
70+ generateTask.configure {
71+ it.doFirst { error(message) }
7072 }
7173 }
7274
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments