-
Notifications
You must be signed in to change notification settings - Fork 88
#989: allow expressions in template variable definitions #2282
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
base: main
Are you sure you want to change the base?
Changes from all commits
8762376
a41eace
d1945db
b315917
c01ce8c
53b84ea
39cbef5
0af5ed9
3aa99ce
cb7b7cf
3e4dedc
3b2dd8c
ca3d70b
7a74b11
07af2e2
6f4068b
87828e4
32cddc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ Release with new features and bugfixes: | |
| * https://github.com/devonfw/IDEasy/issues/2251[#2251]: Provide generic uninstall support for globally installed tools (windows) | ||
| * https://github.com/devonfw/IDEasy/issues/1135[#1135]: Fix PowerShell env variable initialization on Windows by sourcing functions from the PowerShell profile | ||
| * https://github.com/devonfw/IDEasy/issues/741[#741]: Add a warning message for legacy devonfw-ide settings users | ||
| * https://github.com/devonfw/IDEasy/issues/989[#989]: Allow expressions in template variable definitions | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, that it took too long but we need to move to the next release. |
||
| * https://github.com/devonfw/IDEasy/issues/1933[#1933]: Added a console panel to the GUI | ||
|
|
||
| The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/49?closed=1[milestone 2026.08.002]. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -280,6 +280,42 @@ default String askForInput(String message) { | |
| return askForInput(message, null); | ||
| } | ||
|
|
||
| /** | ||
| * Asks the user for a single secret input (e.g. a password or API token). Unlike {@link #askForInput(String, String)} the input is not echoed to the console | ||
| * if a secure console is available. | ||
| * | ||
| * @param message The information message to display. | ||
| * @param defaultValue The default value to return when no input is provided or {@code null} to keep asking until the user entered a non empty value. | ||
| * @return The secret input from the user, or the default value if no input is provided. | ||
| */ | ||
| String askForSecret(String message, String defaultValue); | ||
|
|
||
| /** | ||
| * Asks the user for a single secret input (e.g. a password or API token). | ||
| * | ||
| * @param message The information message to display. | ||
| * @return The secret input from the user. | ||
| */ | ||
| default String askForSecret(String message) { | ||
| return askForSecret(message, null); | ||
| } | ||
|
|
||
| /** | ||
| * Marks the variable with the given name as secret so that its value is masked in all log output, even if the value is not entered by the user but read from | ||
| * an existing {@code ide.properties}. | ||
| * | ||
| * @param name the name of the variable (e.g. "MY_API_TOKEN"). | ||
| */ | ||
| void addSecretVariable(String name); | ||
|
|
||
| /** | ||
| * Registers the value of a variable as secret if the variable was marked via {@link #addSecretVariable(String)}. Has to be called before the value is logged. | ||
| * | ||
| * @param name the name of the variable. | ||
| * @param value the value of the variable. | ||
| */ | ||
| void addSecretValue(String name, String value); | ||
|
Comment on lines
+303
to
+317
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great that you care about security of credentials. I appreciate that very much.
|
||
|
|
||
| /** | ||
| * @param question the question to ask. | ||
| * @param args arguments for filling the templates | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.devonfw.tools.ide.expression; | ||
|
|
||
| import com.devonfw.tools.ide.context.IdeContext; | ||
| import com.devonfw.tools.ide.environment.EnvironmentVariablesType; | ||
|
|
||
| /** | ||
| * Interface for the context available to an {@link ExpressionFunction} while an expression is evaluated. | ||
| */ | ||
| public interface ExpressionContext { | ||
|
|
||
| /** | ||
| * @return the {@link IdeContext}. | ||
| */ | ||
| IdeContext getIdeContext(); | ||
|
|
||
| /** | ||
| * Resolves variables in the given value. Used to resolve arguments of a function that may themselves contain | ||
| * variables or nested expressions (e.g. {@code @path('$[IDE_HOME]/software/node')}). | ||
| * | ||
| * @param value the value to resolve. | ||
| * @return the given value with variables and nested expressions resolved. | ||
| */ | ||
| String resolve(String value); | ||
|
|
||
| /** | ||
| * @param name the name of the variable. | ||
| * @return the value of the variable or {@code null} if not defined in any level of the hierarchy. | ||
| */ | ||
| String getVariable(String name); | ||
|
|
||
| /** | ||
| * Persists the given variable to the {@code ide.properties} of the given {@link EnvironmentVariablesType configuration location} so the user is not asked | ||
| * again. | ||
| * | ||
| * @param name the name of the variable. | ||
| * @param value the value to persist. | ||
| * @param type the {@link EnvironmentVariablesType} determining the {@code ide.properties} to write to. | ||
| */ | ||
| void setVariable(String name, String value, EnvironmentVariablesType type); | ||
|
|
||
| } |
Uh oh!
There was an error while loading. Please reload this page.