@@ -40,6 +40,25 @@ echo ""
40
40
41
41
xcodebuild -workspace " ${MY_DIR} /Sourcery.xcworkspace" -scheme " Sourcery-Release" -configuration Release -quiet CONFIGURATION_BUILD_DIR=" ${MY_DIR} /bin/build"
42
42
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
+
43
62
if [ " $dirty " = true ] ; then
44
63
echo " "
45
64
echo " $SMSO Copying (without cleaning)... $RMSO "
0 commit comments