Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion dist/platforms/mac/steps/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,16 @@ elif [[ -n "$UNITY_LICENSING_SERVER" ]]; then
# auditing for divergence from unity-builder's real source).
echo "Requesting floating license"

/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/Frameworks/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client \
# Unity 6000.3+ moved UnityLicensingClient from Contents/Frameworks to
# Contents/Helpers (https://docs.unity.com/en-us/licensing-server/client-config)
# - a hardcoded Frameworks path 127'd ("No such file or directory") on
# every 6000.3+ mac build using a license server (game-ci/unity-builder#842).
UNITY_LICENSING_CLIENT_SUBDIR="Frameworks"
if [[ "$UNITY_VERSION" =~ ^6000\.([3-9]|[1-9][0-9]) ]]; then
UNITY_LICENSING_CLIENT_SUBDIR="Helpers"
fi

"/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/$UNITY_LICENSING_CLIENT_SUBDIR/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client" \
--acquire-floating > license.txt
UNITY_EXIT_CODE=$?

Expand Down
47 changes: 38 additions & 9 deletions dist/platforms/mac/steps/return_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,44 @@
echo "Changing to \"$ACTIVATE_LICENSE_PATH\" directory."
pushd "$ACTIVATE_LICENSE_PATH"

/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \
-logFile - \
-batchmode \
-nographics \
-quit \
-username "$UNITY_EMAIL" \
-password "$UNITY_PASSWORD" \
-returnlicense \
-projectPath "$ACTIVATE_LICENSE_PATH"
if [[ -n "$UNITY_LICENSING_SERVER" ]]; then
#
# Return any floating license used.
#
# This branch was missing entirely - activate.sh's own UNITY_LICENSING_SERVER
# branch acquires a floating license via UnityLicensingClient, but with no
# matching return step here, that license seat was never released back to
# the server after a build, for every single mac floating-license build
# (found while porting game-ci/unity-builder#842's Unity 6000.3+ path fix,
# which patches this exact branch on unity-builder's side).
echo "Returning floating license: \"$FLOATING_LICENSE\""

# Unity 6000.3+ moved UnityLicensingClient from Contents/Frameworks to
# Contents/Helpers (https://docs.unity.com/en-us/licensing-server/client-config) -
# same reasoning as activate.sh's matching acquire-floating call.
UNITY_LICENSING_CLIENT_SUBDIR="Frameworks"
if [[ "$UNITY_VERSION" =~ ^6000\.([3-9]|[1-9][0-9]) ]]; then
UNITY_LICENSING_CLIENT_SUBDIR="Helpers"
fi

"/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/$UNITY_LICENSING_CLIENT_SUBDIR/UnityLicensingClient.app/Contents/MacOS/Unity.Licensing.Client" \
--return-floating "$FLOATING_LICENSE"
elif [[ -n "$UNITY_SERIAL" ]]; then
#
# SERIAL LICENSE MODE
#
# This will return the license that is currently in use.
#
/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity \
-logFile - \
-batchmode \
-nographics \
-quit \
-username "$UNITY_EMAIL" \
-password "$UNITY_PASSWORD" \
-returnlicense \
-projectPath "$ACTIVATE_LICENSE_PATH"
fi

# Return to previous working directory
popd
Loading