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

Merge addon info of all repos into one addons.xml file #1626

Merged
merged 5 commits into from
Jan 5, 2024

Conversation

wborn
Copy link
Member

@wborn wborn commented Jan 4, 2024

Extracts the ZigBee and Z-Wave addon.xml files and merges them into the addons.xml file using Groovy.

Extracts the ZigBee and Z-Wave addon.xml files and merges them into the addons.xml file using Groovy.

Signed-off-by: Wouter Born <[email protected]>
Comment on lines +1 to +12
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this license header needed, and if so, is there a configuration in this repository for automatically updating copyright year in license headers?

Copy link
Member Author

@wborn wborn Jan 4, 2024

Choose a reason for hiding this comment

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

I added it because we also have it on our other Groovy file.

There is no license-maven-plugin config currently but we can add it before 2025 when the header survives the pull request.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created #1627 for this

@holgerfriedrich
Copy link
Member

holgerfriedrich commented Jan 4, 2024

Just tried it out, addons.xml now contains zwave an zway. It is in the distro zip and accepted by the addon finders. 👍

@holgerfriedrich
Copy link
Member

Just tried it out, addons.xml now contains zwave an zway. It is in the distro zip and accepted by the addon finders. 👍

@wborn Bad news. Unfortunately there seem to be issues, at least when building on Windows..... Seems I have not seen this in the first tryout because I touched the new addons.xml and VS Code fixed it when saving....

We seem to have mixed line endings:

image

The XML parser fails.
image

(When I fix this, I seen to break the encoding in the description of nobohub binding, so I removed the UTF8 characters).
After changing both, it works.

@wborn
Copy link
Member Author

wborn commented Jan 5, 2024

Does it work better with the new commit?

@wborn wborn mentioned this pull request Jan 5, 2024
Signed-off-by: Wouter Born <[email protected]>
@wborn
Copy link
Member Author

wborn commented Jan 5, 2024

It seems to always print the XML using Unix line endings so I've updated the script for that.

@holgerfriedrich
Copy link
Member

Almost fine, but not yet. Still the parser is unable to handle it. Hope this is not caused by some weird stuff on my machine.

Freshly generated distro zip: fail. Opening addons.xml with VS Code, saving it. Then it works.
The diff shows some changes related to unicode characters:
image

Not working:
image

After saving:
image

Signed-off-by: Wouter Born <[email protected]>
@wborn
Copy link
Member Author

wborn commented Jan 5, 2024

With the new commit it seems to work better on my Windows VM.

@holgerfriedrich
Copy link
Member

Does not work for me - same output as before.
Following up on the screenshot above:
https://www.compart.com/de/unicode/U+00F8, encoded as ``c3b8``` in UTF-8.

This character is correct in ./distributions/openhab/target/addon-xml/addons.xml, but broken in ./distributions/openhab/target/assembly/runtime/etc/addons.xml.

Signed-off-by: Wouter Born <[email protected]>
@wborn
Copy link
Member Author

wborn commented Jan 5, 2024

How does this BufferedWriter work for you? 🙂
According to the docs it will always use UTF-8.

@holgerfriedrich
Copy link
Member

Yeah, that did the trick! 🚀 👍

@wborn
Copy link
Member Author

wborn commented Jan 5, 2024

Great! 😅 If it works on Linux and Windows I cannot imagine it will not work macOS. 😉

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@J-N-K J-N-K merged commit eeae654 into openhab:main Jan 5, 2024
3 checks passed
@J-N-K J-N-K added PR pending There is a pull request for resolving the issue enhancement An enhancement or new feature and removed PR pending There is a pull request for resolving the issue labels Jan 5, 2024
@J-N-K J-N-K added this to the 4.2 milestone Jan 5, 2024
@wborn wborn deleted the merge-addon-info branch January 5, 2024 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants