Skip to content

Commit

Permalink
Add the auto common shaded jar back into the jarjar.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=276320423
  • Loading branch information
bcorso committed Oct 23, 2019
1 parent f5c773a commit efe1b00
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions java/dagger/internal/codegen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ gen_maven_artifact(
# The javadocs should only include ComponentProcessor.java, since that is the only class used
# externally. Specifically, ComponentProcessor.forTesting() is required for testing SPI plugins.
javadoc_srcs = ["ComponentProcessor.java"],
shaded_deps = ["@com_google_auto_auto_common//jar"],
shaded_rules = ["rule com.google.auto.common.** dagger.shaded.auto.common.@1"],
deps = [
":package_info",
"//java/dagger/internal/codegen/base",
Expand Down
1 change: 1 addition & 0 deletions java/dagger/producers/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ gen_maven_artifact(
],
javadoc_root_packages = ["dagger.producers"],
javadoc_srcs = SRCS,
# TODO(user): Look more into why auto/common shading isn't needed here.
)
2 changes: 2 additions & 0 deletions java/dagger/spi/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ gen_maven_artifact(
":spi-srcs",
"//java/dagger/model:model-srcs",
],
shaded_deps = ["@com_google_auto_auto_common//jar"],
shaded_rules = ["rule com.google.auto.common.** dagger.shaded.auto.common.@1"],
deps = [
"//java/dagger/internal/codegen/extension",
"//java/dagger/model",
Expand Down
14 changes: 9 additions & 5 deletions tools/maven.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def pom_file(name, targets, artifact_name, artifact_id, packaging = None, **kwar

POM_VERSION = "${project.version}"

_SHADE_RULES = ["rule com.google.auto.common.** dagger.shaded.auto.common.@1"]

def gen_maven_artifact(
name,
artifact_name,
Expand All @@ -53,7 +51,9 @@ def gen_maven_artifact(
javadoc_root_packages = None,
javadoc_exclude_packages = None,
javadoc_android_api_level = None,
deps = None):
deps = None,
shaded_deps = None,
shaded_rules = None):
"""Generates the files required for a maven artifact.
This macro generates the following targets:
Expand Down Expand Up @@ -81,13 +81,17 @@ def gen_maven_artifact(
javadoc_exclude_packages: The packages to exclude from the javadocs.
javadoc_android_api_level: The android api level for the javadocs.
deps: The required deps to include with the target.
shaded_deps: The shaded deps for the jarjar.
shaded_rules: The shaded rules for the jarjar
"""
_validate_maven_deps(
name = name + "-validation",
target = artifact_target,
deps = deps,
)

shaded_deps = shaded_deps or []
shaded_rules = shaded_rules or []
artifact_targets = [artifact_target] + (deps or [])

pom_file(
Expand All @@ -109,8 +113,8 @@ def gen_maven_artifact(

jarjar_library(
name = name,
jars = artifact_targets,
rules = _SHADE_RULES,
jars = artifact_targets + shaded_deps,
rules = shaded_rules,
)

jarjar_library(
Expand Down

0 comments on commit efe1b00

Please sign in to comment.