atlassian-plugin-sdk: init at 9.1.1 (#345085)

authored by Sandro and committed by GitHub 91bbd392 9f8eb445

+88
+88
pkgs/by-name/at/atlassian-plugin-sdk/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchurl, 5 + makeWrapper, 6 + jdk11, 7 + atlassian-plugin-sdk, 8 + testers, 9 + writeShellScript, 10 + common-updater-scripts, 11 + curl, 12 + jq, 13 + yq, 14 + }: 15 + 16 + let 17 + mavenGroupIdUrl = "https://packages.atlassian.com/maven/public/com/atlassian/amps"; 18 + 19 + in 20 + stdenv.mkDerivation rec { 21 + pname = "atlassian-plugin-sdk"; 22 + version = "9.1.1"; 23 + 24 + src = fetchurl { 25 + url = "${mavenGroupIdUrl}/atlassian-plugin-sdk/${version}/atlassian-plugin-sdk-${version}.tar.gz"; 26 + hash = "sha256-sEAe1eif9qXvIOu8RfZ4MWngEO5yCjU74g4Crd85J3Y="; 27 + }; 28 + 29 + nativeBuildInputs = [ makeWrapper ]; 30 + buildInputs = [ jdk11 ]; 31 + 32 + unpackPhase = "tar -xzf $src"; 33 + 34 + installPhase = '' 35 + runHook preInstall 36 + 37 + mkdir -p $out 38 + cp -r atlassian-plugin-sdk-${version}/* $out 39 + rm $out/bin/*.bat 40 + 41 + for file in "$out"/bin/*; do 42 + wrapProgram $file --set JAVA_HOME "${jdk11}" 43 + done 44 + 45 + runHook postInstall 46 + ''; 47 + 48 + passthru = { 49 + tests.version = testers.testVersion { 50 + package = atlassian-plugin-sdk; 51 + command = "atlas-version"; 52 + version = "atlassian-plugin-sdk-${version}"; 53 + }; 54 + 55 + updateScript = writeShellScript "update-atlassian-plugin-sdk" '' 56 + set -o errexit 57 + export PATH="${ 58 + lib.makeBinPath [ 59 + curl 60 + jq 61 + yq 62 + common-updater-scripts 63 + ] 64 + }:$PATH" 65 + 66 + NEW_VERSION=$(curl -s ${mavenGroupIdUrl}/atlassian-plugin-sdk/maven-metadata.xml | xq -r '.metadata.versioning.latest') 67 + 68 + if [[ "${version}" = "$NEW_VERSION" ]]; then 69 + echo "The new version same as the old version." 70 + exit 0 71 + fi 72 + 73 + DOWNLOAD_URL="${mavenGroupIdUrl}/atlassian-plugin-sdk/${version}/atlassian-plugin-sdk-$NEW_VERSION.tar.gz" 74 + NIX_HASH=$(nix hash to-sri sha256:$(nix-prefetch-url $DOWNLOAD_URL)) 75 + 76 + update-source-version "atlassian-plugin-sdk" "$NEW_VERSION" "$NIX_HASH" "$DOWNLOAD_URL" 77 + ''; 78 + }; 79 + 80 + meta = with lib; { 81 + description = "Atlassian Plugin SDK"; 82 + homepage = "https://developer.atlassian.com/server/framework/atlassian-sdk/"; 83 + license = licenses.asl20; 84 + maintainers = with maintainers; [ pathob ]; 85 + platforms = platforms.linux; 86 + mainProgram = "atlas-mvn"; 87 + }; 88 + }