-
Notifications
You must be signed in to change notification settings - Fork 29
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 101-implement-create-commandlet
- Loading branch information
Showing
95 changed files
with
1,503 additions
and
302 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
1 change: 0 additions & 1 deletion
1
cli/src/main/java/com/devonfw/tools/ide/commandlet/CompleteCommandlet.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
50 changes: 50 additions & 0 deletions
50
cli/src/main/java/com/devonfw/tools/ide/commandlet/EditionGetCommandlet.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,50 @@ | ||
package com.devonfw.tools.ide.commandlet; | ||
|
||
import com.devonfw.tools.ide.context.IdeContext; | ||
import com.devonfw.tools.ide.property.ToolProperty; | ||
import com.devonfw.tools.ide.tool.ToolCommandlet; | ||
import com.devonfw.tools.ide.version.VersionIdentifier; | ||
|
||
/** | ||
* An internal {@link Commandlet} to get the installed edition for a tool. | ||
* | ||
* @see ToolCommandlet#getInstalledEdition() | ||
*/ | ||
public class EditionGetCommandlet extends Commandlet { | ||
|
||
/** The tool to get the edition of. */ | ||
public final ToolProperty tool; | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param context the {@link IdeContext}. | ||
*/ | ||
public EditionGetCommandlet(IdeContext context) { | ||
|
||
super(context); | ||
addKeyword(getName()); | ||
this.tool = add(new ToolProperty("", true, "tool")); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
|
||
return "get-edition"; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
|
||
ToolCommandlet commandlet = this.tool.getValue(); | ||
VersionIdentifier installedVersion = commandlet.getInstalledVersion(); | ||
if (installedVersion == null) { | ||
this.context.info("The configured edition for tool {} is {}", commandlet.getName(), commandlet.getEdition()); | ||
this.context.info("To install that edition call the following command:"); | ||
this.context.info("ide install {}", commandlet.getName()); | ||
return; | ||
} | ||
String installedEdition = commandlet.getInstalledEdition(); | ||
this.context.info(installedEdition); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
cli/src/main/java/com/devonfw/tools/ide/commandlet/EditionListCommandlet.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,42 @@ | ||
package com.devonfw.tools.ide.commandlet; | ||
|
||
import com.devonfw.tools.ide.context.IdeContext; | ||
import com.devonfw.tools.ide.property.ToolProperty; | ||
import com.devonfw.tools.ide.tool.ToolCommandlet; | ||
|
||
/** | ||
* An internal {@link Commandlet} to list editions for a tool. | ||
* | ||
* @see ToolCommandlet#listEditions() | ||
*/ | ||
public class EditionListCommandlet extends Commandlet { | ||
|
||
/** The tool to list the editions of. */ | ||
public final ToolProperty tool; | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param context the {@link IdeContext}. | ||
*/ | ||
public EditionListCommandlet(IdeContext context) { | ||
|
||
super(context); | ||
addKeyword(getName()); | ||
this.tool = add(new ToolProperty("", true, "tool")); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
|
||
return "list-editions"; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
|
||
ToolCommandlet commandlet = this.tool.getValue(); | ||
commandlet.listEditions(); | ||
} | ||
|
||
} |
47 changes: 47 additions & 0 deletions
47
cli/src/main/java/com/devonfw/tools/ide/commandlet/EditionSetCommandlet.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,47 @@ | ||
package com.devonfw.tools.ide.commandlet; | ||
|
||
import com.devonfw.tools.ide.context.IdeContext; | ||
import com.devonfw.tools.ide.property.EditionProperty; | ||
import com.devonfw.tools.ide.property.ToolProperty; | ||
import com.devonfw.tools.ide.tool.ToolCommandlet; | ||
|
||
/** | ||
* An internal {@link Commandlet} to set a tool edition. | ||
*/ | ||
public class EditionSetCommandlet extends Commandlet { | ||
|
||
/** The tool to set the edition of. */ | ||
public final ToolProperty tool; | ||
|
||
/** The edition to set. */ | ||
public final EditionProperty edition; | ||
|
||
/** | ||
* The constructor. | ||
* | ||
* @param context the {@link IdeContext}. | ||
*/ | ||
public EditionSetCommandlet(IdeContext context) { | ||
|
||
super(context); | ||
addKeyword(getName()); | ||
this.tool = add(new ToolProperty("", true, "tool")); | ||
this.edition = add(new EditionProperty("", true, "edition")); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
|
||
return "set-edition"; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
|
||
ToolCommandlet commandlet = this.tool.getValue(); | ||
String edition = this.edition.getValue(); | ||
|
||
commandlet.setEdition(edition); | ||
} | ||
|
||
} |
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
5 changes: 0 additions & 5 deletions
5
cli/src/main/java/com/devonfw/tools/ide/commandlet/VersionSetCommandlet.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
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
24 changes: 3 additions & 21 deletions
24
cli/src/main/java/com/devonfw/tools/ide/completion/IdeCompleter.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
Oops, something went wrong.