Skip to content

Commit

Permalink
Use $PROJECT_DIR instead of $SRCROOT (#2489)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo authored Jan 13, 2024
1 parent 9e9830e commit 001d6d6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
28 changes: 14 additions & 14 deletions Configurations/make-release-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ if [ "$ACTION" = "" ] ; then

mkdir -p "$CONFIGURATION_BUILD_DIR/staging"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp "$SRCROOT/CHANGELOG" "$SRCROOT/LICENSE" "$SRCROOT/INSTALL" "$SRCROOT/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$SRCROOT/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging"
cp "$PROJECT_DIR/CHANGELOG" "$PROJECT_DIR/LICENSE" "$PROJECT_DIR/INSTALL" "$PROJECT_DIR/Resources/SampleAppcast.xml" "$CONFIGURATION_BUILD_DIR/staging-spm"
cp -R "$PROJECT_DIR/bin" "$CONFIGURATION_BUILD_DIR/staging"
cp "$CONFIGURATION_BUILD_DIR/BinaryDelta" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_appcast" "$CONFIGURATION_BUILD_DIR/staging/bin"
cp "$CONFIGURATION_BUILD_DIR/generate_keys" "$CONFIGURATION_BUILD_DIR/staging/bin"
Expand All @@ -50,8 +50,8 @@ if [ "$ACTION" = "" ] ; then
mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Entitlements"
mkdir -p "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements"

cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_NAME.entitlements"
cp -R "$SRCROOT/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_NAME.entitlements"
cp -R "$PROJECT_DIR/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging/Entitlements/$DOWNLOADER_NAME.entitlements"
cp -R "$PROJECT_DIR/Downloader/org.sparkle-project.Downloader.entitlements" "$CONFIGURATION_BUILD_DIR/staging-spm/Entitlements/$DOWNLOADER_NAME.entitlements"
fi

mkdir -p "$CONFIGURATION_BUILD_DIR/staging/Symbols"
Expand Down Expand Up @@ -119,7 +119,7 @@ if [ "$ACTION" = "" ] ; then
rm -rf "$CONFIGURATION_BUILD_DIR/staging"

# Get latest git tag
cd "$SRCROOT"
cd "$PROJECT_DIR"
latest_git_tag=$( git describe --tags --abbrev=0 || true )

if [ -n "$latest_git_tag" ] ; then
Expand All @@ -138,7 +138,7 @@ if [ "$ACTION" = "" ] ; then
rm -rf "/tmp/sparkle-spm-extract"
rm -rf "$CONFIGURATION_BUILD_DIR/staging-spm"

cd "$SRCROOT"
cd "$PROJECT_DIR"

# Check semantic versioning
if [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then
Expand All @@ -150,9 +150,9 @@ if [ "$ACTION" = "" ] ; then

# Generate new Package manifest, podspec, and carthage files
cd "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$SRCROOT/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Package.swift" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Sparkle.podspec" "$CONFIGURATION_BUILD_DIR"
cp "$PROJECT_DIR/Carthage-dev.json" "$CONFIGURATION_BUILD_DIR"
fi

if [ -z "$latest_git_tag" ] ; then
Expand All @@ -162,18 +162,18 @@ if [ "$ACTION" = "" ] ; then
spm_checksum=$(swift package compute-checksum "Sparkle-for-Swift-Package-Manager.zip")
rm -rf ".build"
sed -E -i '' -e "/let tag/ s/\".+\"/\"$latest_git_tag\"/" -e "/let version/ s/\".+\"/\"$MARKETING_VERSION\"/" -e "/let checksum/ s/[[:xdigit:]]{64}/$spm_checksum/" "Package.swift"
cp "Package.swift" "$SRCROOT"
cp "Package.swift" "$PROJECT_DIR"
echo "Package.swift updated with the following values:"
echo "Version: $MARKETING_VERSION"
echo "Tag: $latest_git_tag"
echo "Checksum: $spm_checksum"

sed -E -i '' -e "/s\.version.+=/ s/\".+\"/\"$MARKETING_VERSION\"/" "Sparkle.podspec"

"$SRCROOT/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
cp "Sparkle.podspec" "$SRCROOT"
"$PROJECT_DIR/Configurations/update-carthage.py" "Carthage-dev.json" "$MARKETING_VERSION"
cp "Sparkle.podspec" "$PROJECT_DIR"
# Note the Carthage-dev.json file will finally be copied to the website repo in Carthage/Sparkle.json in the end
cp "Carthage-dev.json" "$SRCROOT"
cp "Carthage-dev.json" "$PROJECT_DIR"
echo "Sparkle.podspec and Carthage-dev.json updated with following values:"
echo "Version: $MARKETING_VERSION"
else
Expand Down
4 changes: 2 additions & 2 deletions Configurations/set-git-version-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if ! which -s git ; then
exit 0
fi

if [ -z "$SRCROOT" ] || \
if [ -z "$PROJECT_DIR" ] || \
[ -z "$BUILT_PRODUCTS_DIR" ] || \
[ -z "$INFOPLIST_PATH" ] || \
[ -z "$MARKETING_VERSION" ]; then
Expand All @@ -16,7 +16,7 @@ fi
version="$MARKETING_VERSION"

# Get version in format 1.x.x-commits-hash
gitversion=$( cd "$SRCROOT"; git describe --tags --match '[12].*' || true )
gitversion=$( cd "$PROJECT_DIR"; git describe --tags --match '[12].*' || true )
if [ -z "$gitversion" ] ; then
echo "$0: Can't find a Git hash!" 1>&2
exit 0
Expand Down
10 changes: 5 additions & 5 deletions Sparkle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@
/* Begin PBXLegacyTarget section */
14732BC51960F69300593899 /* Distribution */ = {
isa = PBXLegacyTarget;
buildArgumentsString = "$(SRCROOT)/Configurations/make-release-package.sh $(ACTION)";
buildArgumentsString = "$(PROJECT_DIR)/Configurations/make-release-package.sh $(ACTION)";
buildConfigurationList = 14732BC61960F69300593899 /* Build configuration list for PBXLegacyTarget "Distribution" */;
buildPhases = (
);
Expand Down Expand Up @@ -3283,7 +3283,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/set-git-version-info.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/set-git-version-info.sh\"\n";
showEnvVarsInLog = 0;
};
72045CE626FEE8CC004F96E5 /* Strip Framework */ = {
Expand All @@ -3303,7 +3303,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/strip-framework.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/strip-framework.sh\"\n";
};
720B4C2125EBFAA5005A0592 /* Run Script: Link Tools */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -3322,7 +3322,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/link-tools.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/link-tools.sh\"\n";
};
895C5DC524D78E460058A82D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -3339,7 +3339,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/Configurations/make-xcframework.sh\"\n";
shellScript = "\"$PROJECT_DIR/Configurations/make-xcframework.sh\"\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
4 changes: 2 additions & 2 deletions Sparkle/SUStatus.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22504"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down

0 comments on commit 001d6d6

Please sign in to comment.