-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Extra maven artifacts support for java_export rule #805
base: master
Are you sure you want to change the base?
Conversation
@cheister I have made one more commit towards templating maven coordinates. Could you please check? |
examples/java-export/src/main/java/com/github/bazelbuild/rulesjvmexternal/example/export/BUILD
Outdated
Show resolved
Hide resolved
private/tools/java/rules/jvm/external/maven/MavenPublisher.java
Outdated
Show resolved
Hide resolved
private/tools/java/rules/jvm/external/maven/MavenPublisher.java
Outdated
Show resolved
Hide resolved
private/tools/java/rules/jvm/external/maven/MavenPublisher.java
Outdated
Show resolved
Hide resolved
6620973
to
006f6ff
Compare
f2c9503
to
f7bb009
Compare
@cheister could you please review and approve if you are fine with changes |
@cheister could you please review and approve if you are fine with changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies it has taken so long to review this. A couple of comments, but I think this is looking good.
private/tools/java/rules/jvm/external/maven/MavenPublisher.java
Outdated
Show resolved
Hide resolved
…ish any generic artifact like tar"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost there. I've spotted one issue, but once that's fixed, let's merge this.
@@ -106,6 +111,17 @@ public static void main(String[] args) | |||
futures.add(upload(repo, credentials, coords, "-javadoc.jar", docJar, gpgSign)); | |||
} | |||
|
|||
if(args.length > 9) { | |||
String ext = com.google.common.io.Files.getFileExtension(args[9]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this value need to be calculated per tuple, rather than just on the final one? eg war=foo.jar,tar=foo.tar
would result in ext
being set to tar
for both the war
and tar
classifiers.
for(String artifactTuple: extraArtifactTuples) { | ||
String[] splits = artifactTuple.split("="); | ||
String classifier = splits[0]; | ||
Path artifact = getPathIfSet(splits[1]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Path
should exist. If it doesn't, we've got real problems.... Paths.get
is fine here.
@krisnaru, can I help you in any way to get this one over the line? It'd be lovely to have this in the tree.... |
I have continued the work in this PR in #926 . |
Is there any intention/support for extra classifier artifacts being in the BOM too? Would be useful for things like test-jars that sometime get published and depended on. |
@cjohnstoniv We didn't need that for our use team's use case, but I'm sure it would make sense to extend this to the BOM if you want to contribute a PR. |
Issue:
Java_export needs to upload multiple artifacts as part of single rule. Artifacts could be war/tar files and it needs to support classifier.
Example:
BUILD:
java_export(
name = "example-export",
extra_artifacts = {
"release": "//src/main/java/com/github/bazelbuild/rulesjvmexternal/example/export:tar",
},
maven_coordinates = "com.example:bazel-example:0.0.1",
runtime_deps = [
"//src/main/java/com/github/bazelbuild/rulesjvmexternal/example/export",
],
)
bazel run -define "maven_repo=file://$HOME/.m2/repository" :example-export.publish