Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Release with new features and bugfixes:
* https://github.com/devonfw/IDEasy/issues/797[#797]: Use system unzip on macOS to preserve symlinks in ZIP extraction
* https://github.com/devonfw/IDEasy/issues/1723[#1723]: Add commandlet for GitHub Copilot CLI
* https://github.com/devonfw/IDEasy/issues/1685[#1685]: Add Nest CLI to IDEasy commandlets
* https://github.com/devonfw/IDEasy/issues/1882[#1882]: Add AWS CDK to IDEasy commandlets

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.devonfw.tools.ide.tool.androidstudio.AndroidStudio;
import com.devonfw.tools.ide.tool.aws.Aws;
import com.devonfw.tools.ide.tool.az.Azure;
import com.devonfw.tools.ide.tool.cdk.Cdk;
import com.devonfw.tools.ide.tool.copilot.Copilot;
import com.devonfw.tools.ide.tool.corepack.Corepack;
import com.devonfw.tools.ide.tool.docker.Docker;
Expand Down Expand Up @@ -156,6 +157,7 @@ public CommandletManagerImpl(IdeContext context) {
add(new Gui(context));
add(new SquirrelSql(context));
add(new Nest(context));
add(new Cdk(context));
}

/**
Expand Down
30 changes: 30 additions & 0 deletions cli/src/main/java/com/devonfw/tools/ide/tool/cdk/Cdk.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.devonfw.tools.ide.tool.cdk;

import java.util.Set;

import com.devonfw.tools.ide.common.Tag;
import com.devonfw.tools.ide.context.IdeContext;
import com.devonfw.tools.ide.tool.ToolCommandlet;
import com.devonfw.tools.ide.tool.npm.NpmBasedCommandlet;

/**
* {@link ToolCommandlet} for <a href="https://docs.aws.amazon.com/cdk/v2/guide/home.html">AWS CDK</a>.
*/
public class Cdk extends NpmBasedCommandlet {

/**
* The constructor.
*
* @param context the {@link IdeContext}.
*/
public Cdk(IdeContext context) {

super(context, "cdk", Set.of(Tag.TYPE_SCRIPT, Tag.BUILD));
}

@Override
public String getPackageName() {

return "aws-cdk";
}
}
2 changes: 2 additions & 0 deletions cli/src/main/resources/nls/Help.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cmd.az.detail=The Azure Command-Line Interface (CLI) is a tool for creating and
cmd.build=Runs a build job with given arguments.
cmd.build.detail=The `build` commandlet is an abstraction of build systems like https://maven.apache.org/, https://gradle.org/, https://yarnpkg.com/, https://www.npmjs.com/, etc.\nIt will auto-detect your build-system (via existence of files like `pom.xml`, `package.json`, etc.). According to this detection, it will simply delegate to the according commandlet of the specific build system. If that build-system is not yet available it will be downloaded and installed automatically.\nSo `ide build` allows users to build any project without bothering about the build-system. Further specific build options can be configured per project. This makes `ide build` a universal part of every _definition of done_. Before pushing your changes, please always run the following command to verify the build:\n\n 'ide build'\n\nYou may also supply additional arguments as `ide build «args»`. This will simply delegate these arguments to the detected build command (e.g. call `mvn «args»`).
cmd.build.val.args=Build arguments to be used when running a build job.
cmd.cdk=Tool commandlet for AWS CDK.
cmd.cdk.detail=The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. Detailed documentation can be found at https://docs.aws.amazon.com/cdk/v2/guide/home.html
cmd.complete=Internal commandlet for bash auto-completion.
cmd.complete.detail=Run 'ide complete <args>' to activate the non-interactive autocompletion, replace <args> with the arguments you want to autocomplete.\nE.g. type: 'ide complete in' to get 'install' and 'intellij' suggestions.
cmd.copilot=Tool commandlet for GitHub Copilot CLI.
Expand Down
2 changes: 2 additions & 0 deletions cli/src/main/resources/nls/Help_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cmd.az.detail=Das Azure Command-Line Interface (CLI) ist ein Werkzeug zur Erstel
cmd.build=Startet einen build Prozess mit übergebenen Argumenten.
cmd.build.detail=Der `build`-Befehl ist eine Abstraktion von Build-Systemen wie https://maven.apache.org/, https://gradle.org/, https://yarnpkg.com/, https://www.npmjs.com/ usw.\nEr erkennt automatisch Ihr Build-System (anhand von Dateien wie `pom.xml`, `package.json` usw.). Entsprechend dieser Erkennung delegiert er einfach an den entsprechenden Befehl des spezifischen Build-Systems. Wenn dieses Build-System noch nicht verfügbar ist, wird es automatisch heruntergeladen und installiert.\nSo ermöglicht `ide build` Benutzern, jedes Projekt zu erstellen, ohne sich um das Build-System kümmern zu müssen. Weitere spezifische Build-Optionen können pro Projekt konfiguriert werden. Dies macht `ide build` zu einem universellen Bestandteil jeder _Definition of Done_. Bevor Sie Ihre Änderungen übertragen, führen Sie bitte immer den folgenden Befehl aus, um den Build zu überprüfen:\n\n`ide build`\n\nSie können auch zusätzliche Argumente wie `ide build «args»` angeben. Diese werden einfach an den erkannten Build-Befehl weitergeleitet (z. B. Aufruf von `mvn «args»`).
cmd.build.val.args=Argumente die bei dem build Prozess genutzt werden sollen.
cmd.cdk=Werkzeug Kommando für AWS CDK.
cmd.cdk.detail=Das AWS Cloud Development Kit (AWS CDK) ist ein Open-Source-Softwareentwicklungsframework zur Modellierung und Bereitstellung von Cloud-Anwendungen mithilfe von bekannten Programmiersprachen. Detaillierte Dokumentation ist zu finden unter https://docs.aws.amazon.com/cdk/v2/guide/home.html
cmd.complete=Internes Werkzeug für bash Autovervollständigung.
cmd.complete.detail=Geben Sie 'ide complete <ausdruck>' in die Konsole ein um die einfache Autovervollständigung zu aktivieren, ersetzen Sie <ausdruck> mit dem Ausdruck, der automatisch vervollständigt werden soll.\nZ.B. geben Sie einfach 'ide complete in' in die Konsole ein um 'install' und 'intellij' als Vorschläge zu erhalten.
cmd.copilot=Werkzeug Kommando für GitHub Copilot CLI.
Expand Down
13 changes: 13 additions & 0 deletions cli/src/test/integration-tests/install-cdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
echo "Running install cdk integration test"
ide -d install cdk

