diff --git a/docs/workflow/building/coreclr/wasm.md b/docs/workflow/building/coreclr/wasm.md index 50fcebe00180b4..32e2fe31a34d20 100644 --- a/docs/workflow/building/coreclr/wasm.md +++ b/docs/workflow/building/coreclr/wasm.md @@ -81,8 +81,6 @@ cd ./artifacts/bin/coreclr/browser.wasm.Debug/corehost node ./main.mjs ``` -Note that paths to assemblies are in the `src/native/corehost/browserhost/sample/dotnet.boot.js` - ## Debugging ### Chrome DevTools with DWARF Support diff --git a/eng/native/version/copy_version_files.ps1 b/eng/native/version/copy_version_files.ps1 index 7573abcbb11a5a..705de544f2e1b1 100644 --- a/eng/native/version/copy_version_files.ps1 +++ b/eng/native/version/copy_version_files.ps1 @@ -13,7 +13,7 @@ Get-ChildItem -Path "$VersionFolder" -Filter "_version.*" | ForEach-Object { $current_contents = "" $is_placeholder_file = $false if (Test-Path -Path $version_file_destination) { - $current_contents = Get-Content -Path $version_file_destination -Raw + $current_contents = Get-Content -Path $version_file_destination $is_placeholder_file = $current_contents -match "@\(#\)Version N/A @Commit:" } else { $is_placeholder_file = $true diff --git a/src/native/corehost/browserhost/CMakeLists.txt b/src/native/corehost/browserhost/CMakeLists.txt index 6c4f4bba476e80..2640458e50d1ed 100644 --- a/src/native/corehost/browserhost/CMakeLists.txt +++ b/src/native/corehost/browserhost/CMakeLists.txt @@ -135,4 +135,5 @@ install(TARGETS browserhost DESTINATION sharedFramework COMPONENT runtime) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dotnet.native.wasm DESTINATION corehost COMPONENT runtime) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dotnet.native.wasm DESTINATION sharedFramework COMPONENT runtime) -add_subdirectory(sample) +set_source_files_properties(${BROWSERHOST_SOURCES} PROPERTIES OBJECT_DEPENDS + "${JS_SYSTEM_NATIVE_BROWSER};${JS_SYSTEM_BROWSER_UTILS};${JS_SYSTEM_RUNTIME_INTEROPSERVICES_JAVASCRIPT_NATIVE};${JS_BROWSER_HOST};${JS_SYSTEM_NATIVE_BROWSER_EXPOST}") diff --git a/src/native/corehost/browserhost/sample/CMakeLists.txt b/src/native/corehost/browserhost/sample/CMakeLists.txt deleted file mode 100644 index 35b44bc3d347fe..00000000000000 --- a/src/native/corehost/browserhost/sample/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Licensed to the .NET Foundation under one or more agreements. -# The .NET Foundation licenses this file to you under the MIT license. - -# this is just a incomplete sample app deployment -# WASM-TODO: implement proper in-tree project via MSBuild and WASM SDK - -set(SAMPLE_ASSETS - # index.html - # main.mjs - # dotnet.boot.js - ${SHARED_LIB_DESTINATION}/dotnet.js - ${SHARED_LIB_DESTINATION}/dotnet.js.map - ${SHARED_LIB_DESTINATION}/dotnet.d.ts - ${SHARED_LIB_DESTINATION}/dotnet.diagnostics.js - ${SHARED_LIB_DESTINATION}/dotnet.diagnostics.js.map - ${SHARED_LIB_DESTINATION}/dotnet.runtime.js - ${SHARED_LIB_DESTINATION}/dotnet.runtime.js.map - - # Bring your own DLLs and update the dotnet.boot.js to match - # HelloWorld.dll - # System.Private.CoreLib.dll - # System.Console.dll - # System.Runtime.dll - # System.Runtime.InteropServices.dll - # System.Threading.dll - -) -install(FILES ${SAMPLE_ASSETS} DESTINATION corehost COMPONENT runtime) diff --git a/src/native/corehost/browserhost/sample/HelloWorld.cs b/src/native/corehost/browserhost/sample/HelloWorld.cs deleted file mode 100644 index c1922f462e4c60..00000000000000 --- a/src/native/corehost/browserhost/sample/HelloWorld.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; - -namespace HelloWorld; - -public class Program -{ - public static async Task Main(string[] args) - { - Console.WriteLine("Hello, World! " + DateTime.Now + " "+ args.Length); - await Task.Delay(1000); - Console.WriteLine("After Task.Delay() " + DateTime.Now); - } -} diff --git a/src/native/corehost/browserhost/sample/HelloWorld.csproj b/src/native/corehost/browserhost/sample/HelloWorld.csproj deleted file mode 100644 index ba5d1561035f8a..00000000000000 --- a/src/native/corehost/browserhost/sample/HelloWorld.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - Exe - net10.0 - enable - enable - true - - - diff --git a/src/native/corehost/browserhost/sample/ReadMe.md b/src/native/corehost/browserhost/sample/ReadMe.md deleted file mode 100644 index 9f87c04d56bbba..00000000000000 --- a/src/native/corehost/browserhost/sample/ReadMe.md +++ /dev/null @@ -1,9 +0,0 @@ -# Demo files - -This is simple demo customer code that uses dotnet.js - -Easiest way is to test it is: -- copy this and other assemblies into `artifacts/bin/coreclr/browser.wasm.Debug/corehost` -- edit `dotnet.boot.js` to match your assemblies -- run `dotnet-serve --directory artifacts/bin/coreclr/browser.wasm.Debug/corehost` and point your browser -- or run `node ./main.mjs` in that directory. \ No newline at end of file diff --git a/src/native/corehost/browserhost/sample/dotnet.boot.js b/src/native/corehost/browserhost/sample/dotnet.boot.js deleted file mode 100644 index 781e82e0b02df2..00000000000000 --- a/src/native/corehost/browserhost/sample/dotnet.boot.js +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// WASM-TODO: this is dummy configuration until we have MSBuild WASM SDK for corehost, which will generate this file - -/* eslint-disable indent */ -export const config = { - "mainAssemblyName": "HelloWorld.dll", - "virtualWorkingDirectory": "/", - "resources": { - "jsModuleNative": [ - { - "name": "dotnet.native.js" - } - ], - "jsModuleRuntime": [ - { - "name": "dotnet.runtime.js" - } - ], - "wasmNative": [ - { - "name": "dotnet.native.wasm", - } - ], - "coreAssembly": [ - { - "virtualPath": "/System.Private.CoreLib.dll", - "name": "System.Private.CoreLib.dll" - }, - ], - "assembly": [ - { - "virtualPath": "/System.Runtime.dll", - "name": "System.Runtime.dll" - }, - { - "virtualPath": "/System.Threading.dll", - "name": "System.Threading.dll" - }, - { - "virtualPath": "/System.Runtime.InteropServices.dll", - "name": "System.Runtime.InteropServices.dll" - }, - { - "virtualPath": "/System.Console.dll", - "name": "System.Console.dll" - }, - { - "virtualPath": "/HelloWorld.dll", - "name": "HelloWorld.dll" - } - ] - } -}; diff --git a/src/native/corehost/browserhost/sample/index.html b/src/native/corehost/browserhost/sample/index.html deleted file mode 100644 index f06c7232a83b6d..00000000000000 --- a/src/native/corehost/browserhost/sample/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - Wasm Browser Sample - - - - - - - - - Answer to the Ultimate Question of Life, the Universe, and Everything is : - - - \ No newline at end of file diff --git a/src/native/corehost/browserhost/sample/main.mjs b/src/native/corehost/browserhost/sample/main.mjs deleted file mode 100644 index 4878d4fd7ce53a..00000000000000 --- a/src/native/corehost/browserhost/sample/main.mjs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { dotnet, exit } from "./dotnet.js"; -import { config } from "./dotnet.boot.js"; -/* eslint-disable no-console */ - -try { - await dotnet - .withConfig(config) - .withApplicationArguments("arg1", "arg2", "arg3") - .run(); -} catch (err) { - console.error(err); - exit(2, err); -} diff --git a/src/native/libs/Common/JavaScript/CMakeLists.txt b/src/native/libs/Common/JavaScript/CMakeLists.txt index b0e80f3ae50a9a..91ab7c508d7dc1 100644 --- a/src/native/libs/Common/JavaScript/CMakeLists.txt +++ b/src/native/libs/Common/JavaScript/CMakeLists.txt @@ -12,7 +12,6 @@ set(ROLLUP_TS_SOURCES "${CLR_SRC_NATIVE_DIR}/rollup.config.defines.js" "${CLR_SRC_NATIVE_DIR}/rollup.config.plugins.js" "${CLR_SRC_NATIVE_DIR}/corehost/browserhost/libBrowserHost.footer.js" - "${CLR_SRC_NATIVE_DIR}/corehost/browserhost/sample/dotnet.boot.js" "${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/libSystem.Native.Browser.Utils.footer.js" "${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/libSystem.Native.Browser.extpost.js" "${CLR_SRC_NATIVE_DIR}/libs/System.Native.Browser/libSystem.Native.Browser.footer.js"