Skip to content

Commit

Permalink
Add flag to disable automatic xcodeproj generation.
Browse files Browse the repository at this point in the history
RELNOTES: Removed .xcodeproj automatic output from objc rules. It can still be generated by requesting it explicitly on the command line.

--
PiperOrigin-RevId: 147202001
MOS_MIGRATED_REVID=147202001
  • Loading branch information
aragos authored and dslomov committed Feb 13, 2017
1 parent b95d4a9 commit 827bb31
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ public class ObjcCommandLineOptions extends FragmentOptions {
)
public boolean deviceDebugEntitlements;

@Option(
name = "deprecated_generate_xcode_project",
defaultValue = "true",
category = "flags",
help =
"If set, will generate xcode project for targets that support this. Will be removed soon."
)
public boolean generateXcodeProject;

/**
* Specifies the circumstances under which a CROSSTOOL is used for objc in this configuration.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment {
private final HeaderDiscovery.DotdPruningMode dotdPruningPlan;
private final boolean experimentalHeaderThinning;
private final Label objcHeaderScannerTool;
private final boolean generateXcodeProject;

ObjcConfiguration(ObjcCommandLineOptions objcOptions, BuildConfiguration.Options options,
@Nullable BlazeDirectories directories) {
Expand Down Expand Up @@ -122,6 +123,7 @@ public class ObjcConfiguration extends BuildConfiguration.Fragment {
: HeaderDiscovery.DotdPruningMode.DO_NOT_USE;
this.experimentalHeaderThinning = objcOptions.experimentalObjcHeaderThinning;
this.objcHeaderScannerTool = objcOptions.objcHeaderScannerTool;
this.generateXcodeProject = objcOptions.generateXcodeProject;
}

/**
Expand Down Expand Up @@ -355,4 +357,11 @@ public boolean useExperimentalHeaderThinning() {
public Label getObjcHeaderScannerTool() {
return objcHeaderScannerTool;
}

/**
* Returns {@code true} if an xcodegen project should be added to a target's files to build.
*/
public boolean generateXcodeProject() {
return this.generateXcodeProject;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public XcodeSupport(
*/
XcodeSupport addFilesToBuild(NestedSetBuilder<Artifact> filesToBuild)
throws InterruptedException {
filesToBuild.add(ruleContext.getImplicitOutputArtifact(PBXPROJ));
if (ObjcRuleClasses.objcConfiguration(ruleContext).generateXcodeProject()) {
filesToBuild.add(ruleContext.getImplicitOutputArtifact(PBXPROJ));
}

return this;
}

Expand Down

0 comments on commit 827bb31

Please sign in to comment.