Skip to content
Open
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
4 changes: 0 additions & 4 deletions targeting-packs-bad-files/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"type": "bash",
"cleanup": true,
"skipWhen": [
"version=8", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251
"version=9", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251
"version=10", // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251
"version=11" // see https://github.com/redhat-developer/dotnet-regular-tests/issues/251
],
"ignoredRIDs":[

Expand Down
20 changes: 16 additions & 4 deletions targeting-packs-bad-files/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@ echo "Found .NET at $dotnet_dir"

errors=0

json_lines=$(find "$dotnet_dir/packs" -iname '*.json' | wc -l)
if [[ $json_lines -gt 0 ]]; then
echo "error: found some json files in $dotnet_dir/packs"
find "$dotnet_dir/packs" -iname '*.json'
# The SharedFramework SDK intentionally generates each runtime pack's framework
# .deps.json and .runtimeconfig.json at runtimes/<rid>/lib/<tfm>.
# See https://github.com/dotnet/arcade/pull/5714
# Allow only those known files in that layout; other JSON files in packs are unexpected.
bad_json_files=()
while IFS= read -r -d '' json_file; do
relative_path=${json_file#"$dotnet_dir/packs/"}
if [[ ! $relative_path =~ ^Microsoft\.NETCore\.App\.Runtime(\.NativeAOT)?\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.NETCore\.App\.(deps|runtimeconfig)\.json$ &&
! $relative_path =~ ^Microsoft\.AspNetCore\.App\.Runtime\.[^/]+/[^/]+/runtimes/[^/]+/lib/net[^/]+/Microsoft\.AspNetCore\.App\.(deps|runtimeconfig)\.json$ ]]; then
bad_json_files+=("$json_file")
fi
done < <(find "$dotnet_dir/packs" -iname '*.json' -print0)

if [[ ${#bad_json_files[@]} -gt 0 ]]; then
echo "error: found unexpected json files in $dotnet_dir/packs"
printf '%s\n' "${bad_json_files[@]}"
errors=1
fi

Expand Down
Loading