File tree Expand file tree Collapse file tree
core/src/main/kotlin/de/fayard/refreshVersions/core
dependencies/src/main/kotlin/de/fayard/refreshVersions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ enum class FeatureFlag(private val enabledByDefault: Boolean?) {
3636 // Instead, mark it as deprecated, like this: @Deprecated("your message here")
3737
3838 GRADLE_UPDATES (enabledByDefault = true ),
39+ OLD_TASKS (enabledByDefault = false ),
3940 LIBS (enabledByDefault = false ),
4041 NPM_IMPLICIT_RANGE (enabledByDefault = false ),
4142 VERSIONS_CATALOG (enabledByDefault = true ),
@@ -54,13 +55,13 @@ enum class FeatureFlag(private val enabledByDefault: Boolean?) {
5455 * Intended usage:
5556 * `if (GRADLE_UPDATES.isEnabled) lookupAvailableGradleVersions() else emptyList()`
5657 */
57- internal val isEnabled: Boolean
58+ @InternalRefreshVersionsApi val isEnabled: Boolean
5859 get() = when (enabledByDefault) {
5960 false -> userSettings[this ] == true
6061 true -> userSettings[this ] != false
6162 null -> false
6263 }
6364
64- internal val isNotEnabled
65+ @InternalRefreshVersionsApi internal val isNotEnabled
6566 get() = isEnabled.not ()
6667}
Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ open class RefreshVersionsPlugin : Plugin<Any> {
163163 private fun applyToProject (project : Project ) {
164164 if (project != project.rootProject) return // We want the tasks only for the root project
165165
166- project.tasks.register<RefreshVersionsDependenciesMigrationTask >(
166+ if ( FeatureFlag . OLD_TASKS .isEnabled) project.tasks.register<RefreshVersionsDependenciesMigrationTask >(
167167 name = " migrateToRefreshVersionsDependenciesConstants"
168168 ) {
169169 group = " refreshVersions"
@@ -173,7 +173,7 @@ open class RefreshVersionsPlugin : Plugin<Any> {
173173 skipConfigurationCache()
174174 }
175175
176- project.tasks.register<DefaultTask >(
176+ if ( FeatureFlag . OLD_TASKS .isEnabled) project.tasks.register<DefaultTask >(
177177 name = " refreshVersionsDependenciesMapping"
178178 ) {
179179 group = " refreshVersions"
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ plugins {
2424refreshVersions {
2525 featureFlags {
2626 enable(LIBS )
27+ enable(OLD_TASKS )
2728 disable(GRADLE_UPDATES )
2829 }
2930
You can’t perform that action at this time.
0 commit comments