Skip to content

Commit

Permalink
Merge pull request #5857 from pkriens/issue/5792-automatic-module-nam…
Browse files Browse the repository at this point in the history
…es-warning

Issue/5792 automatic module names warning
  • Loading branch information
pkriens committed Oct 31, 2023
2 parents 2964e9f + cf88a63 commit 46e442b
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 53 deletions.
2 changes: 1 addition & 1 deletion biz.aQute.bndlib.tests/test/test/MultiReleaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testBuild() throws Exception {

assertThat(v17.check()).isTrue();
assertThat(v9.check()).isTrue();
assertThat(main.check()).isTrue();
assertThat(main.check("jpms.jarname")).isTrue();

assertThat(main.getFile("generated/multirelease.main.jar")).isNotNull();

Expand Down
26 changes: 13 additions & 13 deletions biz.aQute.bndlib.tests/test/test/jpms/JPMSModuleInfoPluginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void moduleWithOptionsIgnore() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -186,7 +186,7 @@ public void moduleWithOptionsStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -247,7 +247,7 @@ public void moduleWithOptionsMapModuleNameStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -308,7 +308,7 @@ public void moduleWithOptionsMapModuleName() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -369,7 +369,7 @@ public void moduleWithAllDynamicImportsOrOptionalIsStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -433,7 +433,7 @@ public void moduleWithAllDynamicImportsIsStatic_2() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -498,7 +498,7 @@ public void moduleWithAllDynamicImportsIsStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -562,7 +562,7 @@ public void moduleWithAllResolutionOptionalImportsIsStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -625,7 +625,7 @@ public void moduleWithNoImportsIsStatic() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -689,7 +689,7 @@ public void moduleManualConfiguration() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -767,7 +767,7 @@ public void moduleRequiresModuleB() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json.bind-api-1.0.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -843,7 +843,7 @@ public void moduleRequiresModuleA() throws Exception {
b.addClasspath(IO.getFile("testresources/javax.json-api-1.1.3.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down Expand Up @@ -905,7 +905,7 @@ public void moduleRequiresA() throws Exception {
b.addClasspath(IO.getFile("testresources/geronimo-jcdi_2.0_spec-1.1.jar"));
Jar jar = b.build();

if (!b.check())
if (!b.check("jpms.jarname"))
fail();

Resource moduleInfo = jar.getResource(Constants.MODULE_INFO_CLASS);
Expand Down
2 changes: 1 addition & 1 deletion biz.aQute.bndlib/src/aQute/bnd/build/package-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*/
@Version("4.5.0")
@Version("4.6.0")
package aQute.bnd.build;

import org.osgi.annotation.versioning.Version;
2 changes: 1 addition & 1 deletion biz.aQute.bndlib/src/aQute/bnd/maven/package-info.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*/
@Version("3.4.0")
@Version("3.5.0")
package aQute.bnd.maven;

import org.osgi.annotation.versioning.Version;
8 changes: 8 additions & 0 deletions biz.aQute.bndlib/src/aQute/bnd/osgi/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ public static Properties getManifest(File dirOrJar) throws Exception {
* @throws IOException
*/
public void analyze() throws Exception {
bracketed(this::analyze0);
}

private void analyze0() throws Exception {

if (!analyzed) {
analyzed = true;
Expand Down Expand Up @@ -1034,6 +1038,10 @@ boolean isResourceOnly() {
* @throws IOException
*/
public Manifest calcManifest() throws Exception {
return bracketed(this::calcManifest0);
}

private Manifest calcManifest0() throws Exception {
try {
analyze();
Manifest manifest = new Manifest();
Expand Down
Loading

0 comments on commit 46e442b

Please sign in to comment.