Skip to content

Commit

Permalink
chore: Adjust for missing assets in android package
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Oct 21, 2022
1 parent d55f44c commit 50780e0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
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
& dotnet pack -c Debug 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."
}
5 changes: 0 additions & 5 deletions build/test-scripts/run-template-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ dotnet new unoapp-uwp -n MyApp.Android (Get-TemplateConfiguration -android 1)
& $msbuild $debug MyApp.Android\MyApp.Android.sln
Assert-ExitCodeIsZero

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

# Uno Cross-Runtime Library
dotnet new unolib-crossruntime -n MyCrossRuntimeLib
& $msbuild $debug /t:Pack MyCrossRuntimeLib\MyCrossRuntimeLib.sln
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
<Compile Include="Forms\UnoOptions.Designer.cs">
<DependentUpon>UnoOptions.cs</DependentUpon>
</Compile>
<Compile Include="Forms\UnoOptionsBaseForm.cs" />
<Compile Include="Forms\UnoOptionsBaseForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\UnoWasmOptions.cs">
<SubType>Form</SubType>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
-->
<Target Name="_UnoAddLibraryAssets"
Condition="'$(IsUnoHead)'=='true' or '$(AndroidApplication)'=='true' or '$(ProjectTypeGuids)'!=''"
DependsOnTargets="_UnoFindPackageAssetMarkers"
BeforeTargets="GetCopyToOutputDirectoryItems">

<ExpandPackageAssets_v0 MarkerFiles="@(_UnoPriFiles)">
Expand All @@ -114,7 +115,7 @@
Condition="'$(IsUnoHead)'=='true' or '$(AndroidApplication)'=='true' or '$(ProjectTypeGuids)'!=''"
AfterTargets="ResolveAssemblyReferences">
<ItemGroup>
<_UnoPriFiles Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).uprimarker')"
<_UnoPriFiles Include="@(RuntimeCopyLocalItems->'%(RootDir)%(Directory)%(Filename).uprimarker')"
Condition="$([System.IO.File]::Exists('%(RootDir)%(Directory)%(Filename).uprimarker'))"/>
<ReferenceCopyLocalPaths Include="@(_UnoPriFiles)"/>
</ItemGroup>
Expand Down

0 comments on commit 50780e0

Please sign in to comment.