aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2017-06-30 00:32:04 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-30 13:00:58 +0200
commit3d2a68c6da2a50a9e1bcf6615e83a43701cdf95d (patch)
tree31692a985d316e33733ab6993e529b8a08c206b6 /src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java
parent2d5eeab381713f99c8c8b7b80f3d447be847b548 (diff)
Automated conversion to Java 8
With a few manual fixes for readability. RELNOTES: None. PiperOrigin-RevId: 160582556
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java
index 915d40d76a..aca7f7a4a1 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.lib.rules.objc;
+import static com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet;
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEFINE;
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DYNAMIC_FRAMEWORK_FILE;
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.HEADER;
@@ -21,6 +22,7 @@ import static com.google.devtools.build.lib.rules.objc.ObjcProvider.IMPORTED_LIB
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE;
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE_SYSTEM;
import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_FILE;
+import static java.util.Comparator.naturalOrder;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
@@ -29,6 +31,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;
import com.google.common.collect.Iterables;
+import com.google.common.collect.Streams;
import com.google.devtools.build.lib.actions.ActionAnalysisMetadata;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.AnalysisEnvironment;
@@ -63,6 +66,7 @@ import com.google.devtools.build.lib.rules.objc.ObjcVariablesExtension.VariableC
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Collection;
import java.util.Map;
+import java.util.stream.Stream;
import javax.annotation.Nullable;
/**
@@ -387,8 +391,11 @@ public class CrosstoolCompilationSupport extends CompilationSupport {
ImmutableSortedSet.copyOf(compilationArtifacts.getNonArcSrcs());
Collection<Artifact> privateHdrs =
ImmutableSortedSet.copyOf(compilationArtifacts.getPrivateHdrs());
- Collection<Artifact> publicHdrs = ImmutableSortedSet.copyOf(
- Iterables.concat(attributes.hdrs(), compilationArtifacts.getAdditionalHdrs()));
+ Collection<Artifact> publicHdrs =
+ Stream.concat(
+ Streams.stream(attributes.hdrs()),
+ Streams.stream(compilationArtifacts.getAdditionalHdrs()))
+ .collect(toImmutableSortedSet(naturalOrder()));
Artifact pchHdr = null;
if (ruleContext.attributes().has("pch", BuildType.LABEL)) {
pchHdr = ruleContext.getPrerequisiteArtifact("pch", Mode.TARGET);