Created
September 16, 2022 15:59
-
-
Save laithnurie/fa3b9493ee937c6d35de6b8118dc3ca2 to your computer and use it in GitHub Desktop.
Version catalog android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def isNonStable = { String version -> | |
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) } | |
def regex = /^[0-9,.v-]+$/ | |
return !stableKeyword && !(version ==~ regex) | |
} | |
dependencyUpdates { | |
resolutionStrategy { | |
componentSelection { | |
all { | |
if (isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)) { | |
reject('Release candidate') | |
} | |
} | |
} | |
} | |
} | |
versionCatalogUpdate { | |
// https://github.com/littlerobots/version-catalog-update-plugin | |
sortByKey = true | |
pin { | |
groups = [ | |
"org.jetbrains.kotlin", // Compose requires a specific version of kotlin, so we need to update both of them together | |
// "androidx.compose.ui", // See the first | |
] | |
versions = ["kotlin-version"] | |
} | |
keep { | |
keepUnusedVersions = true | |
// keepUnusedLibraries = true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment