fix(package-mode): scoped registry manifest conditional (#263)
* fix: registry incorrectly added to manifest when package testing * fix scopes conditional --------- Co-authored-by: Tobias Perelstein <5562156+tobocop2@users.noreply.github.com>pull/267/head
parent
9d8ff067a3
commit
317261b223
|
@ -95,17 +95,28 @@ if [ "$PACKAGE_MODE" = "true" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PACKAGE_MANIFEST_JSON=$(cat "$PACKAGE_MANIFEST_PATH")
|
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 \
|
jq \
|
||||||
--arg packageName "$PACKAGE_NAME" \
|
--arg packageName "$PACKAGE_NAME" \
|
||||||
--arg projectPath "$UNITY_PROJECT_PATH" \
|
--arg projectPath "$UNITY_PROJECT_PATH" \
|
||||||
--arg scopedRegistryUrl "$SCOPED_REGISTRY_URL" \
|
--arg scopedRegistryUrl "$SCOPED_REGISTRY_URL" \
|
||||||
--argjson registryScopes "$(echo "[\"$REGISTRY_SCOPES\"]" | sed 's/,/","/g')" \
|
--argjson registryScopes "$(echo "[\"$REGISTRY_SCOPES\"]" | sed 's/,/","/g')" \
|
||||||
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} |
|
'.dependencies += {"com.unity.testtools.codecoverage": "1.1.1"} |
|
||||||
.dependencies += {"\($packageName)": "file:\($projectPath)"} |
|
.dependencies += {"\($packageName)": "file:\($projectPath)"} |
|
||||||
. += {testables: ["\($packageName)"]} |
|
. += {testables: ["\($packageName)"]} |
|
||||||
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \
|
. += {scopedRegistries: [{"name":"dependency", "url":"\($scopedRegistryUrl)", scopes: $registryScopes}] }' \
|
||||||
> "$PACKAGE_MANIFEST_PATH"
|
> "$PACKAGE_MANIFEST_PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"
|
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue