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

#582: Use new XML merger with intellij configuration files #68

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

KianRolf
Copy link
Contributor

@KianRolf KianRolf commented Nov 6, 2024

fixes devonfw/IDEasy#582

Moves intellij config files from setup to update and configures them for the new xml merger

@KianRolf KianRolf added the enhancement New feature or request label Nov 6, 2024
@KianRolf
Copy link
Contributor Author

KianRolf commented Nov 8, 2024

I am still not sure when exactly the OVERRIDE strategy is required

@KianRolf
Copy link
Contributor Author

Still needs some adjustments

@KianRolf
Copy link
Contributor Author

Should now be ready to be merged.

However some files are using override as merge strategy. This works for now but is not ideal.
The override merge strategy is used as a workaround to devonfw/IDEasy#498.
Also i have discovered that the merge:id="name()" only works when the program runs in intellij (this is why the test are still green) but not in the finished build.
Screenshot 2024-11-13 155421

As a possible workaround i replaced the merge:id"name()" with xpathexpressions wich seemed to be working. So when #498 is resolved and the override merge strategies get removed i would recommend to try and use xpathexpressions

@hohwille
Copy link
Member

Copy link
Member

@hohwille hohwille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KianRolf thanks for this PR. Quite tricky to add all this merge attributes and namespaces.
Thanks also for testing this with IDEasy and finding the problems in the XML merger. 👍
I finally found the time to review - sorry for the long delay.
There are a lot of review comments I lefts.
Some of them are because of problems we already have before this PR so they are not your "fault" but I just noticed when I closely looked into them during the review.
Some problems would have been prevented by proper git mv usage so that should be a good learning for the future since git is fundamental for software development.
Please have a look and try to address the review comments.

@@ -0,0 +1 @@
$[PROJECT_NAME] - $[WORKSPACE]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You duplicated this file instead of moving it.
Either leave it in setup or move it to setup.

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this file gets duplicated instead of being moved.
IMHO we can also delete this file. All obsolete with .editorconfig.
See also PR #64

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this file gets duplicated instead of being moved.
IMHO we can also delete this file. All obsolete with .editorconfig.
See also PR #64

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this file gets duplicated instead of being moved.
It is still needed so you can delete the one from setup in your feature branch.

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this file gets duplicated instead of being moved.
Currently it is unclear to me what this file is needed for.
@jan-vcapgemini Can we remove it?
IMHO this is also obsolete.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application xmlns:merge="https://github.com/devonfw/IDEasy/merge" merge:strategy="override">
<component name="ProjectJdkTable" merge:id="@name">
<jdk version="2" merge:id="@version">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one will get really tricky since the design of this XML from IntelliJ is very much flawed.
If you have multiple JDKs configured, you will have multiple elements:

  <jdk version="2>
    <name value="MyJava1">
    ...
  </jdk>
  <jdk version="2>
    <name value="MyJava2">
    ...
  </jdk>

So most probably merge:id="./name@value" would be correct for jdk.
I have never tested if our XML merger could handle this.
For this PR, we can ignore this comment but we might need to create a new IDEasy ticket out of this.

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this file come from?
Did you introduce it?
IMHO it should be removed here.

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: Team Review
Development

Successfully merging this pull request may close these issues.

Use new XML merger with intellij configuration files
3 participants