Skip to content

Commit b970f52

Browse files
committedMay 11, 2015
Remove obsolete "-activetarget" flag
It is not longer supported by XCode. [FIXED JENKINS-23008]
1 parent afa77a1 commit b970f52

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed
 

‎src/main/java/jenkins/plugins/clangscanbuild/ClangScanBuildDescriptor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,17 @@ public void setInstallations( ClangScanBuildToolInstallation[] clangInstallation
6464
save();
6565
}
6666

67+
public FormValidation doCheckTarget( @QueryParameter String value ) throws IOException, ServletException {
68+
if( value.length() == 0 ) return FormValidation.error( "You must provide a target." );
69+
return FormValidation.ok();
70+
}
71+
72+
6773
public FormValidation doCheckTargetSdk( @QueryParameter String value ) throws IOException, ServletException {
6874
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." );
6975
return FormValidation.ok();
7076
}
71-
77+
7278
// CONFIG
7379
public FormValidation doCheckConfig( @QueryParameter String value ) throws IOException, ServletException {
7480
if( value.length() == 0 ) return FormValidation.warning( "If no build configuration is provided, the project's 'active' build configuration will be used automatically." );

‎src/main/java/jenkins/plugins/clangscanbuild/commands/ScanBuildCommand.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package jenkins.plugins.clangscanbuild.commands;
22

33
import hudson.FilePath;
4+
import hudson.model.Failure;
45
import hudson.util.ArgumentListBuilder;
56
import jenkins.plugins.clangscanbuild.CommandExecutor;
67

@@ -68,11 +69,10 @@ public int execute( BuildContext context ) throws Exception {
6869
}
6970
}else{
7071
// Xcode standalone project
71-
if( isNotBlank( getTarget() ) ){
72-
args.add( "-target", getTarget() );
73-
}else{
74-
args.add( "-activetarget" );
72+
if( isBlank( getTarget() ) ){
73+
throw new Failure("No target specified");
7574
}
75+
args.add( "-target", getTarget() );
7676
}
7777

7878
//These items can be provided with a target or can be used to override a workspace/scheme

‎src/test/java/jenkins/plugins/clangscanbuild/commands/ScanBuildCommandTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ public void onlyRequiredOptionsSet() throws Exception{
2121
command.setClangOutputFolder( new FilePath( new File( "OutputFolder" ) ) );
2222
command.setClangScanBuildPath( "/ScanBuild" );
2323
command.setProjectDirectory( new FilePath( new File( "/ProjectDir" ) ) );
24+
command.setTarget( "myTarget" );
2425

2526
String actual = buildCommandAndReturn( command );
2627

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

0 commit comments

Comments
 (0)
Please sign in to comment.