cdk_location=""

if doIsWindows
then
cdk_location=""
else
cdk_location="bin/"
fi

assertThat "${IDE_ROOT}/${TEST_PROJECT_NAME}/software/node/${cdk_location}cdk" exists
91 changes: 91 additions & 0 deletions cli/src/test/java/com/devonfw/tools/ide/tool/cdk/CdkTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package com.devonfw.tools.ide.tool.cdk;

import org.junit.jupiter.api.Test;

import com.devonfw.tools.ide.context.AbstractIdeContextTest;
import com.devonfw.tools.ide.context.IdeTestContext;
import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
import com.github.tomakehurst.wiremock.junit5.WireMockTest;

/**
* Test of {@link Cdk}.
*/
@WireMockTest
class CdkTest extends AbstractIdeContextTest {

private static final String PROJECT_CDK = "cdk";

/**
* Tests if the {@link Cdk} install works correctly.
*
* @param wireMockRuntimeInfo wireMock server on a random port
*/
@Test
void testCdkInstall(WireMockRuntimeInfo wireMockRuntimeInfo) {

// arrange
IdeTestContext context = newContext(PROJECT_CDK, wireMockRuntimeInfo);
Cdk commandlet = new Cdk(context);

// act
commandlet.install();

// assert
checkInstallation(context);

}

/**
* Tests if the {@link Cdk} install works correctly.
*
* @param wireMockRuntimeInfo wireMock server on a random port
*/
@Test
void testCdkUninstall(WireMockRuntimeInfo wireMockRuntimeInfo) {

// arrange
IdeTestContext context = newContext(PROJECT_CDK, wireMockRuntimeInfo);
Cdk commandlet = new Cdk(context);

// act I
commandlet.install();

// assert I
checkInstallation(context);

// act II
commandlet.uninstall();

// assert II
assertThat(context).logAtInfo().hasMessageContaining("npm uninstall -g aws-cdk");

assertThat(context).logAtSuccess().hasMessage("Successfully uninstalled cdk");
}

/**
* Tests if {@link Cdk} run works correctly.
*
* @param wireMockRuntimeInfo wireMock server on a random port
*/
@Test
void testCdkRun(WireMockRuntimeInfo wireMockRuntimeInfo) {

// arrange
IdeTestContext context = newContext(PROJECT_CDK, wireMockRuntimeInfo);
Cdk commandlet = new Cdk(context);
commandlet.arguments.setValue("--version");

// act
commandlet.run();

// assert
assertThat(context).logAtInfo().hasMessageContaining("cdk --version");
}

private void checkInstallation(IdeTestContext context) {

assertThat(context).logAtInfo().hasMessageContaining("npm install -gf aws-cdk@2.1120.0");

assertThat(context).logAtSuccess().hasMessageContaining("Successfully installed cdk in version 2.1120.0");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
${testbaseurl}/download/node/node/v18.19.1/node-v18.19.1.tgz
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"[9.0, 10.0)": [
{
"tool": "node",
"versionRange": "[18.0.0,)"
}
]
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_VERSION=v18.19.1
NPM_VERSION=9.9.2
CDK_VERSION=2.1120.0
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "cdk $*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "$1" == "--version" ]; then
echo "9.9.2"
exit
fi
echo "npm $*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
echo "npx $*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"versions": {
"2.1120.0": {
"version": "2.1120.0",
"dist": {
"tarball": "${testbaseurl}/aws-cdk/-/aws-cdk-2.1120.0.tgz"
}
}
}
}
1 change: 1 addition & 0 deletions documentation/LICENSE.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The column `inclusion` indicates the way the component is included:
|https://github.com/openjdk/jfx[OpenJFX] |Optional|https://github.com/openjdk/jfx/blob/master/LICENSE[GPLv2] (with the “Classpath” Exception)
|https://squirrel-sql.sourceforge.io/[SQuirreL SQL Client]|Optional|https://github.com/squirrel-sql-client/squirrel-sql-stable-releases/blob/main/LICENSE[LGPL 2.1]
|https://docs.nestjs.com/cli/overview[NestJS CLI] |Optional|https://github.com/nestjs/nest-cli/blob/master/LICENSE[MIT License]
|https://docs.aws.amazon.com/cdk/v2/guide/home.html[AWS CDK CLI] |Optional|https://github.com/aws/aws-cdk-cli[Apache 2.0]
|===

== Apache Software License - Version 2.0
Expand Down
Loading