Skip to content

Commit cebcbc7

Browse files
committed
Add swiftlint option to release validation script
1 parent cf243ce commit cebcbc7

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Beta version tags and releases are removed after the next minor or major version.
1111

1212

13-
## 1.2
13+
## 1.1
1414

1515
This version adds a new `xcframework.yml` GitHub workflow template, and adds new script parameters.
1616

@@ -25,16 +25,6 @@ This version adds a new `xcframework.yml` GitHub workflow template, and adds new
2525

2626

2727

28-
## 1.1
29-
30-
This version adds dSYM option to `framework.sh`.
31-
32-
## 💡 Changes
33-
34-
* `framework.sh` now allows you to pass in `--dSyms/-d 1` to enable dSYM build.
35-
36-
37-
3828
## 1.0.1
3929

4030
This version updates `docc.sh` to support DocC hosted on a custom domain.

scripts/validate_release.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ show_usage() {
1212
echo "Usage: $0 [TARGET] [-p|--platforms <PLATFORM1> <PLATFORM2> ...]"
1313
echo " [TARGET] Optional. The target to validate (defaults to package name)"
1414
echo " -p, --platforms Optional. List of platforms (default: iOS macOS tvOS watchOS xrOS)"
15-
15+
echo " --swiftlint Optional. Run SwiftLint (1) or skip it (0) (default: 1)"
16+
1617
echo
1718
echo "This script will:"
1819
echo " * Validate that swiftlint passes"
@@ -23,7 +24,7 @@ show_usage() {
2324
echo " $0"
2425
echo " $0 MyTarget"
2526
echo " $0 -p iOS macOS"
26-
echo " $0 MyTarget -p iOS macOS"
27+
echo " $0 MyTarget -p iOS macOS --swiftlint 0"
2728
echo " $0 MyTarget --platforms iOS macOS tvOS watchOS xrOS"
2829
echo
2930
}
@@ -49,6 +50,7 @@ show_error_and_exit() {
4950
# Define argument variables
5051
TARGET=""
5152
PLATFORMS="iOS macOS tvOS watchOS xrOS" # Default platforms
53+
SWIFTLINT=1 # Default to running SwiftLint
5254

5355
# Parse command line arguments
5456
while [[ $# -gt 0 ]]; do
@@ -69,6 +71,14 @@ while [[ $# -gt 0 ]]; do
6971
show_usage_error_and_exit "--platforms requires at least one platform"
7072
fi
7173
;;
74+
--swiftlint)
75+
shift
76+
if [[ "$1" != "0" && "$1" != "1" ]]; then
77+
show_usage_error_and_exit "--swiftlint requires 0 or 1"
78+
fi
79+
SWIFTLINT="$1"
80+
shift
81+
;;
7282
-h|--help)
7383
show_usage; exit 0 ;;
7484
-*)
@@ -136,19 +146,23 @@ echo
136146
echo "Validating project for target '$TARGET' with platforms [$PLATFORMS]..."
137147

138148
# Run SwiftLint
139-
echo "Running SwiftLint..."
140-
if ! swiftlint --strict; then
141-
show_error_and_exit "SwiftLint failed"
149+
if [ "$SWIFTLINT" = "1" ]; then
150+
echo "Running SwiftLint..."
151+
if ! swiftlint --strict; then
152+
show_error_and_exit "SwiftLint failed"
153+
fi
154+
echo "SwiftLint passed"
155+
else
156+
echo "Skipping SwiftLint (disabled)"
142157
fi
143-
echo "SwiftLint passed"
144158

145159
# Validate git
146160
echo "Validating git..."
147161
run_script "$SCRIPT_VALIDATE_GIT"
148162

149163
# Run unit tests
150164
echo "Running unit tests..."
151-
run_script "$SCRIPT_TEST" "$TARGET" -p $PLATFORMS
165+
run_script $SCRIPT_TEST $TARGET -p $PLATFORMS
152166

153167
# Complete successfully
154168
echo

0 commit comments

Comments
 (0)