-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Nice manifest writer #6323
base: master
Are you sure you want to change the base?
Nice manifest writer #6323
Conversation
This writes the manifest file with indention which is easier to read, while still considering the 72 chars limit per line. so technically still a valid manifest. borrowed from https://github.com/apache/felix-dev/blob/master/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java#L108 and https://github.com/apache/felix-dev/blob/master/utils/src/main/java/org/apache/felix/utils/manifest/Parser.java#L43 Signed-off-by: Christoph Rueger <[email protected]>
CorruptManifest > testCorruptJar() FAILED org.opentest4j.AssertionFailedError: expected: <. . > but was: <. .> at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151) at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132) at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197) at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182) at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177) at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1142) at app//test.CorruptManifest.testCorruptJar(CorruptManifest.java:59) MultiReleaseTest > testBuild() FAILED org.opentest4j.AssertionFailedError: expected: "" but was: "Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9))"" at [email protected]/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at [email protected]/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at [email protected]/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at app//test.MultiReleaseTest.testBuild(MultiReleaseTest.java:96) Signed-off-by: Christoph Rueger <[email protected]> check null Signed-off-by: Christoph Rueger <[email protected]>
Signed-off-by: Christoph Rueger <[email protected]>
that way 'nice' could be disabled by callers. Signed-off-by: Christoph Rueger <[email protected]>
hmm. I'd like to suggest to do it differently. In Analyzer::calcManifest we have the data in Parameters. Why not add an append method that takes a nice option? This will create an attribute in the manifest with newlines. Which is as far as I know allowed ... (might have to check this). ManifestUtil::write then needs to account for newlines in the attribute value. it should then reset the limit and output an EOL. it should not put the newline itself in the manifest output. The advantage is that:
|
Closes #6321
Felix Bundle plugin has a niceManifest option that formats Manifest
We adapted this and use it as the new default.