Skip to content

Commit 7e2023e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feature/devonfw#103-implement-version-security-checks
# Conflicts: # cli/src/main/java/com/devonfw/tools/ide/tool/ToolCommandlet.java # cli/src/test/java/com/devonfw/tools/ide/context/AbstractIdeContextTest.java
2 parents 81b8586 + 1d60d9c commit 7e2023e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1269
-1609
lines changed

.github/workflows/build-pr.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ jobs:
1414
java-version: '17'
1515
- name: Build project with Maven
1616
run: mvn -B -ntp -Dstyle.color=always install
17+
- name: Coveralls GitHub Action
18+
uses: coverallsapp/[email protected]

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ jobs:
2323
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2424
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
2525
run: mvn --settings .mvn/settings.xml -DskipTests=true -Darchetype.test.skip=true -Dmaven.install.skip=true -Dstyle.color=always -B -ntp deploy
26+
- name: Coveralls GitHub Action
27+
uses: coverallsapp/[email protected]

README.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ image:https://img.shields.io/github/license/devonfw/IDEasy.svg?label=License["Ap
1010
image:https://img.shields.io/maven-central/v/com.devonfw.tools.ide/ide-cli.svg?label=Maven%20Central["Maven Central",link=https://search.maven.org/search?q=g:com.devonfw.tools.ide]
1111
image:https://github.com/devonfw/IDEasy/actions/workflows/build.yml/badge.svg["Build Status",link="https://github.com/devonfw/IDEasy/actions/workflows/build.yml"]
1212
image:https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml/badge.svg["Update URLS Status",link="https://github.com/devonfw/IDEasy/actions/workflows/update-urls.yml"]
13+
image:https://coveralls.io/repos/github/devonfw/IDEasy/badge.svg?branch=main["Coverage Status",link="https://coveralls.io/github/devonfw/IDEasy?branch=main"]
1314

1415
toc::[]
1516

cli/src/main/java/com/devonfw/tools/ide/cli/CliArgument.java

+33
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,37 @@ public static CliArgument of(boolean splitShortOpt, String... args) {
213213
return first;
214214
}
215215

216+
/**
217+
* @param firstArgs the first arguments.
218+
* @param nextArgs the additional arguments to append after {@code args}.
219+
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
220+
*/
221+
public static String[] append(String[] firstArgs, String... nextArgs) {
222+
223+
return join(firstArgs, false, nextArgs);
224+
}
225+
226+
/**
227+
* @param nextArgs the arguments to append after {@code firstArgs}.
228+
* @param firstArgs the first arguments.
229+
* @return a {@link String} array with the values from {@code firstArgs} followed by the values from {@code nextArgs}.
230+
*/
231+
public static String[] prepend(String[] nextArgs, String... firstArgs) {
232+
233+
return join(nextArgs, false, firstArgs);
234+
}
235+
236+
private static String[] join(String[] args, boolean prefix, String... extraArgs) {
237+
238+
String[] result = new String[args.length + extraArgs.length];
239+
int argsStart = 0;
240+
int extraArgsStart = args.length;
241+
if (prefix) {
242+
argsStart = extraArgs.length;
243+
extraArgsStart = 0;
244+
}
245+
System.arraycopy(args, 0, result, argsStart, args.length);
246+
System.arraycopy(extraArgs, 0, result, extraArgsStart, extraArgs.length);
247+
return result;
248+
}
216249
}

cli/src/main/java/com/devonfw/tools/ide/cli/Ide.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public int run(String... args) {
6363
} catch (CliException error) {
6464
exitStatus = error.getExitCode();
6565
if (context().level(IdeLogLevel.DEBUG).isEnabled()) {
66-
context().error(error.getMessage(), error);
66+
context().error(error, error.getMessage());
6767
} else {
6868
context().error(error.getMessage());
6969
}

cli/src/main/java/com/devonfw/tools/ide/commandlet/HelpCommandlet.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
public final class HelpCommandlet extends Commandlet {
2020

21-
protected static final String LOGO = """
21+
static final String LOGO = """
2222
__ ___ ___ ___
2323
╲ ╲ |_ _| ╲| __|__ _ ____ _
2424
> > | || |) | _|/ _` (_-< || |

cli/src/main/java/com/devonfw/tools/ide/configurator/Args.java

-80
This file was deleted.

0 commit comments

Comments
 (0)