Exemple #1
0
  private void registerXcodegenActions(XcodeProvider.Project project) {
    Artifact controlFile =
        ObjcRuleClasses.intermediateArtifacts(ruleContext).pbxprojControlArtifact();

    ruleContext.registerAction(
        new BinaryFileWriteAction(
            ruleContext.getActionOwner(),
            controlFile,
            xcodegenControlFileBytes(project),
            /*makeExecutable=*/ false));

    ruleContext.registerAction(
        new SpawnAction.Builder()
            .setMnemonic("GenerateXcodeproj")
            .setExecutable(ruleContext.getExecutablePrerequisite("$xcodegen", Mode.HOST))
            .addArgument("--control")
            .addInputArgument(controlFile)
            .addOutput(ruleContext.getImplicitOutputArtifact(XcodeSupport.PBXPROJ))
            .addTransitiveInputs(project.getInputsToXcodegen())
            .build(ruleContext));
  }
Exemple #2
0
 /**
  * Registers actions that generate the rule's Xcode project.
  *
  * @param xcodeProvider information about this rule's xcode settings and that of its dependencies
  * @return this xcode support
  */
 XcodeSupport registerActions(XcodeProvider xcodeProvider) {
   registerXcodegenActions(XcodeProvider.Project.fromTopLevelTarget(xcodeProvider));
   return this;
 }