-
Notifications
You must be signed in to change notification settings - Fork 48
Add support for extra tool installations to run multiple versions in parallel #1410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Co-authored-by: maybeec <1427255+maybeec@users.noreply.github.com>
Co-authored-by: maybeec <1427255+maybeec@users.noreply.github.com>
Co-authored-by: maybeec <1427255+maybeec@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for installing and managing parallel “extra” versions of tools via new environment variables and extends the installation flow accordingly.
- Introduces
EXTRA_«TOOL»_{VERSION,EDITION,HOME}variables and documentation updates - Extends
EnvironmentVariablesandLocalToolCommandletwith extra-tool getters and installation logic - Adds unit and integration tests covering the new extra-tool functionality
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| documentation/variables.adoc | Added table entries for EXTRA_«TOOL»_VERSION, _EDITION, and _HOME |
| documentation/usage.adoc | Added “Working with multiple versions of the same tool” section |
| cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java | New methods for extra-tool paths, configuration, support checks, and installExtraTool logic |
| cli/src/main/java/com/devonfw/tools/ide/environment/EnvironmentVariables.java | Default getters and static mappings for extra-tool variables |
| cli/src/test/java/com/devonfw/tools/ide/tool/ExtraToolTest.java | Unit tests for extra-tool variable accessors |
| cli/src/test/java/com/devonfw/tools/ide/commandlet/ExtraToolInstallationTest.java | Integration tests for extra-tool install scenarios |
Comments suppressed due to low confidence (3)
documentation/variables.adoc:38
- [nitpick] The formatting for the
EXTRA_«TOOL»_HOMEentry uses asterisks around the code, causing inconsistent styling with other table rows. Remove the surrounding*for uniform table formatting.
|*`EXTRA_«TOOL»_HOME`*|`$IDE_HOME/software/extra/«tool»`|Path to the extra installation of «tool» (set automatically when `EXTRA_«TOOL»_VERSION` is configured).
cli/src/test/java/com/devonfw/tools/ide/commandlet/ExtraToolInstallationTest.java:175
- This test documents that extra tool installation should be skipped for unsupported tools, but it never invokes
tool.install(...)nor asserts that the extra installation path is not created. Consider adding aninstall(false)call and verifying thatgetExtraToolPath()does not exist.
// But extra tool installation should be skipped during install
cli/src/main/java/com/devonfw/tools/ide/tool/LocalToolCommandlet.java:361
- [nitpick] It might be clearer to add a dedicated
getExtraToolHomeVariable(tool)helper toEnvironmentVariablesfor consistency and to avoid constructing the variable name inline here.
String extraHomeVar = "EXTRA_" + EnvironmentVariables.getToolVariablePrefix(this.tool) + "_HOME";
| ToolInstallation extraInstallation = installTool(extraVersion, processContext, extraEdition); | ||
|
|
||
| // Create link to extra tool path | ||
| Path extraToolPath = getExtraToolPath(); |
Copilot
AI
Jul 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getExtraToolPath() can return null if softwareExtraPath is not set in the context, leading to a potential NPE here. Consider adding a null check or ensuring softwareExtraPath is always initialized.
| Path extraToolPath = getExtraToolPath(); | |
| Path extraToolPath = getExtraToolPath(); | |
| if (extraToolPath == null) { | |
| this.context.error("Failed to install extra tool: extraToolPath is not set."); | |
| return; // Exit the method to prevent further execution | |
| } |
Pull Request Test Coverage Report for Build 16299443721Details
💛 - Coveralls |
|
This PR is being closed in favor of #1605 which implements the same functionality. The changes from this PR have been taken over to the new PR, but authorship has been adjusted to comply with CLA requirements. All code and tests from this PR have been preserved in the new implementation. Thank you for your contribution! |
This PR implements support for installing multiple versions of the same tool in parallel, addressing the need for projects that require different versions of tools like Java for different components (e.g., frontend vs backend).
Key Features
Environment Variables
EXTRA_«TOOL»_VERSION: Configures the version of the extra tool to installEXTRA_«TOOL»_EDITION: Configures the edition of the extra tool (falls back to regular edition if not set)EXTRA_«TOOL»_HOME: Automatically set to point to the extra tool installationInstallation Behavior
$IDE_HOME/software/extra/«tool»ide install «tool»ifEXTRA_«TOOL»_VERSIONis configuredExample Usage
After running
ide install java, both versions will be available:$IDE_HOME/software/java(in PATH)$IDE_HOME/software/extra/java(accessible via$EXTRA_JAVA_HOME)Tool Support
Implementation Details
Core Changes
Testing
Backward Compatibility
This implementation provides a clean solution for projects needing multiple tool versions while maintaining the simplicity and reliability of the existing IDEasy installation system.
Fixes #1298.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
mobeigi.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.10/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.10/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.10 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.10/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/IDEasy/IDEasy org.codehaus.plexus.classworlds.launcher.Launcher clean test -Dtest=LocalToolCommandletTest(dns block)www.github.com/usr/lib/jvm/temurin-21-jdk-amd64/bin/java -javaagent:/home/REDACTED/.m2/repository/org/jacoco/org.jacoco.agent/0.8.13/org.jacoco.agent-0.8.13-runtime.jar=destfile=/home/REDACTED/work/IDEasy/IDEasy/cli/target/jacoco.exec -jar /home/REDACTED/work/IDEasy/IDEasy/cli/target/surefire/surefirebooter-20250715165244926_3.jar /home/REDACTED/work/IDEasy/IDEasy/cli/target/surefire 2025-07-15T16-52-44_846-jvmRun1 surefire-20250715165244926_1tmp surefire_0-20250715165244926_2tmp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.