From 5c940233d7f6b2019ca0539cc833b46ef0478c6f Mon Sep 17 00:00:00 2001 From: Rumou Duan Date: Mon, 29 Jun 2015 18:02:09 +0000 Subject: For each objc target, export all xcdatamodels in the transitive closure to XcodeGen. -- MOS_MIGRATED_REVID=97145288 --- .../devtools/build/lib/rules/objc/ResourceSupport.java | 1 - .../google/devtools/build/lib/rules/objc/XcodeProvider.java | 12 +++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ResourceSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ResourceSupport.java index 66c814cf2d..f1d4194d27 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ResourceSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ResourceSupport.java @@ -45,7 +45,6 @@ final class ResourceSupport { */ ResourceSupport addXcodeSettings(XcodeProvider.Builder xcodeProviderBuilder) { xcodeProviderBuilder.addInputsToXcodegen(Xcdatamodel.inputsToXcodegen(attributes.datamodels())); - xcodeProviderBuilder.addDatamodelDirs(Xcdatamodels.datamodelDirs(attributes.datamodels())); return this; } 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 ec39f401c9..445f50b4b7 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 @@ -25,6 +25,7 @@ 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.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; import static com.google.devtools.build.lib.rules.objc.XcodeProductType.LIBRARY_STATIC; import com.google.common.annotations.VisibleForTesting; @@ -102,7 +103,6 @@ public final class XcodeProvider implements TransitiveInfoProvider { private final NestedSetBuilder additionalSources = NestedSetBuilder.stableOrder(); private final ImmutableList.Builder extensions = new ImmutableList.Builder<>(); private String architecture; - private ImmutableList.Builder datamodelDirs = new ImmutableList.Builder<>(); private boolean generateCompanionLibTarget = false; private ConfigurationDistinguisher configurationDistinguisher; @@ -298,11 +298,6 @@ public final class XcodeProvider implements TransitiveInfoProvider { return this; } - public Builder addDatamodelDirs(Iterable datamodelDirs) { - this.datamodelDirs.addAll(datamodelDirs); - return this; - } - /** * Generates an extra LIBRARY_STATIC Xcode target with the same compilation artifacts. Dependent * Xcode targets will pick this companion library target as its dependency, rather than the @@ -420,7 +415,6 @@ public final class XcodeProvider implements TransitiveInfoProvider { private final NestedSet additionalSources; private final ImmutableList extensions; private final String architecture; - private final ImmutableList datamodelDirs; private final boolean generateCompanionLibTarget; private final ConfigurationDistinguisher configurationDistinguisher; @@ -447,7 +441,6 @@ public final class XcodeProvider implements TransitiveInfoProvider { this.additionalSources = builder.additionalSources.build(); this.extensions = builder.extensions.build(); this.architecture = Preconditions.checkNotNull(builder.architecture); - this.datamodelDirs = builder.datamodelDirs.build(); this.generateCompanionLibTarget = builder.generateCompanionLibTarget; this.configurationDistinguisher = Preconditions.checkNotNull(builder.configurationDistinguisher); @@ -552,7 +545,8 @@ public final class XcodeProvider implements TransitiveInfoProvider { .addAllSdkFramework(SdkFramework.names(objcProvider.get(SDK_FRAMEWORK))) .addAllFramework(PathFragment.safePathStrings(objcProvider.get(FRAMEWORK_DIR))) .addAllXcassetsDir(PathFragment.safePathStrings(objcProvider.get(XCASSETS_DIR))) - .addAllXcdatamodel(PathFragment.safePathStrings(datamodelDirs)) + .addAllXcdatamodel(PathFragment.safePathStrings( + Xcdatamodels.datamodelDirs(objcProvider.get(XCDATAMODEL)))) .addAllBundleImport(PathFragment.safePathStrings(objcProvider.get(BUNDLE_IMPORT_DIR))) .addAllSdkDylib(objcProvider.get(SDK_DYLIB)) .addAllGeneralResourceFile( -- cgit v1.2.3