Skip to content

Commit ca75911

Browse files
author
Harald
committed
Add artifact-bundle build step
1 parent 109abae commit ca75911

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

Resources/info.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"schemaVersion": "1.0",
3+
"artifacts": {
4+
"objectbox-generator": {
5+
"version": "1.1.0",
6+
"type": "executable",
7+
"variants": [
8+
{
9+
"path": "Contents/MacOS/Sourcery",
10+
"supportedTriples": ["x86_64-apple-macosx", "arm64-apple-macosx"]
11+
}
12+
]
13+
}
14+
}
15+
}

_build.command

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,25 @@ echo ""
4040

4141
xcodebuild -workspace "${MY_DIR}/Sourcery.xcworkspace" -scheme "Sourcery-Release" -configuration Release -quiet CONFIGURATION_BUILD_DIR="${MY_DIR}/bin/build"
4242

43+
# The Swift Package Manager requires an artifact bundle, not an app.
44+
# Therefore, create the artifact bundle from the app.
45+
# The name needs to be changed, since the Sourcery is already taken by Sourcery itself.
46+
# The internals can stay unchanged because names are adjusted in the reuqired info.json file.
47+
rm -rf "${MY_DIR}/bin/ObjectBoxGenerator.artifactbundle/"
48+
cp -r "${MY_DIR}/bin/build/Sourcery.app/" "${MY_DIR}/bin/ObjectBoxGenerator.artifactbundle"
49+
# Fix the version, and add the required info.json to the artifact bundle
50+
OBECTBOX_GENERATOR_VERSION=$(./bin/build/Sourcery.app/Contents/MacOS/Sourcery --version)
51+
echo "GEN: $OBECTBOX_GENERATOR_VERSION"
52+
jq --arg new_version "$OBECTBOX_GENERATOR_VERSION" \
53+
'.artifacts["objectbox-generator"].version = $new_version' \
54+
"${MY_DIR}/Resources/info.json" > \
55+
"${MY_DIR}/bin/ObjectBoxGenerator.artifactbundle/info.json"
56+
# Create the zip file we want to deploy
57+
rm -f "${MY_DIR}/bin/ObjectBox.artifactbundle.zip"
58+
( cd "${MY_DIR}/bin/ObjectBoxGenerator.artifactbundle" && zip -r --symlinks "${MY_DIR}/bin/ObjectBoxGenerator.artifactbundle.zip" . )
59+
# add the sha256 for the zip file
60+
( cd ${MY_DIR}/bin/ && shasum -a 256 "ObjectBoxGenerator.artifactbundle.zip" > "ObjectBoxGenerator.artifactbundle.zip.sha256" )
61+
4362
if [ "$dirty" = true ] ; then
4463
echo ""
4564
echo "$SMSO Copying (without cleaning)... $RMSO"

0 commit comments

Comments
 (0)