Skip to content

Commit

Permalink
Add includes as a transitive member.
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 250306687
  • Loading branch information
Googler authored and irengrig committed Jun 18, 2019
1 parent 92e7663 commit e17f58b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.actions.Artifact;
Expand All @@ -34,7 +33,6 @@
import com.google.devtools.build.lib.syntax.Type;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.List;

/**
* Provides a way to access attributes that are common to all compilation rules.
Expand Down Expand Up @@ -387,15 +385,12 @@ public NestedSet<String> sdkDylibs() {
public NestedSet<PathFragment> headerSearchPaths(PathFragment genfilesFragment) {
NestedSetBuilder<PathFragment> paths = NestedSetBuilder.stableOrder();
if (packageFragment.isPresent()) {
List<PathFragment> rootFragments =
ImmutableList.of(
packageFragment.get(), genfilesFragment.getRelative(packageFragment.get()));

Iterable<PathFragment> relativeIncludes =
Iterables.filter(includes(), Predicates.not(PathFragment::isAbsolute));
for (PathFragment include : relativeIncludes) {
for (PathFragment rootFragment : rootFragments) {
paths.add(rootFragment.getRelative(include));
PathFragment packageFrag = packageFragment.get();
PathFragment genfilesFrag = genfilesFragment.getRelative(packageFrag);
for (PathFragment include : includes()) {
if (!include.isAbsolute()) {
paths.add(packageFrag.getRelative(include));
paths.add(genfilesFrag.getRelative(include));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ ObjcCommon build() {
objcProvider
.addAll(HEADER, filterFileset(attributes.hdrs()))
.addAll(HEADER, filterFileset(attributes.textualHdrs()))
.addAll(INCLUDE, attributes.headerSearchPaths(buildConfiguration.getGenfilesFragment()))
.addTransitiveAndPropagate(
INCLUDE, attributes.headerSearchPaths(buildConfiguration.getGenfilesFragment()))
.addAll(INCLUDE, sdkIncludes)
.addAll(SDK_FRAMEWORK, attributes.sdkFrameworks())
.addAll(WEAK_SDK_FRAMEWORK, attributes.weakSdkFrameworks())
Expand Down

0 comments on commit e17f58b

Please sign in to comment.