Skip to content

Commit

Permalink
fixup! drop --module_name from osgi wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <[email protected]>
  • Loading branch information
sgammon committed Apr 3, 2024
1 parent 6f07a8c commit 1f52b5a
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 18 deletions.
3 changes: 0 additions & 3 deletions build_defs/java_opts.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def protobuf_java_module(
)

def protobuf_versioned_java_library(
module_name,
bundle_description,
bundle_name,
bundle_symbolic_name,
Expand All @@ -180,7 +179,6 @@ def protobuf_versioned_java_library(
Args:
bundle_description: (required) The Bundle-Description header defines a short
description of this bundle.
module_name: (required) The Java 9 module name for this target.
bundle_name: (required) The Bundle-Name header defines a readable name for this
bundle. This should be a short, human-readable name that can
contain spaces.
Expand All @@ -202,7 +200,6 @@ def protobuf_versioned_java_library(
"""
osgi_java_library(
javacopts = JAVA_OPTS,
module_name = module_name,
bundle_doc_url = BUNDLE_DOC_URL,
bundle_license = BUNDLE_LICENSE,
bundle_version = PROTOBUF_JAVA_VERSION,
Expand Down
2 changes: 0 additions & 2 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ protobuf_versioned_java_library(
srcs = LITE_SRCS + [
":gen_well_known_protos_javalite",
],
module_name = "com.google.protobuf",
bundle_description = "Lite version of Protocol Buffers library. This " +
"version is optimized for code size, but does not " +
"guarantee API/ABI stability.",
Expand Down Expand Up @@ -246,7 +245,6 @@ protobuf_versioned_java_library(
) + [
":gen_well_known_protos_java",
],
module_name = "com.google.protobuf",
bundle_description = "Core Protocol Buffers library. Protocol Buffers " +
"are a way of encoding structured data in an " +
"efficient yet extensible format.",
Expand Down
8 changes: 1 addition & 7 deletions java/osgi/OsgiWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
@Command(name = "osgi_wrapper")
public final class OsgiWrapper implements Callable<Integer> {
private static final String MULTI_RELEASE_MANIFEST_PROPERTY = "Multi-Release";
private static final String FIXUP_MESSAGES_PROPERTY = "-fixupmessages";
private static final String FIXUP_MESSAGES_IGNORE_MRJAR = "^Classes found in the wrong directory: .*";

private static final String REMOVEHEADERS =
Expand Down Expand Up @@ -60,11 +59,6 @@ public final class OsgiWrapper implements Callable<Integer> {
description = "The classpath that contains dependencies of the input jar, separated with :")
private String classpath;

@Option(
names = {"--module_name"},
description = "The JPMS module name of the bundle")
private String moduleName;

@Option(
names = {"--bundle_copyright"},
description = "Copyright string for the bundle")
Expand Down Expand Up @@ -127,7 +121,7 @@ public Integer call() throws Exception {
analyzer.setProperty(Analyzer.BUNDLE_LICENSE, bundleLicense);
analyzer.setProperty(Analyzer.REMOVEHEADERS, REMOVEHEADERS);
analyzer.setProperty(MULTI_RELEASE_MANIFEST_PROPERTY, "true");
analyzer.setProperty(FIXUP_MESSAGES_PROPERTY, FIXUP_MESSAGES_IGNORE_MRJAR);
analyzer.setProperty(aQute.bnd.osgi.Constants.FIXUPMESSAGES, FIXUP_MESSAGES_IGNORE_MRJAR);

if (classpath != null) {
for (String dep : Arrays.asList(classpath.split(":"))) {
Expand Down
5 changes: 0 additions & 5 deletions java/osgi/osgi.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ load("@rules_java//java:defs.bzl", "java_library")
# which is probably sub-optimal.
def osgi_java_library(
name,
module_name,
bundle_description,
bundle_doc_url,
bundle_license,
Expand All @@ -48,7 +47,6 @@ def osgi_java_library(
Args:
name: (required) A unique name for this target.
module_name: (required) JPMS module name for this target.
bundle_description: (required) The Bundle-Description header defines a short
description of this bundle.
bundle_doc_url: (required) The Bundle-DocURL headers must contain a URL pointing
Expand Down Expand Up @@ -121,7 +119,6 @@ def osgi_java_library(
# Repackage the jar with an OSGI manifest
_osgi_jar(
name = name,
module_name = module_name,
bundle_description = bundle_description,
bundle_doc_url = bundle_doc_url,
bundle_license = bundle_license,
Expand All @@ -144,7 +141,6 @@ def _run_osgi_wrapper(ctx, input_jar, classpath_jars, output_jar):
args.add_joined("--classpath", classpath_jars, join_with = ":")
args.add("--input_jar", input_jar.path)
args.add("--output_jar", output_jar.path)
args.add("--module_name", ctx.attr.module_name)
args.add("--bundle_copyright", ctx.attr.bundle_copyright)
args.add("--bundle_description", ctx.attr.bundle_description)
args.add("--bundle_doc_url", ctx.attr.bundle_doc_url)
Expand Down Expand Up @@ -219,7 +215,6 @@ _osgi_jar = rule(
"output_jar": "lib%{name}.jar",
},
attrs = {
"module_name": attr.string(),
"bundle_copyright": attr.string(),
"bundle_description": attr.string(),
"bundle_doc_url": attr.string(),
Expand Down
1 change: 0 additions & 1 deletion java/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protobuf_versioned_java_library(
srcs = glob([
"src/main/java/com/google/protobuf/util/*.java",
]),
module_name = "com.google.protobuf.util",
bundle_description = "Utilities for Protocol Buffers",
bundle_name = "Protocol Buffers [Util]",
bundle_symbolic_name = "com.google.protobuf.util",
Expand Down

0 comments on commit 1f52b5a

Please sign in to comment.