Skip to content

Commit

Permalink
[dotnet] use copyOnly for .png files in templates (#12016)
Browse files Browse the repository at this point in the history
Context: dotnet/templating#3325
Context: https://github.com/dotnet/templating/wiki/Reference-for-template.json#content-manipulation

In current .NET 6 Preview 6 builds, there is an issue if a template
includes a binary file larger than ~8kb, it seems to get truncated when
`dotnet new` extracts the template.

A workaround is to use the `copyOnly` feature for binary files. Really,
we should be doing this anyway, because otherwise the templating system
considers replacing *text* in these binary files. It improves
performance to do this and would hopefully prevent a future bug of
random bytes getting replaced.
  • Loading branch information
jonathanpeppers authored Jun 25, 2021
1 parent 4914136 commit 69698be
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"type": "project"
},
"sourceName": "MacCatalystApp1",
"sources": [
{
"source": "./",
"target": "./",
"copyOnly": "**/*.png"
}
],
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "MacCatalystApp1.csproj" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"type": "project"
},
"sourceName": "iOSApp1",
"sources": [
{
"source": "./",
"target": "./",
"copyOnly": "**/*.png"
}
],
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "iOSApp1.csproj" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"type": "project"
},
"sourceName": "macOSApp1",
"sources": [
{
"source": "./",
"target": "./",
"copyOnly": "**/*.png"
}
],
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "macOSApp1.csproj" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
"type": "project"
},
"sourceName": "tvOSApp1",
"sources": [
{
"source": "./",
"target": "./",
"copyOnly": "**/*.png"
}
],
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "tvOSApp1.csproj" }
Expand Down

8 comments on commit 69698be

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

Packages generated

View packages

Test results

1 tests failed, 220 tests passed.

Failed tests

  • monotouch-test/tvOS - simulator/Debug (LinkSdk): Failed

Pipeline on Agent XAMBOT-1036.BigSur'
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: device tests tvOS 🔥

Not enough free space in the host.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac Catalina (10.15) ✅

Tests passed

All tests on macOS X Mac Catalina (10.15) passed.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tests passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Tests were not ran (VSTS: device tests iOS32b). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] use copyOnly for .png files in templates (#12016)

Please sign in to comment.