diff options
author | 2017-03-17 16:03:44 +0000 | |
---|---|---|
committer | 2017-03-20 11:37:22 +0000 | |
commit | 15757546fb11448cd04e8304595a0af9aefd12f3 (patch) | |
tree | 0c75eff891d8624b7d485683c6afa42f375c3bd4 /src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java | |
parent | 196bf3189ce9eab35f0f1ab8fb2d412ffa38ed32 (diff) |
Add sourcepath to java_common.compile
and remove support for -sourcepath through javacopts.
Progress on #2606.
Supporting -implicit:none by default will be done in an upcoming change.
--
PiperOrigin-RevId: 150445185
MOS_MIGRATED_REVID=150445185
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java index d67a197d26..e14fc2c6fc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaLibraryHelper.java @@ -50,7 +50,7 @@ public final class JavaLibraryHelper { */ private final List<JavaCompilationArgsProvider> deps = new ArrayList<>(); private ImmutableList<String> javacOpts = ImmutableList.of(); - + private ImmutableList<Artifact> sourcePathEntries = ImmutableList.of(); private StrictDepsMode strictDepsMode = StrictDepsMode.OFF; private JavaClasspathMode classpathMode = JavaClasspathMode.OFF; @@ -113,6 +113,11 @@ public final class JavaLibraryHelper { return this; } + public JavaLibraryHelper setSourcePathEntries(List<Artifact> sourcepathEntries) { + this.sourcePathEntries = ImmutableList.copyOf(sourcepathEntries); + return this; + } + /** * When in strict mode, compiling the source-jars passed to this JavaLibraryHelper will break if * they depend on classes not in any of the {@link @@ -145,6 +150,7 @@ public final class JavaLibraryHelper { attributes.setStrictJavaDeps(strictDepsMode); attributes.setRuleKind(ruleContext.getRule().getRuleClass()); attributes.setTargetLabel(ruleContext.getLabel()); + attributes.setSourcePath(sourcePathEntries); if (isStrict() && classpathMode != JavaClasspathMode.OFF) { JavaCompilationHelper.addDependencyArtifactsToAttributes( |