Anonymous avatar Anonymous committed b0319a5

Added validation for scheme (a scheme is required with a workspace)
Exclude target parameter when a scheme is provided.

Comments (0)

Files changed (3)

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

                 errorCollection.addError(APP_PATH, textProvider.getText("xcode.app_path.error"));
             }
         }
+
+        if (StringUtils.isNotEmpty(params.getString(WORKSPACE)) && StringUtils.isEmpty(params.getString(SCHEMA)))
+        {
+            errorCollection.addError(SDK, textProvider.getText("xcode.scheme.error"));
+        }
+        
     }
 
     @NotNull

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

                 arguments.add(scheme);
             }
 
-            if (buildAllTargets)
+            if (StringUtils.isEmpty(scheme))
             {
-                arguments.add("-alltargets");
-            }
-            else if (StringUtils.isNotEmpty(target))
-            {
-                arguments.add("-target");
-                arguments.add(target);
+                if (buildAllTargets)
+                {
+                    arguments.add("-alltargets");
+                }
+                else if (StringUtils.isNotEmpty(target))
+                {
+                    arguments.add("-target");
+                    arguments.add(target);
+                }
             }
 
             if (StringUtils.isNotEmpty(configuration))

src/main/resources/i18n.properties

 
 xcode.scheme = Scheme
 xcode.scheme.description = Name of the Xcode Scheme to build. Required when using a workspace.
+xcode.scheme.error = If you specify a Workspace then you must also specify a Scheme. 
 
 xcode.buildall = Build all Targets?
 xcode.buildall.description = Do you want to build all targets in the Xcode project?
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.