From 498ef53f9b36230adce79a64f1237ab3971ae54c Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Tue, 25 Aug 2015 14:16:48 +0000 Subject: Link to tools/objc/dummy.c from output directory to allow xcodeproj to resolve the file even while outside a workspace which contains it -- MOS_MIGRATED_REVID=101462428 --- .../devtools/build/lib/rules/objc/IntermediateArtifacts.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java index 754adc96fd..5c46270b1f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java @@ -17,6 +17,7 @@ package com.google.devtools.build.lib.rules.objc; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.devtools.build.lib.actions.Artifact; +import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.syntax.Label; import com.google.devtools.build.lib.vfs.FileSystemUtils; @@ -73,6 +74,15 @@ final class IntermediateArtifacts { return scopedArtifact(name.replaceName(name.getBaseName() + extension)); } + /** + * A dummy .c file to be included in xcode projects. This is needed if the target does not have + * any source files but Xcode requires one. + */ + public Artifact dummySource() { + return scopedArtifact( + ruleContext.getPrerequisiteArtifact("$dummy_source", Mode.TARGET).getRootRelativePath()); + } + /** * The output of using {@code actoolzip} to run {@code actool} for a given bundle which is * merged under the {@code .app} or {@code .bundle} directory root. -- cgit v1.2.3