Skip to content
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

Improve writing changes to ide.properties #78

Closed
hohwille opened this issue Oct 10, 2023 · 2 comments · Fixed by #107
Closed

Improve writing changes to ide.properties #78

hohwille opened this issue Oct 10, 2023 · 2 comments · Fixed by #107
Assignees
Labels
enhancement New feature or request

Comments

@hohwille
Copy link
Member

hohwille commented Oct 10, 2023

In case we are changing the value of a property and saving the changes back to disc, I want to have that the order of the lines in the ide.properties file remains stable so that only the new value is changed in the line where the property was declared before.

Assuming we have this ide.properties file with some legacy history:

#here we define the maven version for both the old and the new release to avoid incompatiblities...
MVN_VERSION=3.9.4
MAVEN_VERSION=${MVN_VERSION}
#here we define to use commercial ultimate edition for Intellij as all team members have a license...
INTELLIJ_EDITION=ultimate
INTELLIJ_EDITION_TYPE=u

Now if we run ide version-set mvn 3.9.5 (see #79) we should get:

#here we define the maven version for both the old and the new release to avoid incompatiblities...
MVN_VERSION=3.9.5
MAVEN_VERSION=${MVN_VERSION}
#here we define to use commercial ultimate edition for Intellij as all team members have a license...
INTELLIJ_EDITION=ultimate
INTELLIJ_EDITION_TYPE=u

So the following would be undesired:

#here we define the maven version for both the old and the new release to avoid incompatiblities...
MAVEN_VERSION=${MVN_VERSION}
#here we define to use commercial ultimate edition for Intellij as all team members have a license...
INTELLIJ_EDITION=ultimate
INTELLIJ_EDITION_TYPE=u
MVN_VERSION=3.9.5

Even more wrong would be:

#here we define the maven version for both the old and the new release to avoid incompatiblities...
MVN_VERSION=3.9.4
MAVEN_VERSION=${MVN_VERSION}
#here we define to use commercial ultimate edition for Intellij as all team members have a license...
INTELLIJ_EDITION=ultimate
INTELLIJ_EDITION_TYPE=u
MVN_VERSION=3.9.5
@hohwille hohwille added the enhancement New feature or request label Oct 10, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Oct 10, 2023
@hohwille hohwille added this to the release:2024.01.001 milestone Oct 10, 2023
@MattesMrzik MattesMrzik self-assigned this Oct 18, 2023
@MattesMrzik
Copy link
Contributor

I have looked at the code and also tried some value changes of properties and saved the changes back to disc. I set some arbitrary helm versions.
ide set-version helm 1
then after some additional manual changes the file settings/ide.properties looked like:

...
HELM_VERSION=1
a=1
b=2
c=3

Then I ran ide set-version helm 1.1 and the file then looked just as desired:

...
HELM_VERSION=1.1
a=1
b=2
c=3

@MattesMrzik
Copy link
Contributor

EnvironmentVariablesPropertiesFile.set() can create new properties. It can also set new values for existing ones or change the "export" flag. Possibly a bug: the "export" flag is only updated if the value changes as well.

MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 19, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 20, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 20, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 20, 2023
…ork on github, so now tmp file to target dir
@hohwille hohwille linked a pull request Oct 20, 2023 that will close this issue
hohwille added a commit to MattesMrzik/IDEasy that referenced this issue Oct 23, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 23, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 23, 2023
MattesMrzik added a commit to MattesMrzik/IDEasy that referenced this issue Oct 23, 2023
hohwille added a commit to MattesMrzik/IDEasy that referenced this issue Oct 23, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in IDEasy board Oct 23, 2023
hohwille pushed a commit to hohwille/IDEasy that referenced this issue Oct 24, 2023
hohwille pushed a commit to hohwille/IDEasy that referenced this issue Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants