279279rm -rf sonar-reports
280280mkdir sonar-reports
281281
282- # Extracting project information needed later
283- buildCmd=($XCODEBUILD_CMD clean build)
284- echo -n ' Extracting Xcode project information'
282+ # Build and extract project information needed later
283+ buildCmd=($XCODEBUILD_CMD clean build-for-testing )
284+ echo -n ' Building & extracting Xcode project information'
285285if [[ " $workspaceFile " != " " ]] ; then
286286 buildCmd+=(-workspace " $workspaceFile " )
287287else
@@ -300,20 +300,19 @@ hasObjC="no"
300300compileCmdFile=compile_commands.json
301301minimumSize=3
302302actualSize=$( stat -f%z " $compileCmdFile " )
303- echo " actual = $actualSize , min = $minimumSize "
304303if [ $actualSize -ge $minimumSize ]; then
305304 hasObjC=" yes"
306305fi
307306
308- # Unit surefire and coverage
307+ # Tests : surefire and coverage
309308if [ " $unittests " = " on" ]; then
310309
311310 # Put default xml files with no surefire and no coverage...
312311 echo " <?xml version='1.0' encoding='UTF-8' standalone='yes'?><testsuites name='AllTestUnits'></testsuites>" > sonar-reports/TEST-report.xml
313312 echo " <?xml version='1.0' ?><!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'><coverage><sources></sources><packages></packages></coverage>" > sonar-reports/coverage-swift.xml
314313
315- echo -n ' Running surefire '
316- buildCmd=($XCODEBUILD_CMD clean build test)
314+ echo -n ' Running tests '
315+ buildCmd=($XCODEBUILD_CMD test)
317316 if [[ ! -z " $workspaceFile " ]]; then
318317 buildCmd+=(-workspace " $workspaceFile " )
319318 elif [[ ! -z " $projectFile " ]]; then
0 commit comments