aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
authorGravatar laszlocsomor <laszlocsomor@google.com>2017-07-20 10:10:45 +0200
committerGravatar Klaus Aehlig <aehlig@google.com>2017-07-20 10:33:23 +0200
commite1d3b87302cb11a4a1bad72b22cbe4b998296314 (patch)
tree0e9594d3c79d7624d5fbb3a1a7776d925a6034dc /src/main/java/com/google/devtools
parent6d47707a96752d3b876bed5cfd253d5e064cbec1 (diff)
Automated rollback of commit 01ddfb7bf418b371859de62f4eab2f41ea9a4a4a.
This is a partial rollback. I restored the old flags (with PathListConverter), added the new ones, added deprecation warnings and annotations, and added code to concat the values of new and old. Existing released versions of Bazel should keep working with the new code until 2018-01-31, i.e. for the next ~6 months. After that I'll remove the old flags and the PathListConverter. *** Reason for rollback *** Fixed broken integration with release Blaze. *** Original change description *** Automated rollback of commit 5752463ece84ebb4fb074888cba57412ab8d86b3. *** Reason for rollback *** Broke too many targets. *** RELNOTES: none PiperOrigin-RevId: 162587548
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/LibraryRGeneratorActionBuilder.java19
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java9
2 files changed, 10 insertions, 18 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/LibraryRGeneratorActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/LibraryRGeneratorActionBuilder.java
index e4baef192a..9dc43aa64a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/LibraryRGeneratorActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/LibraryRGeneratorActionBuilder.java
@@ -13,7 +13,6 @@
// limitations under the License.
package com.google.devtools.build.lib.rules.android;
-import com.google.common.base.Function;
import com.google.common.base.Strings;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableList;
@@ -29,11 +28,6 @@ import com.google.devtools.build.lib.collect.nestedset.Order;
/** Builder for the action that generates the R class for libraries. */
public class LibraryRGeneratorActionBuilder {
- static final Function<ResourceContainer, Artifact> TO_SYMBOL_ARTIFACT =
- ResourceContainer::getSymbols;
- static final Function<ResourceContainer, String> TO_SYMBOL_PATH =
- (ResourceContainer container) -> container.getSymbols().getExecPathString();
-
private String javaPackage;
private Iterable<ResourceContainer> deps = ImmutableList.<ResourceContainer>of();
private ResourceContainer resourceContainer;
@@ -77,13 +71,12 @@ public class LibraryRGeneratorActionBuilder {
FluentIterable<ResourceContainer> symbolProviders =
FluentIterable.from(deps).append(resourceContainer);
- builder.addJoinStrings(
- "--symbols",
- ruleContext.getConfiguration().getHostPathSeparator(),
- symbolProviders.transform(TO_SYMBOL_PATH));
- inputs.addTransitive(
- NestedSetBuilder.wrap(
- Order.NAIVE_LINK_ORDER, symbolProviders.transform(TO_SYMBOL_ARTIFACT)));
+ if (!symbolProviders.isEmpty()) {
+ builder.addExecPaths("--symbols", symbolProviders.transform(c -> c.getSymbols()));
+ inputs.addTransitive(
+ NestedSetBuilder.wrap(
+ Order.NAIVE_LINK_ORDER, symbolProviders.transform(ResourceContainer::getSymbols)));
+ }
builder.addExecPath("--classJarOutput", rJavaClassJar);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
index 60d414ddc4..9a997bffb9 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/ResourceShrinkerActionBuilder.java
@@ -201,11 +201,10 @@ public class ResourceShrinkerActionBuilder {
inputs.add(primaryResources.getManifest());
List<Artifact> dependencyManifests = getManifests(dependencyResources);
- commandLine.addJoinExecPaths(
- "--dependencyManifests",
- ruleContext.getConfiguration().getHostPathSeparator(),
- dependencyManifests);
- inputs.addAll(dependencyManifests);
+ if (!dependencyManifests.isEmpty()) {
+ commandLine.addExecPaths("--dependencyManifest", dependencyManifests);
+ inputs.addAll(dependencyManifests);
+ }
List<String> resourcePackages = getResourcePackages(primaryResources, dependencyResources);
commandLine.addJoinStrings("--resourcePackages", ",", resourcePackages);