Drop _SampleProject and _SampleAssembly properties (#81421)
authorMarek Fišera <mara@neptuo.com>
Wed, 1 Feb 2023 08:39:12 +0000 (09:39 +0100)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 08:39:12 +0000 (09:39 +0100)
src/mono/sample/wasi/Directory.Build.targets
src/mono/sample/wasi/console/Wasi.Console.Sample.csproj
src/mono/sample/wasm/Directory.Build.targets
src/mono/sample/wasm/browser-advanced/Wasm.Advanced.Sample.csproj
src/mono/sample/wasm/browser-bench/Console/Wasm.Console.Bench.Sample.csproj
src/mono/sample/wasm/browser-bench/Wasm.Browser.Bench.Sample.csproj
src/mono/sample/wasm/browser-eventpipe/Wasm.Browser.EventPipe.Sample.csproj
src/mono/sample/wasm/browser-threads/Wasm.Browser.Threads.Sample.csproj
src/mono/sample/wasm/browser/Wasm.Browser.Sample.csproj
src/mono/sample/wasm/console-node/Wasm.Console.Node.Sample.csproj
src/mono/sample/wasm/console-v8/Wasm.Console.V8.Sample.csproj

index 1e6a5ff..353d73b 100644 (file)
@@ -10,7 +10,8 @@
   <Target Name="BuildSampleInTree"
       Inputs="
       Program.cs;
-      $(_SampleProject)
+      $(_SampleProject);
+      $(MSBuildProjectFile)
       "
       Outputs="
       bin/publish/runtime/native/dotnet.wasm;
@@ -23,6 +24,7 @@
       <_ScriptExt Condition="'$(OS)' != 'Windows_NT'">.sh</_ScriptExt>
       <_Dotnet>$(RepoRoot)dotnet$(_ScriptExt)</_Dotnet>
       <_AOTFlag Condition="'$(RunAOTCompilation)' != ''">/p:RunAOTCompilation=$(RunAOTCompilation)</_AOTFlag>
+      <_SampleProject Condition="'$(_SampleProject)' == ''">$(MSBuildProjectFile)</_SampleProject>
       <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
     </PropertyGroup>
     <Exec Command="$(_Dotnet) publish -bl /p:Configuration=$(Configuration) /p:TargetArchitecture=wasm /p:TargetOS=wasi $(_AOTFlag) $(_SampleProject) $(BuildAdditionalArgs)" />
index da5ab16..6811cc3 100644 (file)
@@ -4,10 +4,5 @@
     <UseAppHost>false</UseAppHost>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <_SampleProject>Wasi.Console.Sample.csproj</_SampleProject>
-    <_SampleAssembly>Wasi.Console.Sample.dll</_SampleAssembly>
-  </PropertyGroup>
-
   <Target Name="RunSample" DependsOnTargets="RunSampleWithWasmtime" />
 </Project>
index 9ef8935..6db5674 100644 (file)
@@ -26,6 +26,9 @@
       Inputs="
       Program.cs;
       $(_WasmMainJSFileName);
+      $(_SampleProject);
+      $(MSBuildProjectFile)
+      $(TargetFileName)
       "
       Outputs="
       bin/$(Configuration)/AppBundle/dotnet.wasm;
@@ -38,6 +41,8 @@
       <_Dotnet>$(RepoRoot)dotnet$(_ScriptExt)</_Dotnet>
       <_AOTFlag Condition="'$(RunAOTCompilation)' != ''">/p:RunAOTCompilation=$(RunAOTCompilation)</_AOTFlag>
       <_WasmMainJSFileName>$([System.IO.Path]::GetFileName('$(WasmMainJSPath)'))</_WasmMainJSFileName>
+      <_SampleProject Condition="'$(_SampleProject)' == ''">$(MSBuildProjectFile)</_SampleProject>
+      <_SampleAssembly Condition="'$(_SampleAssembly)' == ''">$(TargetFileName)</_SampleAssembly>
       <BuildAdditionalArgs Condition="'$(MonoDiagnosticsMock)' != ''">$(BuildAdditionalArgs) /p:MonoDiagnosticsMock=$(MonoDiagnosticsMock) </BuildAdditionalArgs>
     </PropertyGroup>
     <Exec Command="$(_Dotnet) publish -bl /p:Configuration=$(Configuration) /p:TargetArchitecture=wasm /p:TargetOS=browser $(_AOTFlag) $(_SampleProject) $(BuildAdditionalArgs)" />
index ef4c5f2..fe3c5a2 100644 (file)
@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <Import Project="..\DefaultBrowserSample.targets" />
   <PropertyGroup>
-    <_SampleProject>Wasm.Advanced.Sample.csproj</_SampleProject>
     <EnableAggressiveTrimming>true</EnableAggressiveTrimming>
     <PublishTrimmed>true</PublishTrimmed>
     <!-- add OpenGL emulation -->
index a3d7f11..d43314d 100644 (file)
@@ -9,8 +9,6 @@
   </PropertyGroup>
 
   <PropertyGroup>
-    <_SampleProject>Wasm.Console.Bench.Sample.csproj</_SampleProject>
-    <_SampleAssembly>Wasm.Console.Bench.Sample.dll</_SampleAssembly>
     <SignAssembly>False</SignAssembly>
   </PropertyGroup>
 
index a1209a7..eaeb571 100644 (file)
     <Compile Remove="Console/Console.cs" />
   </ItemGroup>
 
-  <PropertyGroup>
-    <_SampleProject>Wasm.Browser.Bench.Sample.csproj</_SampleProject>
-    <_SampleAssembly> Wasm.Browser.Bench.Sample.dll</_SampleAssembly>
-  </PropertyGroup>
-
   <Target Name="RunSample" DependsOnTargets="RunSampleWithBrowserAndSimpleServer" />
 
 </Project>
index 9b8cf06..cb112b3 100644 (file)
   </ItemGroup>
 
   <PropertyGroup>
-    <_SampleProject>Wasm.Browser.EventPipe.Sample.csproj</_SampleProject>
-  </PropertyGroup>
-
-
-  <PropertyGroup>
     <RunAnalyzers>true</RunAnalyzers>
   </PropertyGroup>
 
index 5c11649..953a57b 100644 (file)
@@ -1,7 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <Import Project="..\DefaultBrowserSample.targets" />
   <PropertyGroup>
-    <_SampleProject>Wasm.Browser.Threads.Sample.csproj</_SampleProject>
     <WasmEnableThreads>true</WasmEnableThreads>
   </PropertyGroup>
 
index 76ec895..65bd564 100644 (file)
@@ -1,6 +1,3 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <Import Project="..\DefaultBrowserSample.targets" />
-  <PropertyGroup>
-    <_SampleProject>Wasm.Browser.Sample.csproj</_SampleProject>
-  </PropertyGroup>
 </Project>
index aac67cc..7234698 100644 (file)
     <WasmExtraFilesToDeploy Include="package.json" />
   </ItemGroup>
 
-  <PropertyGroup>
-    <_SampleProject>Wasm.Console.Node.Sample.csproj</_SampleProject>
-    <_SampleAssembly>Wasm.Console.Node.Sample.dll</_SampleAssembly>
-  </PropertyGroup>
-
   <Target Name="RunSample" DependsOnTargets="RunSampleWithNode" />
 </Project>
index 5bd8225..7f02fc0 100644 (file)
@@ -8,10 +8,6 @@
     <RunScriptCommand>$(ExecXHarnessCmd) wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --engine-arg=--module --js-file=main.mjs --output-directory=$(XHarnessOutput) -- --run $(MSBuildProjectName).dll</RunScriptCommand>
   </PropertyGroup>
 
-  <PropertyGroup>
-    <_SampleProject>Wasm.Console.V8.Sample.csproj</_SampleProject>
-    <_SampleAssembly>Wasm.Console.V8.Sample.dll</_SampleAssembly>
-  </PropertyGroup>
 
   <Target Name="RunSample" DependsOnTargets="RunSampleWithV8" />
 </Project>