-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
417bfd1
commit 0883c18
Showing
13 changed files
with
179 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Documentation: | ||
# This script creates a new project version for the current project. | ||
# You can customize this to fit your project when you copy these scripts. | ||
# You can pass in a custom branch if you don't want to use the default one. | ||
# This script creates a new project version for the package. | ||
# You can pass in a BRANCH to not use the default git branch. | ||
|
||
NAME="SwiftUIKit" | ||
DEFAULT_BRANCH="main" | ||
BRANCH=${1:-$DEFAULT_BRANCH} | ||
SCRIPT="scripts/version.sh" | ||
chmod +x $SCRIPT | ||
bash $SCRIPT $NAME $BRANCH | ||
SCRIPT="scripts/package_version.sh" | ||
chmod +x $SCRIPT && bash $SCRIPT $BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Documentation: | ||
# This script builds DocC documentation for `Package.swift`. | ||
# This script targets iOS by default, but you can pass in custom <PLATFORMS>. | ||
|
||
# Usage: | ||
# package_docc.sh [<PLATFORMS> default:iOS] | ||
# e.g. `bash scripts/package_docc.sh iOS macOS` | ||
|
||
# Exit immediately if a command exits with non-zero status | ||
set -e | ||
|
||
# Use the script folder to refer to other scripts. | ||
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
SCRIPT_PACKAGE_NAME="$FOLDER/package_name.sh" | ||
SCRIPT_DOCC="$FOLDER/docc.sh" | ||
|
||
# Define platforms variable | ||
if [ $# -eq 0 ]; then | ||
set -- iOS | ||
fi | ||
PLATFORMS=$@ | ||
|
||
# Get package name | ||
PACKAGE_NAME=$("$SCRIPT_PACKAGE_NAME") || { echo "Failed to get package name"; exit 1; } | ||
|
||
# Build package documentation | ||
bash $SCRIPT_DOCC $PACKAGE_NAME $PLATFORMS || { echo "DocC script failed"; exit 1; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Documentation: | ||
# This script generates an XCFramework for `Package.swift`. | ||
# This script targets iOS by default, but you can pass in custom <PLATFORMS>. | ||
|
||
# Usage: | ||
# package_framework.sh [<PLATFORMS> default:iOS] | ||
# e.g. `bash scripts/package_framework.sh iOS macOS` | ||
|
||
# Exit immediately if a command exits with non-zero status | ||
set -e | ||
|
||
# Use the script folder to refer to other scripts. | ||
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
SCRIPT_PACKAGE_NAME="$FOLDER/package_name.sh" | ||
SCRIPT_FRAMEWORK="$FOLDER/framework.sh" | ||
|
||
# Define platforms variable | ||
if [ $# -eq 0 ]; then | ||
set -- iOS | ||
fi | ||
PLATFORMS=$@ | ||
|
||
# Get package name | ||
PACKAGE_NAME=$("$SCRIPT_PACKAGE_NAME") || { echo "Failed to get package name"; exit 1; } | ||
|
||
# Build package framework | ||
bash $SCRIPT_FRAMEWORK $PACKAGE_NAME $PLATFORMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Documentation: | ||
# This script creates a new version for `Package.swift`. | ||
# You can pass in a <BRANCH> to validate any non-main branch. | ||
|
||
# Usage: | ||
# package_version.sh <BRANCH default:main> | ||
# e.g. `bash scripts/package_version.sh master` | ||
|
||
# Exit immediately if a command exits with non-zero status | ||
set -e | ||
|
||
# Use the script folder to refer to other scripts. | ||
FOLDER="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
SCRIPT_BRANCH_NAME="$FOLDER/git_default_branch.sh" | ||
SCRIPT_PACKAGE_NAME="$FOLDER/package_name.sh" | ||
SCRIPT_VERSION="$FOLDER/version.sh" | ||
|
||
# Get branch name | ||
DEFAULT_BRANCH=$("$SCRIPT_BRANCH_NAME") || { echo "Failed to get branch name"; exit 1; } | ||
BRANCH_NAME=${1:-$DEFAULT_BRANCH} | ||
|
||
# Get package name | ||
PACKAGE_NAME=$("$SCRIPT_PACKAGE_NAME") || { echo "Failed to get package name"; exit 1; } | ||
|
||
# Build package version | ||
bash $SCRIPT_VERSION $PACKAGE_NAME $BRANCH_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Documentation: | ||
# This script syncs Swift Package Scripts from a <FOLDER>. | ||
# This script will overwrite the existing "scripts" folder. | ||
# Only pass in the full path to a Swift Package Scripts root. | ||
|
||
# Usage: | ||
# package_name.sh <FOLDER> | ||
# e.g. `bash sync_from.sh ../SwiftPackageScripts` | ||
|
||
# Define argument variables | ||
SOURCE=$1 | ||
|
||
# Define variables | ||
FOLDER="scripts/" | ||
SOURCE_FOLDER="$SOURCE/$FOLDER" | ||
|
||
# Start script | ||
echo "" | ||
echo "Syncing scripts from $SOURCE_FOLDER..." | ||
echo "" | ||
|
||
# Remove existing folder | ||
rm -rf $FOLDER | ||
|
||
# Copy folder | ||
cp -r "$SOURCE_FOLDER/" "$FOLDER/" | ||
|
||
# Complete successfully | ||
echo "" | ||
echo "Script syncing from $SOURCE_FOLDER completed successfully!" | ||
echo "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters