Skip to content

Commit 195dd09

Browse files
authored
Merge branch 'devonfw:main' into feature/63-create-ide-wrapper-script
2 parents 81e248a + 9d89b23 commit 195dd09

File tree

138 files changed

+2506
-481
lines changed

Some content is hidden

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

138 files changed

+2506
-481
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
*.log
66
*.bak
77
.*
8+
!.gitignore
9+
!.ide.software.version
10+
!.devon.software.version
11+
!.ide
12+
!.anyedit.properties
13+
!.ide.properties
814
target/
915
eclipse-target/
1016
generated/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private AbstractIdeContext initContext(CliArguments arguments) {
104104
if (property instanceof FlagProperty) {
105105
((FlagProperty) property).setValue(Boolean.TRUE);
106106
} else {
107-
this.context.error("Missing value for option {}", key);
107+
System.err.println("Missing value for option " + key);
108108
}
109109
} else {
110110
property.setValueAsString(value, this.context);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.Map;
88
import java.util.Objects;
99

10-
import com.devonfw.tools.ide.completion.CompletionCandidateCollector;
1110
import com.devonfw.tools.ide.context.IdeContext;
1211
import com.devonfw.tools.ide.property.KeywordProperty;
1312
import com.devonfw.tools.ide.property.Property;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
import com.devonfw.tools.ide.property.Property;
1212
import com.devonfw.tools.ide.tool.aws.Aws;
1313
import com.devonfw.tools.ide.tool.az.Azure;
14+
import com.devonfw.tools.ide.tool.cobigen.Cobigen;
1415
import com.devonfw.tools.ide.tool.eclipse.Eclipse;
1516
import com.devonfw.tools.ide.tool.gcviewer.GcViewer;
1617
import com.devonfw.tools.ide.tool.gh.Gh;
1718
import com.devonfw.tools.ide.tool.gradle.Gradle;
1819
import com.devonfw.tools.ide.tool.helm.Helm;
1920
import com.devonfw.tools.ide.tool.java.Java;
21+
import com.devonfw.tools.ide.tool.jmc.Jmc;
2022
import com.devonfw.tools.ide.tool.kotlinc.Kotlinc;
2123
import com.devonfw.tools.ide.tool.kotlinc.KotlincNative;
2224
import com.devonfw.tools.ide.tool.mvn.Mvn;
@@ -25,7 +27,6 @@
2527
import com.devonfw.tools.ide.tool.quarkus.Quarkus;
2628
import com.devonfw.tools.ide.tool.terraform.Terraform;
2729
import com.devonfw.tools.ide.tool.vscode.Vscode;
28-
import com.devonfw.tools.ide.tool.cobigen.Cobigen;
2930

3031
/**
3132
* Implementation of {@link CommandletManager}.
@@ -60,6 +61,9 @@ public CommandletManagerImpl(IdeContext context) {
6061
add(new VersionSetCommandlet(context));
6162
add(new VersionGetCommandlet(context));
6263
add(new VersionListCommandlet(context));
64+
add(new EditionGetCommandlet(context));
65+
add(new EditionSetCommandlet(context));
66+
add(new EditionListCommandlet(context));
6367
add(new VersionCommandlet(context));
6468
add(new Gh(context));
6569
add(new Helm(context));
@@ -78,6 +82,7 @@ public CommandletManagerImpl(IdeContext context) {
7882
add(new Azure(context));
7983
add(new Aws(context));
8084
add(new Cobigen(context));
85+
add(new Jmc(context));
8186
}
8287

8388
private void add(Commandlet commandlet) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.devonfw.tools.ide.commandlet;
22

3-
import java.util.Collections;
43
import java.util.List;
54

65
import com.devonfw.tools.ide.cli.CliArguments;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.devonfw.tools.ide.commandlet;
2+
3+
import com.devonfw.tools.ide.context.IdeContext;
4+
import com.devonfw.tools.ide.property.ToolProperty;
5+
import com.devonfw.tools.ide.tool.ToolCommandlet;
6+
import com.devonfw.tools.ide.version.VersionIdentifier;
7+
8+
/**
9+
* An internal {@link Commandlet} to get the installed edition for a tool.
10+
*
11+
* @see ToolCommandlet#getInstalledEdition()
12+
*/
13+
public class EditionGetCommandlet extends Commandlet {
14+
15+
/** The tool to get the edition of. */
16+
public final ToolProperty tool;
17+
18+
/**
19+
* The constructor.
20+
*
21+
* @param context the {@link IdeContext}.
22+
*/
23+
public EditionGetCommandlet(IdeContext context) {
24+
25+
super(context);
26+
addKeyword(getName());
27+
this.tool = add(new ToolProperty("", true, "tool"));
28+
}
29+
30+
@Override
31+
public String getName() {
32+
33+
return "get-edition";
34+
}
35+
36+
@Override
37+
public void run() {
38+
39+
ToolCommandlet commandlet = this.tool.getValue();
40+
VersionIdentifier installedVersion = commandlet.getInstalledVersion();
41+
if (installedVersion == null) {
42+
this.context.info("The configured edition for tool {} is {}", commandlet.getName(), commandlet.getEdition());
43+
this.context.info("To install that edition call the following command:");
44+
this.context.info("ide install {}", commandlet.getName());
45+
return;
46+
}
47+
String installedEdition = commandlet.getInstalledEdition();
48+
this.context.info(installedEdition);
49+
}
50+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.devonfw.tools.ide.commandlet;
2+
3+
import com.devonfw.tools.ide.context.IdeContext;
4+
import com.devonfw.tools.ide.property.ToolProperty;
5+
import com.devonfw.tools.ide.tool.ToolCommandlet;
6+
7+
/**
8+
* An internal {@link Commandlet} to list editions for a tool.
9+
*
10+
* @see ToolCommandlet#listEditions()
11+
*/
12+
public class EditionListCommandlet extends Commandlet {
13+
14+
/** The tool to list the editions of. */
15+
public final ToolProperty tool;
16+
17+
/**
18+
* The constructor.
19+
*
20+
* @param context the {@link IdeContext}.
21+
*/
22+
public EditionListCommandlet(IdeContext context) {
23+
24+
super(context);
25+
addKeyword(getName());
26+
this.tool = add(new ToolProperty("", true, "tool"));
27+
}
28+
29+
@Override
30+
public String getName() {
31+
32+
return "list-editions";
33+
}
34+
35+
@Override
36+
public void run() {
37+
38+
ToolCommandlet commandlet = this.tool.getValue();
39+
commandlet.listEditions();
40+
}
41+
42+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.devonfw.tools.ide.commandlet;
2+
3+
import com.devonfw.tools.ide.context.IdeContext;
4+
import com.devonfw.tools.ide.property.EditionProperty;
5+
import com.devonfw.tools.ide.property.ToolProperty;
6+
import com.devonfw.tools.ide.tool.ToolCommandlet;
7+
8+
/**
9+
* An internal {@link Commandlet} to set a tool edition.
10+
*/
11+
public class EditionSetCommandlet extends Commandlet {
12+
13+
/** The tool to set the edition of. */
14+
public final ToolProperty tool;
15+
16+
/** The edition to set. */
17+
public final EditionProperty edition;
18+
19+
/**
20+
* The constructor.
21+
*
22+
* @param context the {@link IdeContext}.
23+
*/
24+
public EditionSetCommandlet(IdeContext context) {
25+
26+
super(context);
27+
addKeyword(getName());
28+
this.tool = add(new ToolProperty("", true, "tool"));
29+
this.edition = add(new EditionProperty("", true, "edition"));
30+
}
31+
32+
@Override
33+
public String getName() {
34+
35+
return "set-edition";
36+
}
37+
38+
@Override
39+
public void run() {
40+
41+
ToolCommandlet commandlet = this.tool.getValue();
42+
String edition = this.edition.getValue();
43+
44+
commandlet.setEdition(edition);
45+
}
46+
47+
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717

1818
import com.devonfw.tools.ide.cli.CliArgument;
1919
import com.devonfw.tools.ide.cli.CliArguments;
20-
import com.devonfw.tools.ide.cli.CliException;
2120
import com.devonfw.tools.ide.completion.IdeCompleter;
2221
import com.devonfw.tools.ide.context.AbstractIdeContext;
2322
import com.devonfw.tools.ide.context.IdeContext;
2423
import com.devonfw.tools.ide.property.BooleanProperty;
25-
import com.devonfw.tools.ide.property.FlagProperty;
2624
import com.devonfw.tools.ide.property.KeywordProperty;
2725
import com.devonfw.tools.ide.property.Property;
2826

@@ -166,8 +164,7 @@ private boolean apply(CliArgument argument, Commandlet commandlet) {
166164
}
167165
currentProperty = valueIterator.next();
168166
this.context.trace("Next value candidate is {}", currentProperty);
169-
if (currentProperty instanceof KeywordProperty) {
170-
KeywordProperty keyword = (KeywordProperty) currentProperty;
167+
if (currentProperty instanceof KeywordProperty keyword) {
171168
if (keyword.matches(arg)) {
172169
keyword.setValue(Boolean.TRUE);
173170
this.context.trace("Keyword matched");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import com.devonfw.tools.ide.version.VersionIdentifier;
99

1010
/**
11-
* An internal {@link Commandlet} to set a tool version.
11+
* An internal {@link Commandlet} to get the installed version for a tool.
1212
*
13-
* @see ToolCommandlet#setVersion(VersionIdentifier, boolean)
13+
* @see ToolCommandlet#getInstalledVersion()
1414
*/
1515
public class VersionGetCommandlet extends Commandlet {
1616

0 commit comments

Comments
 (0)