Skip to content

Instantly share code, notes, and snippets.

@jmfayard
Created Aug 30, 2019
Embed
What would you like to do?

i was thinking how to integrate it with the newest feature

we could have

rejectVersionContaining ("alpha","beta",...)

which would be a shorter version of

rejectVersionIf { candidate ->
  listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea").any { qualifier ->
          candidate.version.matches(Regex("(?i).*[.-]\$qualifier[.\\d-+]*"))
        }
}

which would be a shorter version of

  resolutionStrategy {
    componentSelection {
      all {

        fun isNonStable(version: String) = listOf("alpha", "beta", "rc", "cr", "m", "preview", "b", "ea").any { qualifier ->
          version.matches(Regex("(?i).*[.-]\$qualifier[.\\d-+]*"))

        }

        if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
          reject("Release candidate")
        }
      }
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment