Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(assets): Adds support for content assets in NuGet and transive project refs #10134

Merged
merged 3 commits into from
Oct 25, 2022
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
2 changes: 1 addition & 1 deletion build/Uno.UI.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
<ItemGroup>
<_Sha1Replace Include="..\src\SourceGenerators\Uno.UI.Tasks\**\*.cs" />
<_Sha1Replace Include="..\src\SourceGenerators\Uno.UI.Tasks\Uno.UI.Tasks.csproj" />
<_Sha1Replace Include="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" />
<_Sha1Replace Include="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*.*" />
</ItemGroup>

<WriteLinesToFile
Expand Down
20 changes: 10 additions & 10 deletions build/Uno.WinUI.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -719,16 +719,16 @@
<file src="uno.winui.runtime-replace.targets" target="buildTransitive\net6.0-macos" />
<file src="uno.winui.runtime-replace.targets" target="buildTransitive\net5.0-windows" />

<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\MonoAndroid" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\xamarinios10" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\xamarinmac20" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\netstandard2.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net7.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net6.0-android30.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net6.0-ios" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net6.0-maccatalyst" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net6.0-macos" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks.targets" target="buildTransitive\net5.0-windows" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\MonoAndroid" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\xamarinios10" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\xamarinmac20" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\netstandard2.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net7.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net6.0-android30.0" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net6.0-ios" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net6.0-maccatalyst" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net6.0-macos" />
<file src="..\src\SourceGenerators\Uno.UI.Tasks\Content\Uno.UI.Tasks*" target="buildTransitive\net5.0-windows" />

<!-- Force UAP to ignore netstandard 2.0 -->
<file src="uno.winui.win.targets" target="buildTransitive\uap10.0.16299\uno.winui.targets" />
Expand Down
322 changes: 161 additions & 161 deletions build/cSpell.json
Original file line number Diff line number Diff line change
@@ -1,163 +1,163 @@
{
"version": "0.2",
"language": "en",
"words": [
"Avalonia",
"binlog",
"Blazor",
"blockquotes",
"Bootstrapper",
"brotli",
"browsersync",
"bytecode",
"Callout",
"chatops",
"codebases",
"Codespace",
"Codespaces",
"Contoso",
"Cupertino",
"customizability",
"databinding",
"datacontext",
"datagrid",
"devs",
"Dismissable",
"Docfx",
"ellipsize",
"Expando",
"Framebuffer",
"Geolocation",
"globbing",
"Gyrometer",
"Hanja",
"hectopascals",
"Inlines",
"laggy",
"layouter",
"layouting",
"Listview",
"LLRM",
"mergeable",
"MSAL",
"msbuild",
"MVVM",
"NETSDK",
"netstandard",
"oidc",
"Omnisharp",
"overscroll",
"Packt",
"parameterless",
"pickable",
"Pluralsight",
"POSIX",
"reentrantly",
"roadmap",
"sandboxed",
"Segoe",
"Silverlight",
"Skia",
"skiasharp",
"Storyboarded",
"struct",
"Syncfusion",
"templatable",
"templating",
"timespan",
"Tizen",
"TLDR",
"toolkits",
"triaging",
"UI's",
"unmanaged",
"Uno's",
"unoplatform",
"UWP's",
"VSIX",
"walkthrough",
"WEBASSEMBLY"
],
"ignoreWords": [
"ADAL",
"Authenticode",
"automagically",
"Divio's",
"emcc",
"emscripten",
"Flatpickr",
"Giesel",
"GPIO",
"hdpi",
"Headered",
"Hoefling",
"HRESULT",
"IDBFS",
"Infragistics",
"jonathanpeppers's",
"Krueger",
"libgtk",
"Liu's",
"Matteo",
"McCaffrey",
"mdpi",
"Mergify",
"netstd",
"nventive",
"slnf",
"Stetho",
"Talkin",
"UADO",
"Udemy",
"UNOB",
"winui",
],
"patterns": [
{
"name": "Markdown links",
"pattern": "\\((.*)\\)",
"description": ""
},
{
"name": "Markdown code blocks",
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
},
{
"name": "Inline code blocks",
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
},
{
"name": "Link contents",
"pattern": "\\<a(.*)\\>",
"description": ""
},
{
"name": "Snippet references",
"pattern": "-- snippet:(.*)",
"description": ""
},
{
"name": "Snippet references 2",
"pattern": "\\<\\[sample:(.*)",
"description": "another kind of snippet reference"
},
{
"name": "Multi-line code blocks",
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
}
],
"ignoreRegExpList": [
"Markdown links",
"Markdown code blocks",
"Inline code blocks",
"Link contents",
"Snippet references",
"Snippet references 2",
"Multi-line code blocks"
],
"ignorePaths": [
"../doc/index.md"
]
"version": "0.2",
"language": "en",
"words": [
"Avalonia",
"binlog",
"Blazor",
"blockquotes",
"Bootstrapper",
"brotli",
"browsersync",
"bytecode",
"Callout",
"chatops",
"codebases",
"Codespace",
"Codespaces",
"Contoso",
"Cupertino",
"customizability",
"databinding",
"datacontext",
"datagrid",
"devs",
"Dismissable",
"Docfx",
"ellipsize",
"Expando",
"Framebuffer",
"Geolocation",
"globbing",
"Gyrometer",
"Hanja",
"hectopascals",
"Inlines",
"laggy",
"layouter",
"layouting",
"Listview",
"LLRM",
"mergeable",
"MSAL",
"msbuild",
"MVVM",
"NETSDK",
"netstandard",
"oidc",
"Omnisharp",
"overscroll",
"Packt",
"parameterless",
"pickable",
"Pluralsight",
"POSIX",
"reentrantly",
"roadmap",
"sandboxed",
"Segoe",
"Silverlight",
"Skia",
"skiasharp",
"Storyboarded",
"struct",
"Syncfusion",
"templatable",
"templating",
"timespan",
"Tizen",
"TLDR",
"toolkits",
"triaging",
"UI's",
"unmanaged",
"Uno's",
"unoplatform",
"UWP's",
"VSIX",
"walkthrough",
"WEBASSEMBLY"
],
"ignoreWords": [
"ADAL",
"Authenticode",
"automagically",
"Divio's",
"emcc",
"emscripten",
"Flatpickr",
"Giesel",
"GPIO",
"hdpi",
"Headered",
"Hoefling",
"HRESULT",
"IDBFS",
"Infragistics",
"jonathanpeppers's",
"Krueger",
"libgtk",
"Liu's",
"Matteo",
"McCaffrey",
"mdpi",
"Mergify",
"netstd",
"nventive",
"slnf",
"Stetho",
"Talkin",
"UADO",
"Udemy",
"UNOB",
"winui",
],
"patterns": [
{
"name": "Markdown links",
"pattern": "\\((.*)\\)",
"description": ""
},
{
"name": "Markdown code blocks",
"pattern": "/^(\\s*`{3,}).*[\\s\\S]*?^\\1/gmx",
"description": "Taken from the cSpell example at https://cspell.org/configuration/patterns/#verbose-regular-expressions"
},
{
"name": "Inline code blocks",
"pattern": "\\`([^\\`\\r\\n]+?)\\`",
"description": "https://stackoverflow.com/questions/41274241/how-to-capture-inline-markdown-code-but-not-a-markdown-code-fence-with-regex"
},
{
"name": "Link contents",
"pattern": "\\<a(.*)\\>",
"description": ""
},
{
"name": "Snippet references",
"pattern": "-- snippet:(.*)",
"description": ""
},
{
"name": "Snippet references 2",
"pattern": "\\<\\[sample:(.*)",
"description": "another kind of snippet reference"
},
{
"name": "Multi-line code blocks",
"pattern": "/^\\s*```[\\s\\S]*?^\\s*```/gm"
}
],
"ignoreRegExpList": [
"Markdown links",
"Markdown code blocks",
"Inline code blocks",
"Link contents",
"Snippet references",
"Snippet references 2",
"Multi-line code blocks"
],
"ignorePaths": [
"../doc/index.md"
]
}
24 changes: 24 additions & 0 deletions build/test-scripts/run-net6-mobile-template-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,27 @@ Assert-ExitCodeIsZero

& dotnet build -c Debug MyAppXamlTrim\MyAppXamlTrim.Wasm\MyAppXamlTrim.Wasm.csproj /p:UnoXamlResourcesTrimming=true
Assert-ExitCodeIsZero

# Uno Library
dotnet new unolib -n MyUnoLib
& $msbuild $debug /t:pack MyUnoLib\MyUnoLib.csproj
Assert-ExitCodeIsZero

#
# Uno Library with assets, Validate assets count
#
dotnet new unolib -n MyUnoLib2
mkdir MyUnoLib2\Assets
echo "Test file" > MyUnoLib2\Assets\MyTestAsset01.txt
& $msbuild $debug /t:pack /p:IncludeContentInPack=false MyUnoLib2\MyUnoLib2.csproj -bl
Assert-ExitCodeIsZero

mv MyUnoLib2\Bin\Debug\MyUnoLib2.1.0.0.nupkg MyUnoLib2\Bin\Debug\MyUnoLib2.1.0.0.zip
Expand-Archive -LiteralPath MyUnoLib2\Bin\Debug\MyUnoLib2.1.0.0.zip -DestinationPath MyUnoLib2Extract

$assetsCount = Get-ChildItem MyUnoLib2Extract\ -Filter MyTestAsset01.txt -Recurse -File | Measure-Object | %{$_.Count}

if ($assetsCount -ne 6)
{
throw "Not enough assets in the package."
}
Loading