Skip to content

Commit

Permalink
fix(pwa): Ensure PWS manifest is copied to the proper location
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Nov 13, 2020
1 parent 6ed96d1 commit 6175404
Show file tree
Hide file tree
Showing 108 changed files with 134 additions and 116 deletions.
17 changes: 17 additions & 0 deletions src/Uno.Wasm.AotTests/Uno.Wasm.AotTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
<None Remove="WasmScripts\image.js" />
</ItemGroup>

<ItemGroup>
<Content Include="pwa-images\**\*.*" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Uno.Wasm.AotTests.xml">
<LogicalName>Uno.Wasm.AotTests.xml</LogicalName>
Expand Down Expand Up @@ -51,4 +55,17 @@
<UserProperties manifest_1json__JsonSchema="http://json.schemastore.org/grunt-task" />
</VisualStudio>
</ProjectExtensions>

<Target Name="AfterBuildValidation" AfterTargets="Build">
<ItemGroup>
<_AdditionalFile1 Include="pwa-images\android\android-launchericon-144-144.png" />
<_AdditionalFile1 Include="pwa-images\windows10\SplashScreen.scale-100.png" />
</ItemGroup>

<Error Condition="!exists('$(WasmShellOutputPackagePath)\%(_AdditionalFile1.Identity)')" Text="%(_AdditionalFile1.Identity) is missing in $(WasmShellOutputPackagePath)" />
<Error Condition="!exists('$(WasmShellOutputDistPath)\$(WasmPWAManifestFile)')" Text="AdditionalContent/$(WasmPWAManifestFile) should exist in $(WasmShellOutputDistPath)" />

<Message Importance="high" Text="Output dist validated" />
</Target>

</Project>
208 changes: 104 additions & 104 deletions src/Uno.Wasm.AotTests/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Uno.Wasm.Bootstrap/ShellTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ string s when s.StartsWith("./") => $"./{_remoteBasePackagePath}/" + s.Substring
}
}

File.WriteAllText(PWAManifestFile, manifestDocument.ToString());
File.WriteAllText(Path.Combine(_distPath, Path.GetFileName(PWAManifestFile)), manifestDocument.ToString());
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GitVersion_Sha>1234</GitVersion_Sha>
</PropertyGroup>

<PropertyGroup Condition="'$(GitVersion_Sha)'!=''">
Expand Down Expand Up @@ -150,6 +149,10 @@
</ProjectReference>
</ItemGroup>

<ItemGroup>
<Folder Include="build\packager\" />
</ItemGroup>

<Target Name="UpdateAdditionalAssemblies" AfterTargets="CoreCompile">
<ItemGroup>
<Content Include="./tools/support/Uno.Wasm.TimezoneData.*">
Expand Down Expand Up @@ -225,9 +228,7 @@
<ReplaceSHAVersion FilePath="%(_Sha1Replace.Identity)" SHAVersion="$(_CurrentVersion)" />
</Target>

<UsingTask TaskName="ReplaceSHAVersion"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<UsingTask TaskName="ReplaceSHAVersion" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<FilePath ParameterType="System.String" Required="True" Output="False" />
<SHAVersion ParameterType="System.String" Required="True" Output="False" />
Expand Down
14 changes: 7 additions & 7 deletions src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<_packageBinaryPath>$(MSBuildThisFileDirectory)../tools/Uno.Wasm.Bootstrap.v1234.dll</_packageBinaryPath>
<_packageBinaryPath>$(MSBuildThisFileDirectory)../tools/Uno.Wasm.Bootstrap.v0.dll</_packageBinaryPath>

<WasmShellTasksPath Condition="!Exists('$(_packageBinaryPath)')">$(MSBuildThisFileDirectory)../bin/$(Configuration)/netstandard2.0</WasmShellTasksPath>
<WasmShellTasksPath Condition="Exists('$(_packageBinaryPath)')">../tools</WasmShellTasksPath>
Expand Down Expand Up @@ -97,8 +97,8 @@
<UpToDateCheckInput Include="@(LinkerDescriptor)" />
</ItemGroup>

<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v1234.dll" TaskName="Uno.Wasm.Bootstrap.ShellTask_v1234" />
<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v1234.dll" TaskName="Uno.Wasm.Bootstrap.UnoInstallSDKTask_v1234" />
<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v0.dll" TaskName="Uno.Wasm.Bootstrap.ShellTask_v0" />
<UsingTask AssemblyFile="$(WasmShellTasksPath)/Uno.Wasm.Bootstrap.v0.dll" TaskName="Uno.Wasm.Bootstrap.UnoInstallSDKTask_v0" />

<Target Name="_GenerateLinkerDescriptor" BeforeTargets="PrepareForBuild">
<!--
Expand Down Expand Up @@ -136,7 +136,7 @@
<WasmShellDistPath Condition="'$(WasmShellDistPath)'==''">$(OutputPath)/dist</WasmShellDistPath>
</PropertyGroup>

<UnoInstallSDKTask_v1234
<UnoInstallSDKTask_v0
MonoWasmSDKUri="$(MonoWasmSDKUri)"
MonoWasmAOTSDKUri="$(MonoWasmAOTSDKUri)"
NetCoreWasmSDKUri="$(NetCoreWasmSDKUri)"
Expand All @@ -155,9 +155,9 @@
<Output TaskParameter="SdkPath" PropertyName="_UnoMonoSdkPath" />
<Output TaskParameter="PackagerBinPath" PropertyName="_UnoMonoPackagerBinPath" />
<Output TaskParameter="PackagerProjectFile" PropertyName="_UnoMonoPackagerProjectFile" />
</UnoInstallSDKTask_v1234>
</UnoInstallSDKTask_v0>

<ShellTask_v1234
<ShellTask_v0
CurrentProjectPath="$(MSBuildProjectDirectory)"
BuildTaskBasePath="$(MSBuildThisFileDirectory)"
Assembly="$(IntermediateOutputPath)$(TargetFileName)"
Expand Down Expand Up @@ -199,7 +199,7 @@
ReferencePath="@(_UnoWasmBootstrapAssembliesForReferenceCopyLocalPaths)">
<Output TaskParameter="OutputPackagePath" PropertyName="WasmShellOutputPackagePath" />
<Output TaskParameter="OutputDistPath" PropertyName="WasmShellOutputDistPath" />
</ShellTask_v1234>
</ShellTask_v0>
</Target>

<Target Name="_CleanDist" BeforeTargets="Clean">
Expand Down

0 comments on commit 6175404

Please sign in to comment.