diff --git a/Directory.Build.props b/Directory.Build.props
index 93363a2b053..8db16f43430 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -44,20 +44,24 @@
$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'docs'))
$([MSBuild]::NormalizeDirectory('$(DocsDir)', 'manpages'))
+
+
$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'System.Private.CoreLib', 'src'))
+ $([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'src', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))
+ $([MSBuild]::NormalizePath('$(MonoProjectRoot)', 'netcore', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AppleAppBuilder', 'Debug', '$(NetCoreAppCurrent)'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'AndroidAppBuilder', 'Debug', '$(NetCoreAppCurrent)'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmAppBuilder', 'Debug', '$(NetCoreAppCurrent)', 'publish'))
- $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'GenerateWasmBundle', 'Debug', '$(NetCoreAppCurrent)', 'publish'))
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'WasmBuildTasks', 'Debug', '$(NetCoreAppCurrent)', 'publish'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'MonoAOTCompiler', 'Debug', '$(NetCoreAppCurrent)'))
$([MSBuild]::NormalizePath('$(AppleAppBuilderDir)', 'AppleAppBuilder.dll'))
$([MSBuild]::NormalizePath('$(AndroidAppBuilderDir)', 'AndroidAppBuilder.dll'))
$([MSBuild]::NormalizePath('$(WasmAppBuilderDir)', 'WasmAppBuilder.dll'))
- $([MSBuild]::NormalizePath('$(GenerateWasmBundleDir)', 'GenerateWasmBundle.dll'))
+ $([MSBuild]::NormalizePath('$(WasmBuildTasksDir)', 'WasmBuildTasks.dll'))
$([MSBuild]::NormalizePath('$(MonoAOTCompilerDir)', 'MonoAOTCompiler.dll'))
diff --git a/docs/workflow/building/libraries/webassembly-instructions.md b/docs/workflow/building/libraries/webassembly-instructions.md
index 973047b2d54..b22d0a4a6a1 100644
--- a/docs/workflow/building/libraries/webassembly-instructions.md
+++ b/docs/workflow/building/libraries/webassembly-instructions.md
@@ -4,102 +4,109 @@
If you haven't already done so, please read [this document](../../README.md#Build_Requirements) to understand the build requirements for your operating system.
-An installation of the emsdk needs to be installed. Follow the installation guide [here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install). Once installed the EMSDK_PATH needs to be set:
+The Emscripten SDK (emsdk) needs to be installed. Follow the installation guide [here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) or run `make -C src/mono/wasm provision-wasm` to install emsdk into `src/mono/wasm/emsdk`.
-On Linux and MacOSX:
+Once installed the `EMSDK_PATH` environment variable needs to be set:
+
+On Linux and macOS:
```bash
-export EMSDK_PATH=PATH_TO_SDK_INSTALL/emsdk
+export EMSDK_PATH=/emsdk
```
## Building everything
-At this time no other build configurations are necessary to start building for WebAssembly. The CoreLib for WebAssembly build configurations will be built by default using the WebAssembly configuration shown below.
+At this time no other build dependencies are necessary to start building for WebAssembly.
-This document explains how to work on libraries. In order to work on library projects or run library tests it is necessary to have built the runtime to give the libraries something to run on. If you haven't already done so, please read [this document](../../README.md#Configurations) to understand configurations.
+This document explains how to work on the runtime or libraries. If you haven't already done so, please read [this document](../../README.md#Configurations) to understand configurations.
+For Linux and macOS:
-For Linux and MacOSX:
```bash
-./build.sh --arch wasm --os Browser --configuration release
+./build.sh -os Browser -configuration Release
```
-Detailed information about building and testing runtimes and the libraries is in the documents linked below.
+Artifacts will be placed in `artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/`. When rebuilding with `build.sh` after a code change, you need to ensure that the `mono.wasmruntime` and `libs.pretest` subsets are included even for a Mono-only change or this directory will not be updated (details below).
-## How to build native components only
+## Building Mono's System.Private.CoreLib or runtime
+
+If you are working on core parts of Mono you will probably need to build the Mono runtime and [System.Private.CoreLib](../../../design/coreclr/botr/corelib.md) which can be built with the following:
+
+```bash
+./build.sh mono -os Browser -c Debug|Release
+```
+
+To build just System.Private.CoreLib without the Mono runtime you can use the `Mono.CoreLib` subset:
+
+```bash
+./build.sh mono.corelib -os Browser -c Debug|Release
+```
+
+To build just the Mono runtime without System.Private.CoreLib use the `Mono.Runtime` subset:
+
+```bash
+./build.sh mono.runtime -os Browser -c Debug|Release
+```
+
+Building both Mono/System.Private.CoreLib and the managed libraries:
+
+```bash
+./build.sh mono+libs -os Browser -c Debug|Release
+```
+
+## Building the WebAssembly runtime files
+
+The WebAssembly implementation files are built after the libraries source build and made available in the artifacts folder. If you are working on the code base and need to compile just these modules then building the `Mono.WasmRuntime` subset will allow one to do that:
+
+```bash
+./build.sh mono.wasmruntime -os Browser -c Debug|Release
+```
+
+## Updating in-tree runtime pack
+
+If you don't run the full `Libs` subset then you can use the `Libs.PreTest` subset to copy updated runtime/corelib binaries to the runtime pack which is used for running tests:
+
+```bash
+./build.sh libs.pretest -os Browser -c Debug|Release
+```
+
+## Building libraries native components only
The libraries build contains some native code. This includes shims over libc, openssl, gssapi, and zlib. The build system uses CMake to generate Makefiles using clang. The build also uses git for generating some version information.
-**Examples**
-
-- Building in debug mode for platform wasm and Browser operating system
```bash
-./build.sh libs.native --arch wasm --os Browser
-```
-
-- Building in release mode for platform wasm and Browser operating system
-```bash
-./build.sh libs.native --arch wasm --os Browser -c Release
-```
-
-## How to build mono System.Private.CoreLib
-
-If you are working on core parts of mono libraries you will probably need to build the [System.Private.CoreLib](../../../design/coreclr/botr/corelib.md) which can be built with the following:
-
-
-```bash
-./build.sh mono --arch wasm --os Browser -c Release
-```
-
-To build just SPC without mono you can use the Mono.CoreLib subset.
-
-```bash
-./build.sh mono.corelib --arch wasm --os Browser -c Release
-```
-
-Building the managed libraries as well:
-
-```bash
-./build.sh mono+libs --arch wasm --os Browser -c Release
+./build.sh libs.native -os Browser -c Debug|Release
```
## Building individual libraries
Individual projects and libraries can be build by specifying the build configuration.
-Building individual libraries
**Examples**
- Build all projects for a given library (e.g.: System.Net.Http) including the tests
```bash
- ./build.sh --arch wasm --os Browser -c Release --projects src/libraries/System.Net.Http/System.Net.Http.sln
+./build.sh -os Browser -c Release --projects /src/libraries/System.Net.Http/System.Net.Http.sln
```
- Build only the source project of a given library (e.g.: System.Net.Http)
```bash
- ./build.sh --arch wasm --os Browser -c Release --projects src/libraries/System.Net.Http/src/System.Net.Http.csproj
+ ./build.sh -os Browser -c Release --projects /src/libraries/System.Net.Http/src/System.Net.Http.csproj
```
More information and examples can be found in the [libraries](./README.md#building-individual-libraries) document.
-## Building the WebAssembly runtime files
+## Notes
-The WebAssembly implementation files are built and made available in the artifacts folder. If you are working on the code base and need to compile just these modules then the following will allow one to do that.
-
-For Linux and MacOSX:
-```bash
-./dotnet.sh build /p:Configuration=Debug|Release /p:TargetArchitecture=wasm /p:TargetOS=Browser src/libraries/src.proj /t:BuildWasmRuntimes
-```
-
-__Note__: A `Debug` build sets the following environment variables by default. When built from the command line this way the `Configuration` value is case sensitive.
+A `Debug` build sets the following environment variables by default:
- debugging and logging which will log garbage collection information to the console.
```
- monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0);
- monoeg_g_setenv ("MONO_LOG_MASK", "gc", 0);
+MONO_LOG_LEVEL=debug
+MONO_LOG_MASK=gc
```
#### Example:
diff --git a/docs/workflow/building/mono/README.md b/docs/workflow/building/mono/README.md
index 0ac8cf2e6bc..00bf920adbd 100644
--- a/docs/workflow/building/mono/README.md
+++ b/docs/workflow/building/mono/README.md
@@ -51,31 +51,7 @@ The build has a number of options that you can learn about using build -?.
### WebAssembly
-In addition to the normal build requirements, WebAssembly builds require a local emsdk to be downloaded. This can either be external or acquired via a make target.
-
-To acquire it externally, move to a directory outside of the runtime repository and run:
-```bash
-git clone https://github.com/emscripten-core/emsdk.git
-```
-
-To use the make target, from the root of the runtime repo:
-```bash
-cd src/mono/wasm
-make provision-wasm
-cd ../../..
-```
-
-When building for WebAssembly, regardless of the machine architecture, you must set the `EMSDK_PATH` environmental variable and architecture/os, calling build.sh like so:
-```bash
-EMSDK_PATH={path to emsdk repo} ./build.sh --subset mono+libs --arch wasm --os browser -c release
-```
-
-If using the locally provisioned emsdk, this will be:
-```bash
-EMSDK_PATH={path to runtime repo}/src/mono/wasm/emsdk ./build.sh --subset mono+libs --arch wasm --os browser -c release
-```
-
-Artifacts will be placed in `artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release/`. When rebuilding with `build.sh`, you _must_ rebuild with `mono+libs` even for mono-only changes, or this directory will not be updated. Alternative, you can rebuild just the runtime-specific bits from the `src/mono/wasm` directory by running either `make runtime` or `make corlib` when modifying Mono or System.Private.CoreLib respectively.
+See the instructions in [../libraries/webassembly-instructions.md].
## Packages
diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md
index 8c08a729074..7e530859bed 100644
--- a/docs/workflow/testing/libraries/testing-wasm.md
+++ b/docs/workflow/testing/libraries/testing-wasm.md
@@ -25,11 +25,11 @@ PATH=/Users//.jsvu/:$PATH V8
Now we're ready to build everything for WebAssembly (for more details, please read [this document](../../building/libraries/webassembly-instructions.md#building-everything)):
```bash
-./build.sh --arch wasm --os Browser -c release
+./build.sh -os Browser -c Release
```
and even run tests one by one for each library:
```
-./build.sh --subset libs.tests -t --arch wasm --os Browser -c release
+./build.sh libs.tests -test -os Browser -c Release
```
### Running individual test suites
diff --git a/eng/Subsets.props b/eng/Subsets.props
index f7f61f98f6e..143cdcf58fa 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -57,6 +57,7 @@
clr.runtime+linuxdac+clr.corelib+clr.nativecorelib+clr.tools+clr.packages
mono.llvm+
+ $(DefaultMonoSubsets)mono.wasmruntime+
$(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages
libs.native+libs.ref+libs.src+libs.pretest+libs.packages
@@ -94,6 +95,7 @@
+
@@ -195,6 +197,10 @@
+
+
+
+
diff --git a/eng/build.sh b/eng/build.sh
index afa16a69447..47c02964f1e 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -391,6 +391,11 @@ if [ ${#actInt[@]} -eq 0 ]; then
arguments="-restore -build $arguments"
fi
+if [ "$os" = "Browser" ] && [ "$arch" != "wasm" ]; then
+ # override default arch for Browser, we only support wasm
+ arch=wasm
+fi
+
initDistroRid $os $arch $crossBuild $portableBuild
# URL-encode space (%20) to avoid quoting issues until the msbuild call in /eng/common/tools.sh.
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index 67e6ced6b4f..84b8337494a 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -151,24 +151,6 @@
AssemblySearchPaths="@(AssemblySearchPaths)" />
-
-
-
-
-
-
-
-
-
-
-
@@ -184,5 +166,5 @@
+ DependsOnTargets="Publish;BundleTestAppleApp;BundleTestAndroidApp;BundleTestWasmApp;ArchiveTests" />
diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props
index b72b9b13f2f..1a308744dd2 100644
--- a/src/libraries/Directory.Build.props
+++ b/src/libraries/Directory.Build.props
@@ -245,10 +245,6 @@
$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(NetCoreAppCurrent)'))
$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'runtime', '$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))
-
- $([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'src', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))
- $([MSBuild]::NormalizePath('$(MonoProjectRoot)', 'netcore', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))
-
$(TargetOS).$(Platform).$(Configuration)
AnyOS.AnyCPU.$(Configuration)
diff --git a/src/libraries/src.proj b/src/libraries/src.proj
index ce82c68ea70..956513dc724 100644
--- a/src/libraries/src.proj
+++ b/src/libraries/src.proj
@@ -39,8 +39,6 @@
Properties="$(TraversalGlobalProperties)" />
-
-
diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile
index 1649f632677..4b8c6ade48d 100644
--- a/src/mono/wasm/Makefile
+++ b/src/mono/wasm/Makefile
@@ -7,14 +7,13 @@ JSVU=$(HOME)/.jsvu
#
# These variables are set by wasm.targets
#
-EMSDK_PATH?=emsdk
+EMSDK_PATH?=$(TOP)/src/mono/wasm/emsdk
CONFIG?=Release
BINDIR?=$(TOP)/artifacts/bin
OBJDIR?=$(TOP)/artifacts/obj
PINVOKE_TABLE?=$(TOP)/artifacts/obj/wasm/pinvoke-table.h
MONO_BIN_DIR?=$(BINDIR)/mono/Browser.wasm.$(CONFIG)
-NATIVE_DIR?=$(OBJDIR)/native/net5.0-Browser-$(CONFIG)-wasm
-BUILDS_BIN_DIR?=$(BINDIR)/native/net5.0-Browser-$(CONFIG)-wasm
+NATIVE_BIN_DIR?=$(BINDIR)/native/net5.0-Browser-$(CONFIG)-wasm
ICU_LIBDIR?=
all: build-native icu-data
@@ -37,8 +36,10 @@ EMCC=source $(EMSDK_PATH)/emsdk_env.sh && emcc
cd $(EMSDK_LOCAL_PATH) && ./emsdk activate $(EMSCRIPTEN_VERSION)
touch $@
-ifeq ($(EMSDK_PATH),emsdk)
+ifeq ($(EMSDK_PATH),$(TOP)/src/mono/wasm/emsdk)
provision-wasm: .stamp-wasm-install-and-select-$(EMSCRIPTEN_VERSION)
+ @echo "----------------------------------------------------------"
+ @echo "Installed emsdk into EMSDK_PATH=$(TOP)/src/mono/wasm/emsdk"
else
provision-wasm:
endif
@@ -51,8 +52,8 @@ MONO_LIBS = \
$(MONO_BIN_DIR)/libmonosgen-2.0.a \
$(MONO_BIN_DIR)/libmono-ilgen.a \
$(MONO_BIN_DIR)/libmono-icall-table.a \
- ${NATIVE_DIR}/System.Native/libSystem.Native.a \
- ${NATIVE_DIR}/System.IO.Compression.Native/libSystem.IO.Compression.Native.a \
+ ${NATIVE_BIN_DIR}/libSystem.Native.a \
+ ${NATIVE_BIN_DIR}/libSystem.IO.Compression.Native.a \
$(ICU_LIBDIR)/libicuuc.a \
$(ICU_LIBDIR)/libicui18n.a \
$(ICU_LIBDIR)/libicudata.a
@@ -69,14 +70,14 @@ EMCC_RELEASE_FLAGS=-Oz --llvm-opts 2 -DENABLE_NETCORE=1
# $(2) - libs
define InterpBuildTemplate
-$(BUILDS_BIN_DIR):
+$(NATIVE_BIN_DIR):
mkdir -p $$@
$(BUILDS_OBJ_DIR):
mkdir -p $$@
-$(BUILDS_BIN_DIR)/dotnet.js: $(BUILDS_OBJ_DIR)/driver.o $(BUILDS_OBJ_DIR)/pinvoke.o $(BUILDS_OBJ_DIR)/corebindings.o runtime/library_mono.js runtime/binding_support.js runtime/dotnet_support.js $(2) | $(BUILDS_BIN_DIR)/
- $(EMCC) $(EMCC_FLAGS) $(1) --js-library runtime/library_mono.js --js-library runtime/binding_support.js --js-library runtime/dotnet_support.js $(BUILDS_OBJ_DIR)/driver.o $(BUILDS_OBJ_DIR)/pinvoke.o $(BUILDS_OBJ_DIR)/corebindings.o $(2) -o $(BUILDS_BIN_DIR)/dotnet.js
+$(NATIVE_BIN_DIR)/dotnet.js: $(BUILDS_OBJ_DIR)/driver.o $(BUILDS_OBJ_DIR)/pinvoke.o $(BUILDS_OBJ_DIR)/corebindings.o runtime/library_mono.js runtime/binding_support.js runtime/dotnet_support.js $(2) | $(NATIVE_BIN_DIR)
+ $(EMCC) $(EMCC_FLAGS) $(1) --js-library runtime/library_mono.js --js-library runtime/binding_support.js --js-library runtime/dotnet_support.js $(BUILDS_OBJ_DIR)/driver.o $(BUILDS_OBJ_DIR)/pinvoke.o $(BUILDS_OBJ_DIR)/corebindings.o $(2) -o $(NATIVE_BIN_DIR)/dotnet.js
$(BUILDS_OBJ_DIR)/pinvoke-table.h: $(PINVOKE_TABLE) | $(BUILDS_OBJ_DIR)
if cmp -s $(PINVOKE_TABLE) $$@ ; then : ; else cp $(PINVOKE_TABLE) $$@ ; fi
@@ -90,7 +91,7 @@ $(BUILDS_OBJ_DIR)/pinvoke.o: runtime/pinvoke.c runtime/pinvoke.h $(BUILDS_OBJ_DI
$(BUILDS_OBJ_DIR)/corebindings.o: runtime/corebindings.c | $(BUILDS_OBJ_DIR)
$(EMCC) $(EMCC_FLAGS) $(1) -Oz -I$(MONO_INCLUDE_DIR) runtime/corebindings.c -c -o $$@
-build-native: $(BUILDS_BIN_DIR)/dotnet.js
+build-native: $(NATIVE_BIN_DIR)/dotnet.js
endef
@@ -100,32 +101,29 @@ else
$(eval $(call InterpBuildTemplate,$(EMCC_RELEASE_FLAGS),$(MONO_LIBS)))
endif
-build:
- EMSDK_PATH=$(PWD)/emsdk $(DOTNET) build /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG) $(TOP)/src/libraries/src.proj /t:BuildWasmRuntimes
-
clean-emsdk:
$(RM) -rf $(EMSDK_LOCAL_PATH)
clean:
- $(RM) -rf $(BUILDS_BIN_DIR) $(BUILDS_OBJ_DIR)
+ $(RM) -rf $(BUILDS_OBJ_DIR)
# Helper targets
.PHONY: runtime
icu-data:
- cp $(ICU_LIBDIR)/*.dat $(BUILDS_BIN_DIR)
+ cp $(ICU_LIBDIR)/*.dat $(NATIVE_BIN_DIR)
-runtime:
- EMSDK_PATH=$(TOP)/src/mono/wasm/emsdk $(TOP)/build.sh --subset mono --arch wasm --os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true
- cp $(TOP)/artifacts/bin/mono/Browser.wasm.$(CONFIG)/IL/System.Private.CoreLib.* $(TOP)/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/$(CONFIG)/runtimes/browser-wasm/native/
- $(MAKE) build
-
-corlib:
- EMSDK_PATH=$(TOP)/src/mono/wasm/emsdk $(TOP)/build.sh --subset mono.corelib --arch wasm --os Browser -c $(CONFIG)
- cp $(TOP)/artifacts/bin/mono/Browser.wasm.$(CONFIG)/IL/System.Private.CoreLib.* $(TOP)/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/$(CONFIG)/runtimes/browser-wasm/native/
+build:
+ EMSDK_PATH=$(EMSDK_PATH) $(TOP)/build.sh mono+libs.pretest -os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true
build-all:
- EMSDK_PATH=$(TOP)/src/mono/wasm/emsdk $(TOP)/build.sh --subset mono+libs --arch wasm --os Browser -c $(CONFIG)
+ EMSDK_PATH=$(EMSDK_PATH) $(TOP)/build.sh mono+libs -os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true
+
+runtime:
+ EMSDK_PATH=$(EMSDK_PATH) $(TOP)/build.sh mono.runtime+mono.wasmruntime+libs.pretest -os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true
+
+corlib:
+ EMSDK_PATH=$(EMSDK_PATH) $(TOP)/build.sh mono.corelib+mono.wasmruntime+libs.pretest -os Browser -c $(CONFIG) /p:ContinueOnError=false /p:StopOnFirstFailure=true
test-runner:
$(DOTNET) build $(TOP)/src/libraries/Common/tests/WasmTestRunner /p:Configuration=$(CONFIG)
@@ -133,8 +131,8 @@ test-runner:
app-builder:
$(DOTNET) build $(TOP)/tools-local/tasks/mobile.tasks/WasmAppBuilder
-bundle-task:
- $(DOTNET) build $(TOP)/tools-local/tasks/mobile.tasks/GenerateWasmBundle
+build-tasks:
+ $(DOTNET) build $(TOP)/tools-local/tasks/mobile.tasks/WasmBuildTasks
run-tests-v8-%:
PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=$(CONFIG) /p:JSEngine=V8 $(MSBUILD_ARGS)
diff --git a/src/mono/wasm/timezones.props b/src/mono/wasm/timezones.props
deleted file mode 100644
index 4276622f248..00000000000
--- a/src/mono/wasm/timezones.props
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/mono/wasm/wasm.targets b/src/mono/wasm/wasm.proj
similarity index 51%
rename from src/mono/wasm/wasm.targets
rename to src/mono/wasm/wasm.proj
index 8d635f76faf..8d6ec2927a4 100644
--- a/src/mono/wasm/wasm.targets
+++ b/src/mono/wasm/wasm.proj
@@ -1,4 +1,17 @@
-
+
+
+
+ $(NetCoreAppCurrent)
+
+
+
+
+ browser-wasm
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'native', '$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)'))
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(PackageRID)', '$(Configuration)'))
+ $([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(PackageRID)'))
+ $([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))
+
@@ -8,10 +21,11 @@
+
-
+
$(ArtifactsObjDir)wasm\pinvoke-table.h
@@ -19,10 +33,9 @@
-
-
+
-
+
@@ -35,32 +48,42 @@
OutputPath="$(WasmPInvokeTablePath)" />
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ TimeZones="@(TimeZoneToCompile)"
+ InputDirectory="$([MSBuild]::NormalizePath('$(PkgSystem_Runtime_TimeZoneData)', 'contentFiles', 'any', 'any', 'data'))"
+ OutputDirectory="$(ArtifactsObjDir)wasm/timezones" />
-
+ AssemblyFile="$(WasmBuildTasksAssemblyPath)"/>
+
$(NativeBinDir)dotnet.timezones.blat
-
+
+
files = new List() {"africa", "antarctica", "asia", "australasia", "etcetera", "europe", "northamerica", "southamerica", "zone1970.tab"};
- using (var client = new WebClient())
- {
- Console.WriteLine("Downloading TimeZone data files");
- foreach (var file in files)
- {
- client.DownloadFile($"https://data.iana.org/time-zones/tzdb-{Version}/{file}", $"{Path.Combine(InputDirectory!, file)}");
- }
- }
-
- files.Remove("zone1970.tab");
-
- using (Process process = new Process())
- {
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.FileName = "zic";
- foreach (var f in files)
- {
- process.StartInfo.Arguments = $"-d \"{OutputDirectory}\" \"{Path.Combine(InputDirectory!, f)}\"";
- process.Start();
- process.WaitForExit();
- }
- }
- File.Copy(Path.Combine(InputDirectory!,"zone1970.tab"), Path.Combine(OutputDirectory!,"zone1970.tab"));
- }
-
- private void FilterTimeZoneData()
- {
- // Remove unnecessary timezone files
- foreach (var entry in new DirectoryInfo (OutputDirectory!).EnumerateFiles())
- {
- if (entry.Name != "zone1970.tab")
- File.Delete(entry.FullName);
- }
- }
-
- private void FilterZoneTab(string[] filters)
- {
- var oldPath = Path.Combine(OutputDirectory!, "zone1970.tab");
- var path = Path.Combine(OutputDirectory!, "zone.tab");
- using (StreamReader sr = new StreamReader(oldPath))
- using (StreamWriter sw = new StreamWriter(path))
- {
- string? line;
- while ((line = sr.ReadLine()) != null) {
- if (filters.Any(x => Regex.IsMatch(line, $@"\b{x}\b")))
- {
- sw.WriteLine(line);
- }
- }
- }
- File.Delete(oldPath);
- }
-
- public override bool Execute()
- {
-
- if (!Directory.Exists(InputDirectory))
- Directory.CreateDirectory(InputDirectory!);
-
- if (!Directory.Exists(OutputDirectory))
- Directory.CreateDirectory(OutputDirectory!);
-
- DownloadTimeZoneDataSource();
-
- string[] filtered = new string[] { "America/Los_Angeles", "Australia/Sydney", "Europe/London", "Pacific/Tongatapu",
- "America/Sao_Paulo", "Australia/Perth", "Africa/Nairobi", "Europe/Berlin",
- "Europe/Moscow", "Africa/Tripoli", "America/Argentina/Catamarca", "Europe/Lisbon",
- "America/St_Johns"};
-
- FilterTimeZoneData();
- FilterZoneTab(filtered);
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/tools-local/tasks/mobile.tasks/GenerateWasmBundle/GenerateWasmBundle.csproj b/tools-local/tasks/mobile.tasks/GenerateWasmBundle/GenerateWasmBundle.csproj
deleted file mode 100644
index 8666bd91c50..00000000000
--- a/tools-local/tasks/mobile.tasks/GenerateWasmBundle/GenerateWasmBundle.csproj
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
- $(NetCoreAppCurrent)
- Library
- enable
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/tools-local/tasks/mobile.tasks/GenerateWasmBundle/CompileTimeZoneData.cs b/tools-local/tasks/mobile.tasks/WasmBuildTasks/CompileTimeZoneData.cs
similarity index 100%
rename from tools-local/tasks/mobile.tasks/GenerateWasmBundle/CompileTimeZoneData.cs
rename to tools-local/tasks/mobile.tasks/WasmBuildTasks/CompileTimeZoneData.cs
diff --git a/tools-local/tasks/mobile.tasks/GenerateWasmBundle/GenerateWasmBundle.cs b/tools-local/tasks/mobile.tasks/WasmBuildTasks/GenerateWasmBundle.cs
similarity index 100%
rename from tools-local/tasks/mobile.tasks/GenerateWasmBundle/GenerateWasmBundle.cs
rename to tools-local/tasks/mobile.tasks/WasmBuildTasks/GenerateWasmBundle.cs
diff --git a/tools-local/tasks/mobile.tasks/CreateWasmBundle/CreateWasmBundle.csproj b/tools-local/tasks/mobile.tasks/WasmBuildTasks/WasmBuildTasks.csproj
similarity index 100%
rename from tools-local/tasks/mobile.tasks/CreateWasmBundle/CreateWasmBundle.csproj
rename to tools-local/tasks/mobile.tasks/WasmBuildTasks/WasmBuildTasks.csproj
diff --git a/tools-local/tasks/tasks.proj b/tools-local/tasks/tasks.proj
index d9ab8b21f50..2885f69ff36 100644
--- a/tools-local/tasks/tasks.proj
+++ b/tools-local/tasks/tasks.proj
@@ -7,7 +7,7 @@
Condition="'$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'" />
-