-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/223-dynamic-wiremock-ports
# Conflicts: # cli/src/test/java/com/devonfw/tools/ide/tool/python/PythonUrlUpdaterTest.java # cli/src/test/resources/integrationtest/PythonJsonUrlUpdater/python-version.json
- Loading branch information
Showing
56 changed files
with
1,234 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
cli/src/main/java/com/devonfw/tools/ide/common/JsonVersionItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.devonfw.tools.ide.common; | ||
|
||
/** | ||
* Interface for a data object that can be read from and written to JSON. | ||
*/ | ||
public interface JsonVersionItem { | ||
|
||
String version(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
cli/src/main/java/com/devonfw/tools/ide/environment/EnvironmentVariablesFiles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.devonfw.tools.ide.environment; | ||
|
||
/** | ||
* The subset of {@link EnvironmentVariables} types to be used for settings files. | ||
* | ||
* @see EnvironmentVariables#getType() | ||
*/ | ||
public enum EnvironmentVariablesFiles { | ||
/** | ||
* Type of {@link EnvironmentVariables} from the {@link com.devonfw.tools.ide.context.IdeContext#getUserHome() users HOME directory}. | ||
*/ | ||
USER, | ||
|
||
/** | ||
* Type of {@link EnvironmentVariables} from the {@link com.devonfw.tools.ide.context.IdeContext#getSettingsPath() settings directory}. | ||
*/ | ||
SETTINGS, | ||
|
||
/** | ||
* Type of {@link EnvironmentVariables} from the {@link com.devonfw.tools.ide.context.IdeContext#getWorkspacePath() workspace directory}. | ||
*/ | ||
WORKSPACE, | ||
|
||
/** | ||
* Type of {@link EnvironmentVariables} from the {@link com.devonfw.tools.ide.context.IdeContext#getConfPath() conf directory}. Allows the user to override or | ||
* customize project specific variables. | ||
*/ | ||
CONF; | ||
|
||
private EnvironmentVariablesType type; | ||
|
||
static { | ||
USER.type = EnvironmentVariablesType.USER; | ||
SETTINGS.type = EnvironmentVariablesType.SETTINGS; | ||
WORKSPACE.type = EnvironmentVariablesType.WORKSPACE; | ||
CONF.type = EnvironmentVariablesType.CONF; | ||
} | ||
|
||
/** | ||
* @return the corresponding {@link EnvironmentVariablesType} | ||
*/ | ||
public EnvironmentVariablesType toType() { | ||
return type; | ||
} | ||
|
||
} |
42 changes: 5 additions & 37 deletions
42
cli/src/main/java/com/devonfw/tools/ide/github/GithubTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,16 @@ | ||
package com.devonfw.tools.ide.github; | ||
|
||
import com.devonfw.tools.ide.common.JsonVersionItem; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* JSON data object for a github tag ref. | ||
*/ | ||
public class GithubTag { | ||
public record GithubTag(@JsonProperty("ref") String ref) implements JsonVersionItem { | ||
|
||
private String ref; | ||
@Override | ||
public String version() { | ||
|
||
/** | ||
* The constructor. | ||
*/ | ||
public GithubTag() { | ||
|
||
super(); | ||
} | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param ref the {@link #getRef() ref}. | ||
*/ | ||
public GithubTag(String ref) { | ||
|
||
super(); | ||
this.ref = ref; | ||
} | ||
|
||
/** | ||
* @return the tag reference (e.g. "refs/tags/v1.0"). | ||
*/ | ||
@JsonProperty("ref") | ||
public String getRef() { | ||
|
||
return this.ref; | ||
} | ||
|
||
/** | ||
* @param ref the new value of {@link #getRef()}. | ||
*/ | ||
@JsonProperty("ref") | ||
public void setRef(String ref) { | ||
|
||
this.ref = ref; | ||
return ref().replace("refs/tags/", ""); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
cli/src/main/java/com/devonfw/tools/ide/npm/NpmJsonDist.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.devonfw.tools.ide.npm; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* JSON data object for a version of Npm. We map only properties that we are interested in and let jackson ignore all others. | ||
* | ||
* @see NpmJsonObject#versions() | ||
*/ | ||
public record NpmJsonDist(@JsonProperty("tarball") String tarball) { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
cli/src/main/java/com/devonfw/tools/ide/npm/NpmJsonObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.devonfw.tools.ide.npm; | ||
|
||
import com.devonfw.tools.ide.common.JsonObject; | ||
|
||
/** | ||
* {@link JsonObject} for Npm. | ||
*/ | ||
public record NpmJsonObject(NpmJsonVersions versions) implements JsonObject { | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
cli/src/main/java/com/devonfw/tools/ide/npm/NpmJsonVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.devonfw.tools.ide.npm; | ||
|
||
import com.devonfw.tools.ide.common.JsonVersionItem; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* JSON data object for a version of Npm. We map only properties that we are interested in and let jackson ignore all others. | ||
* | ||
* @see NpmJsonObject#versions() | ||
*/ | ||
public record NpmJsonVersion(@JsonProperty("version") String version, @JsonProperty("dist") NpmJsonDist dist) implements JsonVersionItem { | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
cli/src/main/java/com/devonfw/tools/ide/npm/NpmJsonVersions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.devonfw.tools.ide.npm; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import com.devonfw.tools.ide.common.JsonObject; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
|
||
/** | ||
* {@link JsonObject} for {@link NpmJsonVersion}. | ||
*/ | ||
public class NpmJsonVersions { | ||
|
||
private Map<String, NpmJsonVersion> versions; | ||
|
||
@JsonAnySetter | ||
public void setDetails(String key, NpmJsonVersion val) { | ||
|
||
if (this.versions == null) { | ||
this.versions = new HashMap<>(); | ||
} | ||
this.versions.put(key, val); | ||
} | ||
|
||
/** | ||
* @return the {@link Map} of {@link NpmJsonVersion}s. | ||
*/ | ||
public Map<String, NpmJsonVersion> getVersionMap() { | ||
|
||
return this.versions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.