Commits

Diederik Hoogenboom  committed 67ff467

Added support for workspaces and schemes

  • Participants
  • Parent commits 60d21b1

Comments (0)

Files changed (5)

File src/main/java/com/atlassian/bamboo/plugins/xcode/build/XCodeConfigurator.java

     public static final String SDK = "label";
     public static final String CLEAN = "clean";
     public static final String PROJECT = "projectname";
+    public static final String WORKSPACE = "workspacename";
+    public static final String SCHEME = "schemename";
     public static final String WORKING_SUB_DIR = "workingSubDirectory";
     public static final String ENVIRONMENT = "environmentVariables";
     public static final String OCUNIT = "ocunit";
             .add(ALL_TARGETS)
             .add(CONFIGURATION)
             .add(PROJECT)
+	        .add(WORKSPACE)
+		    .add(SCHEME)
             .add(SDK)
             .add(CLEAN)
             .add(WORKING_SUB_DIR)

File src/main/java/com/atlassian/bamboo/plugins/xcode/build/XCodeTaskType.java

         {
             final ConfigurationMap configurationMap = taskContext.getConfigurationMap();
             final String project = configurationMap.get(XCodeConfigurator.PROJECT);
+            final String workspace = configurationMap.get(XCodeConfigurator.WORKSPACE);
+            final String scheme = configurationMap.get(XCodeConfigurator.SCHEME);
             final boolean shouldClean = configurationMap.getAsBoolean(XCodeConfigurator.CLEAN);
             final File workingDirectory = taskContext.getWorkingDirectory();
             if (shouldClean)
                     arguments.add(project);
                 }
 
+                if (StringUtils.isNotEmpty(workspace))
+                {
+                    arguments.add("-workspace");
+                    arguments.add(workspace);
+                }
+
+                if (StringUtils.isNotEmpty(scheme))
+                {
+                    arguments.add("-scheme");
+                    arguments.add(scheme);
+                }
+
                 arguments.add(XCodeBuild.XCODEBUILD_ARG_CLEAN);
 
                 resultBuilder.checkReturnCode(processService.executeProcess(taskContext, new ExternalProcessBuilder()
                 arguments.add(project);
             }
 
+            if (StringUtils.isNotEmpty(workspace))
+            {
+                arguments.add("-workspace");
+                arguments.add(workspace);
+            }
+
+            if (StringUtils.isNotEmpty(scheme))
+            {
+                arguments.add("-scheme");
+                arguments.add(scheme);
+            }
+
             if (buildAllTargets)
             {
                 arguments.add("-alltargets");

File src/main/resources/com/atlassian/bamboo/plugins/xcode/build/editXcodeTask.ftl

 
 [@ww.checkbox labelKey="xcode.clean" name="clean"/]
 [@ww.textfield labelKey='xcode.project' name='projectname' cssClass="long-field"/]
+[@ww.textfield labelKey='xcode.workspace' name='workspacename' cssClass="long-field"/]
+[@ww.textfield labelKey='xcode.scheme' name='schemename' cssClass="long-field"/]
 
 [@ww.checkbox labelKey="xcode.buildall" name="alltargets"/]
 [@ui.bambooSection dependsOn='alltargets']

File src/main/resources/com/atlassian/bamboo/plugins/xcode/build/viewXcodeTask.ftl

 [@ww.label labelKey='xcode.sdk' name='label' /]
 [@ww.label labelKey='xcode.project' name='projectname' hideOnNull='true' /]
+[@ww.label labelKey='xcode.workspace' name='workspacename' hideOnNull='true' /]
+[@ww.label labelKey='xcode.scheme' name='schemename' hideOnNull='true' /]
 
 [#if alltargets == 'true']
     [@ww.label labelKey="xcode.target" value='This Task will build all targets' /]

File src/main/resources/i18n.properties

 xcode.project = Project
 xcode.project.description = Name of the Xcode Project to build
 
+xcode.workspace = Workspace
+xcode.workspace.description = Name of the Xcode Workspace to build. Make sure to enable the workspace for sharing.
+
+xcode.scheme = Scheme
+xcode.scheme.description = Name of the Xcode Scheme to build. Required when using a workspace.
+
 xcode.buildall = Build all Targets?
 xcode.buildall.description = Do you want to build all targets in the Xcode project?