Unverified Commit bf2681e2 authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

gradle: configure updateScript per major version (#504920)

parents 03158cb7 773ee7e8
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ let

      # Put the update script in passthru. Should only be on a single attrpath
      # so that nixpkgs-update doesn't create duplicate PRs.
      enableUpdateScript ? false,
      updateScriptMajorVersion ? null,
    }@genArgs:

    {
@@ -305,14 +305,15 @@ let
        gradle-unwrapped = mkGradle genArgs;
      };
      passthru.updateScript =
        if enableUpdateScript then
        if updateScriptMajorVersion != null then
          nix-update-script {
            extraArgs = [
              "--url=https://github.com/gradle/gradle"
              "--use-github-releases"
              # Gradle’s .0 releases are tagged as `vX.Y.0`, but the actual
              # release version omits the `.0`, so we’ll wanto to only capture
              # the version up but not including the the trailing `.0`.
              "--version-regex=^v(\\d+\\.\\d+(?:\\.[1-9]\\d?)?)(\\.0)?$"
              "--version-regex=^v(${updateScriptMajorVersion}\\.\\d+(?:\\.[1-9]\\d?)?)(\\.0)?$"
            ];
          }
        else
@@ -367,13 +368,13 @@ rec {
    version = "9.4.0";
    hash = "sha256-YOpyM1bYEmPoAC/sD8+eKw7uDAhQx6PXqwpj8szGAfM=";
    defaultJava = jdk21;
    updateScriptMajorVersion = "9";
  };
  gradle_8 = mkGradle {
    version = "8.14.4";
    hash = "sha256-8XcSmKcPbbWina9iN4xOGKF/wzybprFDYuDN9AYQOA0=";
    defaultJava = jdk21;
    # Only enable this on *one* version to avoid duplicate PRs.
    enableUpdateScript = true;
    updateScriptMajorVersion = "8";
  };
  gradle_7 = mkGradle {
    version = "7.6.6";