You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/shell/run-sonar-swift.sh
+68-59Lines changed: 68 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,7 @@ function runCommand() {
124
124
## COMMAND LINE OPTIONS
125
125
vflag=""
126
126
nflag=""
127
+
unittests="on"
127
128
swiftlint="on"
128
129
lizard="on"
129
130
@@ -132,12 +133,13 @@ do
132
133
case"$1"in
133
134
-v) vflag=on;;
134
135
-n) nflag=on;;
135
-
-noswiftlint) swiftlint="";;
136
-
--) shift;break;;
137
-
-*)
136
+
-nounittests) unittests="";;
137
+
-noswiftlint) swiftlint="";;
138
+
--) shift;break;;
139
+
-*)
138
140
echo>&2"Usage: $0 [-v]"
139
-
exit 1;;
140
-
*) break;; # terminate while loop
141
+
exit 1;;
142
+
*) break;; # terminate while loop
141
143
esac
142
144
shift
143
145
done
@@ -198,9 +200,11 @@ if [ -z "$appScheme" -o "$appScheme" = " " ]; then
198
200
echo>&2"ERROR - sonar.swift.appScheme parameter is missing in sonar-project.properties. You must specify which scheme is used to build your application."
199
201
exit 1
200
202
fi
201
-
if [ -z"$destinationSimulator"-o"$destinationSimulator"="" ];then
202
-
echo>&2"ERROR - sonar.swift.simulator parameter is missing in sonar-project.properties. You must specify which simulator to use."
203
-
exit 1
203
+
if [ "$unittests"="on" ];then
204
+
if [ -z"$destinationSimulator"-o"$destinationSimulator"="" ];then
205
+
echo>&2"ERROR - sonar.swift.simulator parameter is missing in sonar-project.properties. You must specify which simulator to use."
206
+
exit 1
207
+
fi
204
208
fi
205
209
206
210
# if the appConfiguration is not specified then set to Debug
@@ -214,8 +218,12 @@ if [ "$vflag" = "on" ]; then
214
218
echo"Xcode project file is: $projectFile"
215
219
echo"Xcode workspace file is: $workspaceFile"
216
220
echo"Xcode application scheme is: $appScheme"
217
-
echo"Destination simulator is: $destinationSimulator"
218
-
echo"Excluded paths from coverage are: $excludedPathsFromCoverage"
221
+
if [ -n"$unittests"];then
222
+
echo"Destination simulator is: $destinationSimulator"
223
+
echo"Excluded paths from coverage are: $excludedPathsFromCoverage"
224
+
else
225
+
echo"Unit tests are disabled"
226
+
fi
219
227
fi
220
228
221
229
## SCRIPT
@@ -234,56 +242,57 @@ fi
234
242
rm -rf sonar-reports
235
243
mkdir sonar-reports
236
244
237
-
# Unit tests and coverage
238
-
239
-
# Put default xml files with no tests and no coverage...
0 commit comments