Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Release with new features and bugfixes:
* https://github.com/devonfw/IDEasy/issues/1185[#1185]: Fix icd not working in zsh on older macOS
* https://github.com/devonfw/IDEasy/issues/1754[#1754]: Add version support to vscode plugins
* https://github.com/devonfw/IDEasy/issues/796[#796]: cannot install aws on Mac
* https://github.com/devonfw/IDEasy/issues/865[#865]: az not working on Mac
* https://github.com/devonfw/IDEasy/issues/1800[#1800]: IDEasy will automatically switch to IntelliJ standard edition when installing newer ultimate edition versions
* https://github.com/devonfw/IDEasy/issues/1552[#1552]: User-defined MAVEN_ARGS appends and no longer overwrites IDEasy's defaults
* https://github.com/devonfw/IDEasy/issues/1833[#1833]: No settings repo update with missing `.commit.id`
Expand Down
6 changes: 6 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/tool/az/Azure.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.devonfw.tools.ide.tool.LocalToolCommandlet;
import com.devonfw.tools.ide.tool.ToolCommandlet;
import com.devonfw.tools.ide.tool.ToolInstallation;
import com.devonfw.tools.ide.tool.python.Python;

/**
* {@link ToolCommandlet} for azure CLI (azure).
Expand Down Expand Up @@ -52,5 +53,10 @@ public void setEnvironment(EnvironmentContext environmentContext, ToolInstallati

super.setEnvironment(environmentContext, toolInstallation, additionalInstallation);
environmentContext.withEnvVar("AZURE_CONFIG_DIR", this.context.getConfPath().resolve(".azure").toString());
if (this.context.getSystemInfo().isMac()) {
Python python = this.context.getCommandletManager().getCommandlet(Python.class);
Path pythonBin = python.getToolBinPath().resolve("python3");
environmentContext.withEnvVar("AZ_PYTHON", pythonBin.toString());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.devonfw.tools.ide.url.tool.az;

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.os.SystemArchitecture;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;
Expand All @@ -12,6 +13,8 @@ public class AzureUrlUpdater extends GithubUrlTagUpdater {

private static final VersionIdentifier MIN_AZURE_VID = VersionIdentifier.of("2.17.0");

private static final VersionIdentifier MIN_AZURE_MAC_VID = VersionIdentifier.of("2.84.0");

@Override
public String getTool() {

Expand All @@ -23,6 +26,22 @@ protected void addVersion(UrlVersion urlVersion) {

doAddVersion(urlVersion, getDownloadBaseUrl() + "/msi/azure-cli-${version}.msi",
OperatingSystem.WINDOWS);
VersionIdentifier vid = urlVersion.getVersionIdentifier();
if (vid.compareVersion(MIN_AZURE_MAC_VID).isGreater()) {
String macBaseUrl = getMacDownloadBaseUrl() + "/" + getGithubRepositoryPath()
+ "/releases/download/azure-cli-${version}/azure-cli-${version}-macos-";
doAddVersion(urlVersion, macBaseUrl + "x86_64.tar.gz", OperatingSystem.MAC, SystemArchitecture.X64);
doAddVersion(urlVersion, macBaseUrl + "arm64.tar.gz", OperatingSystem.MAC, SystemArchitecture.ARM64);
}
}

/**
* @return base URL for the macOS tarball downloads (GitHub releases). Separate hook from {@link #getDownloadBaseUrl()}
* because Windows MSIs live on Microsoft blob storage while mac tarballs live on GitHub.
*/
protected String getMacDownloadBaseUrl() {

return GITHUB_BASE_URL;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ protected String getDownloadBaseUrl() {
return this.baseUrl;
}

@Override
protected String getMacDownloadBaseUrl() {
return this.baseUrl;
}

@Override
protected String doGetVersionUrl() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ void testAzureUrlUpdaterCreatesDownloadUrlsAndChecksums(@TempDir Path tempDir, W
stubFor(get(urlMatching("/repos/Azure/azure-cli/git/refs/tags")).willReturn(aResponse().withStatus(200)
.withBody(readAndResolve(PATH_INTEGRATION_TEST.resolve("AzureUrlUpdater").resolve("azure-cli-tags.json"), wmRuntimeInfo))));
stubFor(any(urlMatching("/msi/azure-cli-.*\\.msi")).willReturn(aResponse().withStatus(200).withBody(DOWNLOAD_CONTENT)));
stubFor(any(urlMatching("/Azure/azure-cli/releases/download/azure-cli-.*/azure-cli-.*-macos-.*\\.tar\\.gz"))
.willReturn(aResponse().withStatus(200).withBody(DOWNLOAD_CONTENT)));

UrlRepository urlRepository = UrlRepository.load(tempDir);
AzureUrlUpdaterMock updater = new AzureUrlUpdaterMock(wmRuntimeInfo);
Expand All @@ -44,5 +46,6 @@ void testAzureUrlUpdaterCreatesDownloadUrlsAndChecksums(@TempDir Path tempDir, W
Path azEditionDir = tempDir.resolve("az").resolve("az");
assertUrlVersion(azEditionDir.resolve("2.18.0"), List.of("windows_x64"));
assertUrlVersion(azEditionDir.resolve("2.20.0"), List.of("windows_x64"));
assertUrlVersion(azEditionDir.resolve("2.85.0"), List.of("windows_x64", "mac_x64", "mac_arm64"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
},
{
"ref": "refs/tags/azure-cli-2.20.0"
},
{
"ref": "refs/tags/azure-cli-2.85.0"
}
]

Loading