Skip to content

Commit

Permalink
Merge branch 'devonfw:main' into devonfw#420-create-win-installer
Browse files Browse the repository at this point in the history
  • Loading branch information
alfeilex authored Jan 29, 2025
2 parents e1171de + 5300a96 commit bf7f5ba
Show file tree
Hide file tree
Showing 16 changed files with 113 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-Drevision=2025.01.002-beta-SNAPSHOT
-Drevision=2025.01.003-beta-SNAPSHOT
9 changes: 9 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

This file documents all notable changes to https://github.com/devonfw/IDEasy[IDEasy].

== 2025.01.002

Release with important bugfixes:

* https://github.com/devonfw/IDEasy/issues/979[#979]: XML Merger: Failed to compile XPath expression

The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/19?closed=1[milestone 2025.01.002].

== 2025.01.001

Release with new features and bugfixes:
Expand All @@ -11,6 +19,7 @@ Release with new features and bugfixes:
* https://github.com/devonfw/IDEasy/issues/916[#916]: download is missing status code error handling
* https://github.com/devonfw/IDEasy/issues/757[#757]: Support to allow settings in code repository
* https://github.com/devonfw/IDEasy/issues/826[#826]: Fix git settings check when settings folder is empty
* https://github.com/devonfw/IDEasy/issues/919[#919]: Require user to agree to license
* https://github.com/devonfw/IDEasy/issues/898[#898]: Improved output of get-version/edition and uninstall/-plugin
* https://github.com/devonfw/IDEasy/issues/894[#894]: ide.bat not printing if IDEasy was initialized
* https://github.com/devonfw/IDEasy/issues/759[#759]: Add UpgradeSettingsCommandlet for the upgrade of legacy devonfw-ide settings to IDEasy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public AbstractUpdateCommandlet(IdeContext context) {
@Override
public void run() {

updateSettings();
if (!this.context.isSettingsRepositorySymlinkOrJunction() || this.context.isForceMode()) {
updateSettings();
}
updateConf();
reloadContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ private void logSettingsGitStatus() {
if (settingsPath != null) {
GitContext gitContext = this.context.getGitContext();
if (gitContext.isRepositoryUpdateAvailable(settingsPath, this.context.getSettingsCommitIdPath())) {
this.context.warning("Your settings are not up-to-date, please run 'ide update'.");
if (!this.context.isSettingsRepositorySymlinkOrJunction()) {
this.context.warning("Your settings are not up-to-date, please run 'ide update'.");
}
} else {
this.context.success("Your settings are up-to-date.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ private Path findIdeRoot(Path ideHomePath) {
}

private Path getIdeRootPathFromEnv() {

String root = getSystem().getEnv(IdeVariables.IDE_ROOT.getName());
if (root != null) {
Path rootPath = Path.of(root);
Expand Down Expand Up @@ -280,6 +281,7 @@ private String getMessageIdeHomeNotFound() {
}

private String getMessageIdeRootNotFound() {

String root = getSystem().getEnv("IDE_ROOT");
if (root == null) {
return "The environment variable IDE_ROOT is undefined. Please reinstall IDEasy or manually repair IDE_ROOT variable.";
Expand All @@ -301,7 +303,6 @@ protected SystemPath computeSystemPath() {
return new SystemPath(this);
}


private boolean isIdeHome(Path dir) {

if (!Files.isDirectory(dir.resolve("workspaces"))) {
Expand Down Expand Up @@ -429,15 +430,24 @@ public Path getSettingsGitRepository() {
return null;
}

// check whether the settings path has a .git folder only if its not a symbolic link
if (!Files.exists(settingsPath.resolve(".git")) && !Files.isSymbolicLink(settingsPath)) {
// check whether the settings path has a .git folder only if its not a symbolic link or junction
if (!Files.exists(settingsPath.resolve(".git")) && !isSettingsRepositorySymlinkOrJunction()) {
error("Settings repository exists but is not a git repository.");
return null;
}

return settingsPath;
}

public boolean isSettingsRepositorySymlinkOrJunction() {

Path settingsPath = getSettingsPath();
if (settingsPath == null) {
return false;
}
return Files.isSymbolicLink(settingsPath) || getFileAccess().isJunction(settingsPath);
}

@Override
public Path getSettingsCommitIdPath() {

Expand Down Expand Up @@ -557,6 +567,7 @@ public boolean isOfflineMode() {

@Override
public boolean isSkipUpdatesMode() {

return this.startContext.isSkipUpdatesMode();
}

Expand All @@ -583,6 +594,7 @@ public boolean isOnline() {
}

private void configureNetworkProxy() {

if (this.networkProxy == null) {
this.networkProxy = new NetworkProxy(this);
this.networkProxy.configure();
Expand Down Expand Up @@ -873,10 +885,17 @@ private ValidationResult applyAndRun(CliArguments arguments, Commandlet cmd) {
}
Path settingsRepository = getSettingsGitRepository();
if (settingsRepository != null) {
if (getGitContext().isRepositoryUpdateAvailable(settingsRepository, getSettingsCommitIdPath()) ||
(getGitContext().fetchIfNeeded(settingsRepository) && getGitContext().isRepositoryUpdateAvailable(settingsRepository,
getSettingsCommitIdPath()))) {
interaction("Updates are available for the settings repository. If you want to apply the latest changes, call \"ide update\"");
if (getGitContext().isRepositoryUpdateAvailable(settingsRepository, getSettingsCommitIdPath()) || (
getGitContext().fetchIfNeeded(settingsRepository) && getGitContext().isRepositoryUpdateAvailable(
settingsRepository, getSettingsCommitIdPath()))) {
if (isSettingsRepositorySymlinkOrJunction()) {
interaction(
"Updates are available for the settings repository. Please pull the latest changes by yourself or by calling \"ide -f update\" to apply them.");

} else {
interaction(
"Updates are available for the settings repository. If you want to apply the latest changes, call \"ide update\"");
}
}
}
}
Expand Down Expand Up @@ -958,6 +977,7 @@ This product (with its included 3rd party components) is open-source software an
}

private void verifyIdeRoot() {

if (!isTest()) {
if (this.ideRoot == null) {
warning("Variable IDE_ROOT is undefined. Please check your installation or run setup script again.");
Expand All @@ -977,6 +997,7 @@ private void verifyIdeRoot() {
* @return the {@link List} of {@link CompletionCandidate}s to suggest.
*/
public List<CompletionCandidate> complete(CliArguments arguments, boolean includeContextOptions) {

CompletionCandidateCollector collector = new CompletionCandidateCollectorDefault(this);
if (arguments.current().isStart()) {
arguments.next();
Expand Down Expand Up @@ -1004,6 +1025,7 @@ public List<CompletionCandidate> complete(CliArguments arguments, boolean includ
}

private void completeCommandlet(CliArguments arguments, Commandlet cmd, CompletionCandidateCollector collector) {

trace("Trying to match arguments for auto-completion for commandlet {}", cmd.getName());
Iterator<Property<?>> valueIterator = cmd.getValues().iterator();
valueIterator.next(); // skip first property since this is the keyword property that already matched to find the commandlet
Expand Down Expand Up @@ -1060,7 +1082,6 @@ private void completeCommandlet(CliArguments arguments, Commandlet cmd, Completi
}
}


/**
* @param arguments the {@link CliArguments} to apply. Will be {@link CliArguments#next() consumed} as they are matched. Consider passing a
* {@link CliArguments#copy() copy} as needed.
Expand Down Expand Up @@ -1179,6 +1200,7 @@ private String findBashOnWindows() {

@Override
public WindowsPathSyntax getPathSyntax() {

return this.pathSyntax;
}

Expand All @@ -1202,6 +1224,7 @@ public IdeStartContextImpl getStartContext() {
* Reloads this context and re-initializes the {@link #getVariables() variables}.
*/
public void reload() {

this.variables = null;
this.customToolRepository = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ default Path getRepositoriesPath() {
*/
Path getSettingsGitRepository();

/**
* @return {@code true} if the settings repository is a symlink or a junction.
*/
boolean isSettingsRepositorySymlinkOrJunction();

/**
* @return the {@link Path} to the file containing the last tracked commit Id of the settings repository.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ private boolean isNeeded(Path targetRepository, IdeContext context) {
}
if (!hasGitDirectory) {
if (isRequireGitFolder()) {
context.warning("Missing .git folder in {}.", targetRepository);
if (context.getSettingsGitRepository() == null) {
context.warning("Missing .git folder in {}.", targetRepository);
}
} else {
logEnforceGitOperationBecauseGitFolderNotPresent(targetRepository, context);
}
Expand Down
6 changes: 6 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/io/FileAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,10 @@ default void makeExecutable(Path file) {
*/
String readFileContent(Path file);

/**
* @param path that is checked whether it is a junction or not.
* @return {@code true} if the given {@link Path} is a junction, false otherwise.
*/
boolean isJunction(Path path);

}
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public String checksum(Path file) {
}
}

private boolean isJunction(Path path) {
public boolean isJunction(Path path) {

if (!SystemInfoImpl.INSTANCE.isWindows()) {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"name": "com.sun.org.apache.xpath.internal.functions.FuncNormalizeSpace",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "com.sun.org.apache.xpath.internal.functions.FuncLocalPart",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
]
4 changes: 2 additions & 2 deletions cli/src/main/resources/nls/Help.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ cmd.pgadmin=Tool commandlet for pgAdmin.
cmd.pgadmin.detail=pgAdmin is an open source management tool for PostgreSQL and derivative relational databases. Detailed documentation can be found at https://www.pgadmin.org/docs/pgadmin4/latest/index.html
cmd.quarkus=Tool commandlet for Quarkus (framework for cloud-native apps).
cmd.quarkus.detail=Quarkus is a Kubernetes-native Java framework for building cloud-native applications. Detailed documentation can be found at https://quarkus.io/
cmd.repository=Setup pre-configured git repositories (clone, build, import).
cmd.repository=Set up pre-configured git repositories using 'ide repository setup <repository>'
cmd.repository.detail=Without further arguments this will set up all pre-configured git repositories.\nAlso, you can provide an explicit git repo as `<repository>` argument and IDEasy will automatically clone, build and set up your project based on the existing property file.\nRepositories are configured in 'settings/repository/<repository>.properties' and can therefore be shared with your project team for automatic or optional setup.
cmd.repository.val.repository=The name of the properties file of the pre-configured git repository to set up, omit to set up all active repositories.
cmd.set-edition=Set the edition of the selected tool.
Expand Down Expand Up @@ -132,7 +132,7 @@ toolcommandlets=Available tool commandlets:
usage=Usage:
val.args=The commandline arguments to pass to the tool.
val.cfg=Selection of the configuration file (settings | home | conf | workspace).
val.commandlet=The selected commandlet (use "ide help" to list all commandlets).
val.commandlet=The selected commandlet (use 'ide help' to list all commandlets).
val.edition=The tool edition.
val.plugin=The plugin to select
val.settingsRepository=The settings git repository with the IDEasy configuration for the project.
Expand Down
2 changes: 1 addition & 1 deletion cli/src/main/resources/nls/Help_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ cmd.pgadmin=Werkzeug Kommando für pgAdmin.
cmd.pgadmin.detail=pgAdmin ist ein Open-Source-Verwaltungswerkzeug for PostgreSQL und verwandte relationale Datenbanken. Detaillierte Dokumentation ist zu finden unter https://www.pgadmin.org/docs/pgadmin4/latest/index.html
cmd.quarkus=Werkzeug Kommando für Quarkus (Framework für Cloud-native Anwendungen).
cmd.quarkus.detail=Quarkus ist ein Kubernetes-native Java-Framework zur Entwicklung von Cloud-native Anwendungen. Detaillierte Dokumentation ist zu finden unter https://quarkus.io/
cmd.repository=Richtet das vorkonfigurierte Git Repository ein.
cmd.repository=Richtet das vorkonfigurierte Git Repository ein mittels 'ide repository setup <repository>'.
cmd.repository.detail=Dies wird alle vorkonfigurierten Repositories einrichten. Rufen Sie einfach 'ide repository setup <your_project_name>' auf, ersetzen Sie <your_project_name> durch den Namen Ihrer Projektkonfigurationsdatei, die sich in 'settings/repository/your_project_name' befindet und IDEasy wird Ihr Projekt basierend auf der vorhandenen Eigenschaftsdatei automatisch klonen, bauen und einrichten.\nWenn Sie den Projektnamen weglassen, werden alle im Repository-Verzeichnis gefundenen Projekte vorkonfiguriert.
cmd.repository.val.repository=Der Name der Properties-Datei des vorkonfigurierten Git Repositories zum Einrichten. Falls nicht angegeben, werden alle aktiven Projekte eingerichtet.
cmd.set-edition=Setzt die Edition des selektierten Werkzeugs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,16 @@ public void testIdeCompleterWithOptionAfterCommandletWorks() {
assertBuffer("env --bash ", new TestBuffer("env --ba").tab().tab());
}

/**
* Test of completion of repository.
*/
@Test
public void testIdeCompleterWithRepository() {

this.reader.setCompleter(newCompleter());
assertBuffer("repository setup ", new TestBuffer("repository ").tab().tab());
}

/**
* Test of completion of options and arguments after commandlets.
*/
Expand Down
Loading

0 comments on commit bf7f5ba

Please sign in to comment.