diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build')
6 files changed, 18 insertions, 37 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java index f3f5cd5181..3722572f7f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java @@ -16,15 +16,14 @@ package com.google.devtools.build.lib.rules.objc; import static com.google.devtools.build.lib.packages.ImplicitOutputsFunction.fromTemplates; import static com.google.devtools.build.lib.rules.cpp.Link.LINK_LIBRARY_FILETYPES; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DYNAMIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FORCE_LOAD_LIBRARY; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_SEARCH_PATH_ONLY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.IMPORTED_LIBRARY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.INCLUDE_SYSTEM; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.LIBRARY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_DYLIB; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_FRAMEWORK; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcRuleClasses.COMPILABLE_SRCS_TYPE; import static com.google.devtools.build.lib.rules.objc.ObjcRuleClasses.HEADERS; import static com.google.devtools.build.lib.rules.objc.ObjcRuleClasses.NON_ARC_SRCS_TYPE; @@ -290,10 +289,7 @@ public abstract class CompilationSupport { return frameworkNames // Add custom (non-SDK) framework search paths. For each framework foo/bar.framework, // include "foo" as a search path. - .addAll(PathFragment.safePathStrings( - uniqueParentDirectories(provider.get(STATIC_FRAMEWORK_DIR)))) - .addAll(PathFragment.safePathStrings( - uniqueParentDirectories(provider.get(DYNAMIC_FRAMEWORK_DIR)))) + .addAll(PathFragment.safePathStrings(uniqueParentDirectories(provider.get(FRAMEWORK_DIR)))) .addAll( PathFragment.safePathStrings( uniqueParentDirectories(provider.get(FRAMEWORK_SEARCH_PATH_ONLY)))) @@ -680,8 +676,7 @@ public abstract class CompilationSupport { protected Set<String> frameworkNames(ObjcProvider provider) { Set<String> names = new LinkedHashSet<>(); Iterables.addAll(names, SdkFramework.names(provider.get(SDK_FRAMEWORK))); - for (PathFragment frameworkDir : - Iterables.concat(provider.get(STATIC_FRAMEWORK_DIR), provider.get(DYNAMIC_FRAMEWORK_DIR))) { + for (PathFragment frameworkDir : provider.get(FRAMEWORK_DIR)) { String segment = frameworkDir.getBaseName(); Preconditions.checkState( segment.endsWith(FRAMEWORK_SUFFIX), diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java index ee9b83b8bd..0bd68c41b1 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosFramework.java @@ -16,8 +16,8 @@ package com.google.devtools.build.lib.rules.objc; import static com.google.common.base.Preconditions.checkNotNull; import static com.google.devtools.build.lib.rules.objc.ObjcCommon.uniqueContainers; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.MERGE_ZIP; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_FILE; import com.google.common.annotations.VisibleForTesting; @@ -132,7 +132,7 @@ public class IosFramework extends ReleaseBundlingTargetFactory { // linker actions but not added to the final bundle. .addAll(STATIC_FRAMEWORK_FILE, frameworkImports) .addAll( - STATIC_FRAMEWORK_DIR, + FRAMEWORK_DIR, uniqueContainers(frameworkImports, ObjcCommon.FRAMEWORK_CONTAINER_TYPE)) .build(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java index fee99b902b..bbf79b6c77 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java @@ -23,11 +23,11 @@ import static com.google.devtools.build.lib.rules.objc.ObjcProvider.CC_LIBRARY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEBUG_SYMBOLS; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEBUG_SYMBOLS_PLIST; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEFINE; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DYNAMIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DYNAMIC_FRAMEWORK_FILE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FLAG; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FORCE_LOAD_FOR_XCODEGEN; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FORCE_LOAD_LIBRARY; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.Flag.USES_CPP; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.GENERAL_RESOURCE_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.GENERAL_RESOURCE_FILE; @@ -44,7 +44,6 @@ import static com.google.devtools.build.lib.rules.objc.ObjcProvider.MODULE_MAP; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_DYLIB; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_FRAMEWORK; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SOURCE; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_FILE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STORYBOARD; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STRINGS; @@ -397,9 +396,10 @@ public final class ObjcCommon { .addAll(SDK_DYLIB, extraSdkDylibs) .addAll(STATIC_FRAMEWORK_FILE, staticFrameworkImports) .addAll(DYNAMIC_FRAMEWORK_FILE, dynamicFrameworkImports) - .addAll(STATIC_FRAMEWORK_DIR, - uniqueContainers(staticFrameworkImports, FRAMEWORK_CONTAINER_TYPE)) - .addAll(DYNAMIC_FRAMEWORK_DIR, + .addAll( + FRAMEWORK_DIR, uniqueContainers(staticFrameworkImports, FRAMEWORK_CONTAINER_TYPE)) + .addAll( + FRAMEWORK_DIR, uniqueContainers(dynamicFrameworkImports, FRAMEWORK_CONTAINER_TYPE)) .addAll(INCLUDE, userHeaderSearchPaths) .addAllForDirectDependents(INCLUDE, directDependencyHeaderSearchPaths) diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java index 3c2bac6d4d..667753d701 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java @@ -243,22 +243,12 @@ public final class ObjcProvider extends SkylarkClassObject implements Transitive new Key<>(STABLE_ORDER, "root_merge_zip", Artifact.class); /** - * Exec paths of {@code .framework} directories corresponding to static frameworks to link. These - * cause -F arguments (framework search paths) to be added to each compile action, and - * -framework (link framework) arguments to be added to each link action. These differ from - * dynamic frameworks in that they are statically linked into the binary. + * Exec paths of {@code .framework} directories corresponding to frameworks to link. These cause + * -F arguments (framework search paths) to be added to each compile action, and -framework (link + * framework) arguments to be added to each link action. */ - public static final Key<PathFragment> STATIC_FRAMEWORK_DIR = + public static final Key<PathFragment> FRAMEWORK_DIR = new Key<>(LINK_ORDER, "framework_dir", PathFragment.class); - - /** - * Exec paths of {@code .framework} directories corresponding to dynamic frameworks to link. These - * cause -F arguments (framework search paths) to be added to each compile action, and - * -framework (link framework) arguments to be added to each link action. These differ from - * static frameworks in that they are not statically linked into the binary. - */ - public static final Key<PathFragment> DYNAMIC_FRAMEWORK_DIR = - new Key<>(LINK_ORDER, "dynamic_framework_dir", PathFragment.class); /** * Exec paths of {@code .framework} directories corresponding to frameworks to include in search @@ -392,11 +382,11 @@ public final class ObjcProvider extends SkylarkClassObject implements Transitive BUNDLE_FILE, BUNDLE_IMPORT_DIR, DEFINE, - DYNAMIC_FRAMEWORK_DIR, DYNAMIC_FRAMEWORK_FILE, DEBUG_SYMBOLS, DEBUG_SYMBOLS_PLIST, EXPORTED_DEBUG_ARTIFACTS, + FRAMEWORK_DIR, FRAMEWORK_SEARCH_PATH_ONLY, FORCE_LOAD_LIBRARY, GENERAL_RESOURCE_DIR, @@ -421,7 +411,6 @@ public final class ObjcProvider extends SkylarkClassObject implements Transitive SDK_DYLIB, SDK_FRAMEWORK, SOURCE, - STATIC_FRAMEWORK_DIR, STATIC_FRAMEWORK_FILE, STORYBOARD, STRINGS, diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java index 752f161373..eb96e5fd15 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java @@ -706,10 +706,7 @@ public final class ReleaseBundlingSupport { .addTransitiveAndPropagate(ObjcProvider.DYNAMIC_FRAMEWORK_FILE, objcProvider) .addTransitiveAndPropagate( ObjcProvider.FRAMEWORK_SEARCH_PATH_ONLY, - objcProvider.get(ObjcProvider.STATIC_FRAMEWORK_DIR)) - .addTransitiveAndPropagate( - ObjcProvider.FRAMEWORK_SEARCH_PATH_ONLY, - objcProvider.get(ObjcProvider.DYNAMIC_FRAMEWORK_DIR)) + objcProvider.get(ObjcProvider.FRAMEWORK_DIR)) .build(); return new XcTestAppProvider( intermediateArtifacts.combinedArchitectureBinary(), diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java index 5dbd6962a2..12d80b753d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/XcodeProvider.java @@ -18,13 +18,13 @@ import static com.google.devtools.build.lib.rules.objc.ObjcProvider.BUNDLE_IMPOR import static com.google.devtools.build.lib.rules.objc.ObjcProvider.CC_LIBRARY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.DEFINE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FORCE_LOAD_FOR_XCODEGEN; +import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.FRAMEWORK_SEARCH_PATH_ONLY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.GENERAL_RESOURCE_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.GENERAL_RESOURCE_FILE; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.IMPORTED_LIBRARY; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_DYLIB; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.SDK_FRAMEWORK; -import static com.google.devtools.build.lib.rules.objc.ObjcProvider.STATIC_FRAMEWORK_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.WEAK_SDK_FRAMEWORK; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.XCASSETS_DIR; import static com.google.devtools.build.lib.rules.objc.ObjcProvider.XCDATAMODEL; @@ -651,7 +651,7 @@ public final class XcodeProvider implements TransitiveInfoProvider { .addAllBuildSetting(xcodeprojBuildSettings) .addAllBuildSetting(AppleToolchain.defaultWarningsForXcode()) .addAllSdkFramework(SdkFramework.names(objcProvider.get(SDK_FRAMEWORK))) - .addAllFramework(PathFragment.safePathStrings(objcProvider.get(STATIC_FRAMEWORK_DIR))) + .addAllFramework(PathFragment.safePathStrings(objcProvider.get(FRAMEWORK_DIR))) .addAllFrameworkSearchPathOnly( PathFragment.safePathStrings(objcProvider.get(FRAMEWORK_SEARCH_PATH_ONLY))) .addAllXcassetsDir(PathFragment.safePathStrings(objcProvider.get(XCASSETS_DIR))) |