Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove obsolete "-activetarget" flag
It is not longer supported by XCode.

[FIXED JENKINS-23008]
  • Loading branch information
rodrigc committed May 11, 2015
1 parent afa77a1 commit b970f52
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Expand Up @@ -64,11 +64,17 @@ public void setInstallations( ClangScanBuildToolInstallation[] clangInstallation
save();
}

public FormValidation doCheckTarget( @QueryParameter String value ) throws IOException, ServletException {
if( value.length() == 0 ) return FormValidation.error( "You must provide a target." );
return FormValidation.ok();
}


public FormValidation doCheckTargetSdk( @QueryParameter String value ) throws IOException, ServletException {
if( value.length() == 0 ) return FormValidation.error( "You must provide a target SDK. You can execute 'xcodebuild -showsdks' from Terminal.app to see allowed values." );
return FormValidation.ok();
}

// CONFIG
public FormValidation doCheckConfig( @QueryParameter String value ) throws IOException, ServletException {
if( value.length() == 0 ) return FormValidation.warning( "If no build configuration is provided, the project's 'active' build configuration will be used automatically." );
Expand Down
@@ -1,6 +1,7 @@
package jenkins.plugins.clangscanbuild.commands;

import hudson.FilePath;
import hudson.model.Failure;
import hudson.util.ArgumentListBuilder;
import jenkins.plugins.clangscanbuild.CommandExecutor;

Expand Down Expand Up @@ -68,11 +69,10 @@ public int execute( BuildContext context ) throws Exception {
}
}else{
// Xcode standalone project
if( isNotBlank( getTarget() ) ){
args.add( "-target", getTarget() );
}else{
args.add( "-activetarget" );
if( isBlank( getTarget() ) ){
throw new Failure("No target specified");
}
args.add( "-target", getTarget() );
}

//These items can be provided with a target or can be used to override a workspace/scheme
Expand Down
Expand Up @@ -21,10 +21,11 @@ public void onlyRequiredOptionsSet() throws Exception{
command.setClangOutputFolder( new FilePath( new File( "OutputFolder" ) ) );
command.setClangScanBuildPath( "/ScanBuild" );
command.setProjectDirectory( new FilePath( new File( "/ProjectDir" ) ) );
command.setTarget( "myTarget" );

String actual = buildCommandAndReturn( command );

String expected = "/ScanBuild -k -v -v -o OutputFolder xcodebuild -activetarget -configuration Debug clean analyze";
String expected = "/ScanBuild -k -v -v -o OutputFolder xcodebuild -target myTarget -configuration Debug clean analyze";
Assert.assertEquals( expected, actual );
}

Expand Down

0 comments on commit b970f52

Please sign in to comment.