|
1 | 1 | package dev.adamko.kotlin.binary_compatibility_validator
|
2 | 2 |
|
| 3 | +import dev.adamko.kotlin.binary_compatibility_validator.internal.BCVInternalApi |
| 4 | +import dev.adamko.kotlin.binary_compatibility_validator.internal.adding |
| 5 | +import dev.adamko.kotlin.binary_compatibility_validator.internal.domainObjectContainer |
3 | 6 | import dev.adamko.kotlin.binary_compatibility_validator.targets.BCVTarget
|
4 | 7 | import dev.adamko.kotlin.binary_compatibility_validator.targets.BCVTargetSpec
|
| 8 | +import javax.inject.Inject |
5 | 9 | import org.gradle.api.NamedDomainObjectContainer
|
6 | 10 | import org.gradle.api.file.DirectoryProperty
|
| 11 | +import org.gradle.api.model.ObjectFactory |
7 | 12 | import org.gradle.api.model.ReplacedBy
|
8 | 13 | import org.gradle.api.plugins.ExtensionAware
|
9 | 14 | import org.gradle.api.provider.Property
|
10 | 15 | import org.gradle.api.provider.SetProperty
|
11 | 16 |
|
12 |
| -interface BCVProjectExtension : BCVTargetSpec, ExtensionAware { |
| 17 | +abstract class BCVProjectExtension |
| 18 | +@BCVInternalApi |
| 19 | +@Inject |
| 20 | +constructor( |
| 21 | + private val objects: ObjectFactory |
| 22 | +) : BCVTargetSpec, ExtensionAware { |
13 | 23 |
|
14 | 24 | /** Sets the default [BCVTarget.enabled] value for all [targets]. */
|
15 |
| - override val enabled: Property<Boolean> |
| 25 | + abstract override val enabled: Property<Boolean> |
16 | 26 |
|
17 | 27 | /** Sets the default [BCVTarget.ignoredPackages] value for all [targets]. */
|
18 |
| - override val ignoredPackages: SetProperty<String> |
| 28 | + abstract override val ignoredPackages: SetProperty<String> |
19 | 29 |
|
20 | 30 | /** Sets the default [BCVTarget.publicMarkers] for all [targets] */
|
21 |
| - override val publicMarkers: SetProperty<String> |
| 31 | + abstract override val publicMarkers: SetProperty<String> |
22 | 32 |
|
23 | 33 | /** Sets the default [BCVTarget.publicPackages] for all [targets] */
|
24 |
| - override val publicPackages: SetProperty<String> |
| 34 | + abstract override val publicPackages: SetProperty<String> |
25 | 35 |
|
26 | 36 | /** Sets the default [BCVTarget.publicClasses] for all [targets] */
|
27 |
| - override val publicClasses: SetProperty<String> |
| 37 | + abstract override val publicClasses: SetProperty<String> |
28 | 38 |
|
29 | 39 | /** Sets the default [BCVTarget.ignoredMarkers] value for all [targets]. */
|
30 |
| - override val ignoredMarkers: SetProperty<String> |
| 40 | + abstract override val ignoredMarkers: SetProperty<String> |
31 | 41 |
|
32 | 42 | @get:ReplacedBy("ignoredMarkers")
|
33 | 43 | @Deprecated("renamed to ignoredMarkers", ReplaceWith("ignoredMarkers"))
|
34 |
| - val nonPublicMarkers: SetProperty<String> |
| 44 | + abstract val nonPublicMarkers: SetProperty<String> |
35 | 45 |
|
36 | 46 | /** Sets the default [BCVTarget.ignoredClasses] value for all [targets]. */
|
37 |
| - override val ignoredClasses: SetProperty<String> |
| 47 | + abstract override val ignoredClasses: SetProperty<String> |
38 | 48 |
|
39 | 49 | /**
|
40 | 50 | * The directory that contains the API declarations.
|
41 | 51 | *
|
42 | 52 | * Defaults to [BCVPlugin.API_DIR].
|
43 | 53 | */
|
44 |
| - val outputApiDir: DirectoryProperty |
| 54 | + abstract val outputApiDir: DirectoryProperty |
45 | 55 |
|
46 |
| - val projectName: Property<String> |
| 56 | + abstract val projectName: Property<String> |
47 | 57 |
|
48 |
| - val kotlinxBinaryCompatibilityValidatorVersion: Property<String> |
| 58 | + abstract val kotlinxBinaryCompatibilityValidatorVersion: Property<String> |
49 | 59 |
|
50 |
| - val targets: NamedDomainObjectContainer<BCVTarget> |
| 60 | + val targets: NamedDomainObjectContainer<BCVTarget> = |
| 61 | + extensions.adding("targets") { objects.domainObjectContainer() } |
51 | 62 | }
|
0 commit comments