Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE

Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/1726[#1726]: Gradle updates not found by GradleUrlUpdater
* https://github.com/devonfw/IDEasy/issues/1351[#1729]: Jline update fix. Installed version of Jline: 3.30.6 ProgressBar version changed to 0.10.2 Dependencies jline-terminal and jline-native were added explicitly.
* https://github.com/devonfw/IDEasy/issues/1351[#1729]: Update Jline to 3.30.6 and ProgressBar to 0.10.2
* https://github.com/devonfw/IDEasy/issues/1735[#1735]: Add repositories symlink feature for advanced AI usage
* https://github.com/devonfw/IDEasy/issues/1713[#1713]: Advanced logging and writing logfiles
Expand Down
16 changes: 16 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/github/GithubRelease.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.devonfw.tools.ide.github;

import com.devonfw.tools.ide.json.JsonVersionItem;

/**
* JSON data object for a github release.
*
* @param name the official name of the release as its version.
*/
public record GithubRelease(String name) implements JsonVersionItem {

@Override
public String version() {
return name();
}
}
12 changes: 12 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/github/GithubReleases.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.devonfw.tools.ide.github;

import java.util.ArrayList;

import com.devonfw.tools.ide.json.JsonObject;

/**
* {@link JsonObject} for {@link GithubRelease}s.
*/
public class GithubReleases extends ArrayList<GithubRelease> implements JsonObject {

}
5 changes: 3 additions & 2 deletions cli/src/main/java/com/devonfw/tools/ide/github/GithubTag.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.devonfw.tools.ide.github;

import com.devonfw.tools.ide.json.JsonVersionItem;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* JSON data object for a github tag ref.
*
* @param ref the full tag reference, from which the version is extracted.
*/
public record GithubTag(@JsonProperty("ref") String ref) implements JsonVersionItem {
public record GithubTag(String ref) implements JsonVersionItem {

@Override
public String version() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.devonfw.tools.ide.github;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
* Test of {@link GithubRelease}.
*/
class GithubReleaseTest extends Assertions {

/**
* Test that the ref and version are correctly extracted from a typical release ref string.
*/
@Test
void testRefAndVersion() {
// arrange
GithubRelease release = new GithubRelease("1.2.3 RC1");

// assert
assertThat(release.name()).isEqualTo("1.2.3 RC1");
assertThat(release.version()).isEqualTo("1.2.3 RC1");
}

/**
* Test that the version is returned as-is when the ref does not have a prefix.
*/
@Test
void testVersionWithNoPrefix() {
// arrange
GithubRelease release = new GithubRelease("2.0.0");

// assert
assertThat(release.version()).isEqualTo("2.0.0");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.devonfw.tools.ide.github;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
* Test of {@link GithubReleases}.
*/
class GithubReleasesTest extends Assertions {

/**
* Test adding and retrieving releases from the GithubReleases collection.
*/
@Test
void testAddAndRetrieveReleases() {
// arrange
GithubReleases releases = new GithubReleases();
GithubRelease release1 = new GithubRelease("1.0.0");
GithubRelease release2 = new GithubRelease("2.0.0");

// act
releases.add(release1);
releases.add(release2);

// assert
assertThat(releases).hasSize(2);
assertThat(releases.get(0).version()).isEqualTo("1.0.0");
assertThat(releases.get(1).version()).isEqualTo("2.0.0");
}

/**
* Test that a new GithubReleases collection is empty.
*/
@Test
void testEmptyReleases() {
// arrange
GithubReleases releases = new GithubReleases();

// assert
assertThat(releases).isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ class GithubTagTest extends Assertions {
*/
@Test
void testRefAndVersion() {
// arrange
GithubTag tag = new GithubTag("refs/tags/v1.2.3");

// assert
assertThat(tag.ref()).isEqualTo("refs/tags/v1.2.3");
assertThat(tag.version()).isEqualTo("v1.2.3");
}
Expand All @@ -23,7 +26,10 @@ void testRefAndVersion() {
*/
@Test
void testVersionWithNoPrefix() {
// arrange
GithubTag tag = new GithubTag("v2.0.0");

// assert
assertThat(tag.version()).isEqualTo("v2.0.0");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ class GithubTagsTest extends Assertions {
*/
@Test
void testAddAndRetrieveTags() {
// arrange
GithubTags tags = new GithubTags();
GithubTag tag1 = new GithubTag("refs/tags/v1.0.0");
GithubTag tag2 = new GithubTag("refs/tags/v2.0.0");

// act
tags.add(tag1);
tags.add(tag2);

// assert
assertThat(tags).hasSize(2);
assertThat(tags.get(0).version()).isEqualTo("v1.0.0");
assertThat(tags.get(1).version()).isEqualTo("v2.0.0");
Expand All @@ -28,7 +33,10 @@ void testAddAndRetrieveTags() {
*/
@Test
void testEmptyTags() {
// arrange
GithubTags tags = new GithubTags();

// assert
assertThat(tags).isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;

/**
* {@link GithubUrlUpdater} for AWS-CLI.
* {@link GithubUrlTagUpdater} for AWS-CLI.
*/
public class AwsUrlUpdater extends GithubUrlUpdater {
public class AwsUrlUpdater extends GithubUrlTagUpdater {

@Override
public String getTool() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import com.devonfw.tools.ide.os.OperatingSystem;
import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;

/**
* {@link GithubUrlUpdater} for Azure-CLI.
* {@link GithubUrlTagUpdater} for Azure-CLI.
*/
public class AzureUrlUpdater extends GithubUrlUpdater {
public class AzureUrlUpdater extends GithubUrlTagUpdater {

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.devonfw.tools.ide.url.tool.docker;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;

/**
* {@link GithubUrlUpdater} for the docker edition Rancher-Desktop.
* {@link GithubUrlTagUpdater} for the docker edition Rancher-Desktop.
*/
public class DockerRancherDesktopUrlUpdater extends GithubUrlUpdater {
public class DockerRancherDesktopUrlUpdater extends GithubUrlTagUpdater {

@Override
public String getTool() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.devonfw.tools.ide.url.tool.dotnet;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;

/**
* {@link GithubUrlUpdater} for Microsoft .NET core.
* {@link GithubUrlTagUpdater} for Microsoft .NET core.
*/
public class DotNetUrlUpdater extends GithubUrlUpdater {
public class DotNetUrlUpdater extends GithubUrlTagUpdater {

@Override
public String getTool() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.devonfw.tools.ide.url.tool.gcloud;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;

/**
* {@link GithubUrlUpdater} for GCloud CLI.
* {@link GithubUrlTagUpdater} for GCloud CLI.
*/
public class GCloudUrlUpdater extends GithubUrlUpdater {
public class GCloudUrlUpdater extends GithubUrlTagUpdater {

private static final VersionIdentifier MIN_GCLOUD_VID = VersionIdentifier.of("299.0.0");
private static final VersionIdentifier MIN_ARM_GCLOUD_VID = VersionIdentifier.of("366.0.0");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.devonfw.tools.ide.url.tool.gcviewer;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;

/**
* {@link GithubUrlUpdater} for GCViewer.
* {@link GithubUrlTagUpdater} for GCViewer.
*/
public class GcViewerUrlUpdater extends GithubUrlUpdater {
public class GcViewerUrlUpdater extends GithubUrlTagUpdater {

@Override
public String getTool() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.devonfw.tools.ide.url.tool.gh;

import com.devonfw.tools.ide.url.model.folder.UrlVersion;
import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;
import com.devonfw.tools.ide.version.VersionIdentifier;

/**
* {@link GithubUrlUpdater} for "gh" (github CLI).
* {@link GithubUrlTagUpdater} for "gh" (github CLI).
*/
public class GhUrlUpdater extends GithubUrlUpdater {
public class GhUrlUpdater extends GithubUrlTagUpdater {

private static final VersionIdentifier MIN_MAC_ARM_VID = VersionIdentifier.of("2.23.0");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.devonfw.tools.ide.url.tool.graalvm;

import com.devonfw.tools.ide.url.updater.GithubUrlUpdater;
import com.devonfw.tools.ide.url.updater.GithubUrlTagUpdater;

/**
* Abstract {@link GithubUrlUpdater} base-class for GraalVM editions.
* Abstract {@link GithubUrlTagUpdater} base-class for GraalVM editions.
*/
public abstract class GraalVmUrlUpdater extends GithubUrlUpdater {
public abstract class GraalVmUrlUpdater extends GithubUrlTagUpdater {

@Override
public String getTool() {
Expand Down
Loading
Loading