From d77a456391b4dcf4c11bc9d4b3baeba601ce85a8 Mon Sep 17 00:00:00 2001 From: Nic van Dessel <51134175+nvandessel@users.noreply.github.com> Date: Thu, 14 Mar 2024 09:54:35 -0700 Subject: [PATCH 1/2] fix: registry incorrectly added to manifest when package testing --- dist/platforms/ubuntu/run_tests.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dist/platforms/ubuntu/run_tests.sh b/dist/platforms/ubuntu/run_tests.sh index 20fb3785..4c50acc6 100755 --- a/dist/platforms/ubuntu/run_tests.sh +++ b/dist/platforms/ubuntu/run_tests.sh @@ -95,17 +95,28 @@ if [ "$PACKAGE_MODE" = "true" ]; then fi PACKAGE_MANIFEST_JSON=$(cat "$PACKAGE_MANIFEST_PATH") - echo "$PACKAGE_MANIFEST_JSON" | \ + if [ -z "$SCOPED_REGISTRY_URL" || -z "$REGISTRY_SCOPES" ]; then + echo "$PACKAGE_MANIFEST_JSON" | \ + jq \ + --arg packageName "$PACKAGE_NAME" \ + --arg projectPath "$UNITY_PROJECT_PATH" \ + '.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} | .dependencies += {"\($packageName)": "file:\($projectPath)"} | . += {testables: ["\($packageName)"]}' \ + > "$PACKAGE_MANIFEST_PATH" + + else + + echo "$PACKAGE_MANIFEST_JSON" | \ jq \ --arg packageName "$PACKAGE_NAME" \ --arg projectPath "$UNITY_PROJECT_PATH" \ --arg scopedRegistryUrl "$SCOPED_REGISTRY_URL" \ --argjson registryScopes "$(echo "[\"$REGISTRY_SCOPES\"]" | sed 's/,/","/g')" \ '.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} | - .dependencies += {"\($packageName)": "file:\($projectPath)"} | - . += {testables: ["\($packageName)"]} | - . += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \ + .dependencies += {"\($packageName)": "file:\($projectPath)"} | + . += {testables: ["\($packageName)"]} | + . += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \ > "$PACKAGE_MANIFEST_PATH" + fi UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH" From 558d0370465ba9bd7791f7d090e2eab3b0387005 Mon Sep 17 00:00:00 2001 From: Tobias Perelstein <5562156+tobocop2@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:51:32 -0400 Subject: [PATCH 2/2] fix scopes conditional --- dist/platforms/ubuntu/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/platforms/ubuntu/run_tests.sh b/dist/platforms/ubuntu/run_tests.sh index 4c50acc6..621966aa 100755 --- a/dist/platforms/ubuntu/run_tests.sh +++ b/dist/platforms/ubuntu/run_tests.sh @@ -95,7 +95,7 @@ if [ "$PACKAGE_MODE" = "true" ]; then fi PACKAGE_MANIFEST_JSON=$(cat "$PACKAGE_MANIFEST_PATH") - if [ -z "$SCOPED_REGISTRY_URL" || -z "$REGISTRY_SCOPES" ]; then + if [ -z "$SCOPED_REGISTRY_URL" ] || [ -z "$REGISTRY_SCOPES" ]; then echo "$PACKAGE_MANIFEST_JSON" | \ jq \ --arg packageName "$PACKAGE_NAME" \