Decouple migrating code from non-migrating code (#1725)

* Stop referencing BlazorBuildToolsExe in .Browser.JS

* Have Components projects always reference .Blazor.Mono as a package, not from source

* Finish decoupling of .Browser.JS from Blazor.BuildTools

* Fix reference resolver unit test to find Mono BCL in .Blazor.Mono package

* Remove typo

* Have .Browser.JS consume jsinterop only via an NPM package reference

* Reference JSInterop .NET libraries only via NuGet package references, not directly from source

* Update dependency resolver unit test

* Update package name in package-lock.json

* When bundling jsinterop DLL into Build package, don't re-sign it (treat it as external)
This commit is contained in:
Steve Sanderson 2018-11-26 18:52:09 +00:00 committed by GitHub
parent 682e8e6573
commit 163d6f7c54
17 changed files with 145 additions and 143 deletions

View File

@ -0,0 +1,25 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Runtime.CompilerServices;
namespace WebAssembly.JSInterop
{
// This file is copied from https://github.com/dotnet/jsinterop/blob/master/src/Mono.WebAssembly.Interop/InternalCalls.cs
// so that MonoSanityClient can directly use the same underlying interop APIs (because
// we're trying to observe the behavior of the Mono runtime itself, not JSInterop).
internal class InternalCalls
{
// The exact namespace, type, and method names must match the corresponding entries
// in driver.c in the Mono distribution
// We're passing asyncHandle by ref not because we want it to be writable, but so it gets
// passed as a pointer (4 bytes). We can pass 4-byte values, but not 8-byte ones.
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern string InvokeJSMarshalled(out string exception, ref long asyncHandle, string functionIdentifier, string argsJson);
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern TRes InvokeJSUnmarshalled<T0, T1, T2, TRes>(out string exception, string functionIdentifier, T0 arg0, T1 arg1, T2 arg2);
}
}

View File

@ -13,9 +13,4 @@
<!-- Local alternative to <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" /> --> <!-- Local alternative to <PackageReference Include="Microsoft.AspNetCore.Blazor.Build" /> -->
<Import Project="..\..\..\src\Microsoft.AspNetCore.Components.Build\ReferenceFromSource.props" /> <Import Project="..\..\..\src\Microsoft.AspNetCore.Components.Build\ReferenceFromSource.props" />
<ItemGroup>
<!-- Share the InternalCalls.cs source here so we get access to the same interop externs -->
<Compile Include="..\..\..\modules\jsinterop\src\Mono.WebAssembly.Interop\InternalCalls.cs" />
</ItemGroup>
</Project> </Project>

View File

@ -53,6 +53,7 @@
"Microsoft.Extensions.FileProviders.Physical.dll", "Microsoft.Extensions.FileProviders.Physical.dll",
"Microsoft.Extensions.FileSystemGlobbing.dll", "Microsoft.Extensions.FileSystemGlobbing.dll",
"Microsoft.Extensions.Primitives.dll", "Microsoft.Extensions.Primitives.dll",
"Microsoft.JSInterop.dll",
"Mono.Cecil.dll", "Mono.Cecil.dll",
"Mono.Cecil.Mdb.dll", "Mono.Cecil.Mdb.dll",
"Mono.Cecil.Pdb.dll", "Mono.Cecil.Pdb.dll",

View File

@ -16,6 +16,10 @@
<TemplateBlazorPackageVersion>0.8.0-preview1-20181122.3</TemplateBlazorPackageVersion> <TemplateBlazorPackageVersion>0.8.0-preview1-20181122.3</TemplateBlazorPackageVersion>
<TemplateRazorDesignPackageVersion>2.1.2</TemplateRazorDesignPackageVersion> <TemplateRazorDesignPackageVersion>2.1.2</TemplateRazorDesignPackageVersion>
<RazorPackageVersion>2.1.0</RazorPackageVersion> <RazorPackageVersion>2.1.0</RazorPackageVersion>
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.8.0-preview1-20181126.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
<!-- When updating this, ensure you also update Browser.JS/package.json to reference the corresponding version of @dotnet/jsinterop -->
<JSInteropPackageVersion>0.8.0-preview1-20181126.1</JSInteropPackageVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " /> <Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />

View File

@ -12,16 +12,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\blazor\src\Microsoft.AspNetCore.Blazor.BuildTools\Microsoft.AspNetCore.Blazor.BuildTools.csproj" PrivateAssets="all" ReferenceOutputAssembly="false" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(AspNetCorePackageVersion)" /> <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(AspNetCorePackageVersion)" />
<WebpackInputs Include="**\*.ts" Exclude="node_modules\**" /> <WebpackInputs Include="**\*.ts" Exclude="node_modules\**" />
<WebpackInputs Include="..\..\modules\jsinterop\src\Microsoft.JSInterop.JS\src\**" />
</ItemGroup> </ItemGroup>
<Import Project="..\..\blazor\src\Microsoft.AspNetCore.Blazor.BuildTools\BuildToolsExe.props" />
<Target Name="EnsureNpmRestored" Condition="!Exists('node_modules')"> <Target Name="EnsureNpmRestored" Condition="!Exists('node_modules')">
<Exec Command="$(BlazorBuildToolsExe) checknodejs -v 8.3.0" />
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." /> <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
<Exec Command="npm install" /> <Exec Command="npm install" />
</Target> </Target>

View File

@ -1,5 +1,5 @@
{ {
"name": "blazor.host.client", "name": "microsoft.aspnetcore.components.browser.js",
"version": "0.0.1", "version": "0.0.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
@ -19,6 +19,12 @@
"msgpack5": "4.2.0" "msgpack5": "4.2.0"
} }
}, },
"@dotnet/jsinterop": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@dotnet/jsinterop/-/jsinterop-0.1.1.tgz",
"integrity": "sha512-/Y5f3rtzZ85y8ukBds6IHRgnu7zwlAxe/JhaqN8mvj/JPDA4AtfdNqjJBZuZJxLrP0k6+q4owx/DS7LyZWccFQ==",
"dev": true
},
"@types/emscripten": { "@types/emscripten": {
"version": "0.0.31", "version": "0.0.31",
"resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-0.0.31.tgz", "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-0.0.31.tgz",
@ -1533,23 +1539,21 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"delegates": "^1.0.0", "delegates": "1.0.0",
"readable-stream": "^2.0.6" "readable-stream": "2.3.6"
} }
}, },
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
@ -1562,20 +1566,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -1616,7 +1617,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minipass": "^2.2.1" "minipass": "2.2.4"
} }
}, },
"fs.realpath": { "fs.realpath": {
@ -1631,14 +1632,14 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"aproba": "^1.0.3", "aproba": "1.2.0",
"console-control-strings": "^1.0.0", "console-control-strings": "1.1.0",
"has-unicode": "^2.0.0", "has-unicode": "2.0.1",
"object-assign": "^4.1.0", "object-assign": "4.1.1",
"signal-exit": "^3.0.0", "signal-exit": "3.0.2",
"string-width": "^1.0.1", "string-width": "1.0.2",
"strip-ansi": "^3.0.1", "strip-ansi": "3.0.1",
"wide-align": "^1.1.0" "wide-align": "1.1.2"
} }
}, },
"glob": { "glob": {
@ -1647,12 +1648,12 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"fs.realpath": "^1.0.0", "fs.realpath": "1.0.0",
"inflight": "^1.0.4", "inflight": "1.0.6",
"inherits": "2", "inherits": "2.0.3",
"minimatch": "^3.0.4", "minimatch": "3.0.4",
"once": "^1.3.0", "once": "1.4.0",
"path-is-absolute": "^1.0.0" "path-is-absolute": "1.0.1"
} }
}, },
"has-unicode": { "has-unicode": {
@ -1667,7 +1668,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safer-buffer": "^2.1.0" "safer-buffer": "2.1.2"
} }
}, },
"ignore-walk": { "ignore-walk": {
@ -1676,7 +1677,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minimatch": "^3.0.4" "minimatch": "3.0.4"
} }
}, },
"inflight": { "inflight": {
@ -1685,15 +1686,14 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"once": "^1.3.0", "once": "1.4.0",
"wrappy": "1" "wrappy": "1.0.2"
} }
}, },
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -1705,9 +1705,8 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "1.0.1"
} }
}, },
"isarray": { "isarray": {
@ -1720,25 +1719,22 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "1.1.11"
} }
}, },
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "5.1.1",
"yallist": "^3.0.0" "yallist": "3.0.2"
} }
}, },
"minizlib": { "minizlib": {
@ -1747,14 +1743,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"minipass": "^2.2.1" "minipass": "2.2.4"
} }
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -1771,9 +1766,9 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"debug": "^2.1.2", "debug": "2.6.9",
"iconv-lite": "^0.4.4", "iconv-lite": "0.4.21",
"sax": "^1.2.4" "sax": "1.2.4"
} }
}, },
"node-pre-gyp": { "node-pre-gyp": {
@ -1782,16 +1777,16 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"detect-libc": "^1.0.2", "detect-libc": "1.0.3",
"mkdirp": "^0.5.1", "mkdirp": "0.5.1",
"needle": "^2.2.0", "needle": "2.2.0",
"nopt": "^4.0.1", "nopt": "4.0.1",
"npm-packlist": "^1.1.6", "npm-packlist": "1.1.10",
"npmlog": "^4.0.2", "npmlog": "4.1.2",
"rc": "^1.1.7", "rc": "1.2.7",
"rimraf": "^2.6.1", "rimraf": "2.6.2",
"semver": "^5.3.0", "semver": "5.5.0",
"tar": "^4" "tar": "4.4.1"
} }
}, },
"nopt": { "nopt": {
@ -1800,8 +1795,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"abbrev": "1", "abbrev": "1.1.1",
"osenv": "^0.1.4" "osenv": "0.1.5"
} }
}, },
"npm-bundled": { "npm-bundled": {
@ -1816,8 +1811,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"ignore-walk": "^3.0.1", "ignore-walk": "3.0.1",
"npm-bundled": "^1.0.1" "npm-bundled": "1.0.3"
} }
}, },
"npmlog": { "npmlog": {
@ -1826,17 +1821,16 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"are-we-there-yet": "~1.1.2", "are-we-there-yet": "1.1.4",
"console-control-strings": "~1.1.0", "console-control-strings": "1.1.0",
"gauge": "~2.7.3", "gauge": "2.7.4",
"set-blocking": "~2.0.0" "set-blocking": "2.0.0"
} }
}, },
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -1848,9 +1842,8 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1.0.2"
} }
}, },
"os-homedir": { "os-homedir": {
@ -1871,8 +1864,8 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"os-homedir": "^1.0.0", "os-homedir": "1.0.2",
"os-tmpdir": "^1.0.0" "os-tmpdir": "1.0.2"
} }
}, },
"path-is-absolute": { "path-is-absolute": {
@ -1893,10 +1886,10 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"deep-extend": "^0.5.1", "deep-extend": "0.5.1",
"ini": "~1.3.0", "ini": "1.3.5",
"minimist": "^1.2.0", "minimist": "1.2.0",
"strip-json-comments": "~2.0.1" "strip-json-comments": "2.0.1"
}, },
"dependencies": { "dependencies": {
"minimist": { "minimist": {
@ -1913,13 +1906,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "1.0.2",
"inherits": "~2.0.3", "inherits": "2.0.3",
"isarray": "~1.0.0", "isarray": "1.0.0",
"process-nextick-args": "~2.0.0", "process-nextick-args": "2.0.0",
"safe-buffer": "~5.1.1", "safe-buffer": "5.1.1",
"string_decoder": "~1.1.1", "string_decoder": "1.1.1",
"util-deprecate": "~1.0.1" "util-deprecate": "1.0.2"
} }
}, },
"rimraf": { "rimraf": {
@ -1928,7 +1921,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"glob": "^7.0.5" "glob": "7.1.2"
} }
}, },
"safe-buffer": { "safe-buffer": {
@ -1970,11 +1963,10 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "1.1.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "1.0.0",
"strip-ansi": "^3.0.0" "strip-ansi": "3.0.1"
} }
}, },
"string_decoder": { "string_decoder": {
@ -1983,7 +1975,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "5.1.1"
} }
}, },
"strip-ansi": { "strip-ansi": {
@ -1991,7 +1983,7 @@
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "2.1.1"
} }
}, },
"strip-json-comments": { "strip-json-comments": {
@ -2006,13 +1998,13 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"chownr": "^1.0.1", "chownr": "1.0.1",
"fs-minipass": "^1.2.5", "fs-minipass": "1.2.5",
"minipass": "^2.2.4", "minipass": "2.2.4",
"minizlib": "^1.1.0", "minizlib": "1.1.0",
"mkdirp": "^0.5.0", "mkdirp": "0.5.1",
"safe-buffer": "^5.1.1", "safe-buffer": "5.1.1",
"yallist": "^3.0.2" "yallist": "3.0.2"
} }
}, },
"util-deprecate": { "util-deprecate": {
@ -2027,7 +2019,7 @@
"dev": true, "dev": true,
"optional": true, "optional": true,
"requires": { "requires": {
"string-width": "^1.0.2" "string-width": "1.0.2"
} }
}, },
"wrappy": { "wrappy": {

View File

@ -1,5 +1,5 @@
{ {
"name": "blazor.host.client", "name": "microsoft.aspnetcore.components.browser.js",
"version": "0.0.1", "version": "0.0.1",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
@ -9,12 +9,13 @@
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"devDependencies": { "devDependencies": {
"@aspnet/signalr": "^1.0.0",
"@aspnet/signalr-protocol-msgpack": "^1.0.0",
"@dotnet/jsinterop": "^0.1.1",
"@types/emscripten": "0.0.31", "@types/emscripten": "0.0.31",
"ts-loader": "^4.4.1", "ts-loader": "^4.4.1",
"typescript": "^2.9.2", "typescript": "^2.9.2",
"webpack": "^4.12.0", "webpack": "^4.12.0",
"webpack-cli": "^3.0.8", "webpack-cli": "^3.0.8"
"@aspnet/signalr": "^1.0.0",
"@aspnet/signalr-protocol-msgpack": "^1.0.0"
} }
} }

View File

@ -1,6 +1,5 @@
import '../../../modules/jsinterop/src/Microsoft.JSInterop.JS/src/Microsoft.JSInterop'; import '@dotnet/jsinterop';
import './GlobalExports'; import './GlobalExports';
import * as Environment from './Environment';
import * as signalR from '@aspnet/signalr'; import * as signalR from '@aspnet/signalr';
import { MessagePackHubProtocol } from '@aspnet/signalr-protocol-msgpack'; import { MessagePackHubProtocol } from '@aspnet/signalr-protocol-msgpack';
import { OutOfProcessRenderBatch } from './Rendering/RenderBatch/OutOfProcessRenderBatch'; import { OutOfProcessRenderBatch } from './Rendering/RenderBatch/OutOfProcessRenderBatch';

View File

@ -1,10 +1,9 @@
import '../../../modules/jsinterop/src/Microsoft.JSInterop.JS/src/Microsoft.JSInterop'; import '@dotnet/jsinterop';
import './GlobalExports'; import './GlobalExports';
import * as Environment from './Environment'; import * as Environment from './Environment';
import { monoPlatform } from './Platform/Mono/MonoPlatform'; import { monoPlatform } from './Platform/Mono/MonoPlatform';
import { getAssemblyNameFromUrl } from './Platform/Url'; import { getAssemblyNameFromUrl } from './Platform/Url';
import { renderBatch } from './Rendering/Renderer'; import { renderBatch } from './Rendering/Renderer';
import { RenderBatch } from './Rendering/RenderBatch/RenderBatch';
import { SharedMemoryRenderBatch } from './Rendering/RenderBatch/SharedMemoryRenderBatch'; import { SharedMemoryRenderBatch } from './Rendering/RenderBatch/SharedMemoryRenderBatch';
import { Pointer } from './Platform/Platform'; import { Pointer } from './Platform/Platform';
import { fetchBootConfigAsync, loadEmbeddedResourcesAsync } from './BootCommon'; import { fetchBootConfigAsync, loadEmbeddedResourcesAsync } from './BootCommon';

View File

@ -24,7 +24,7 @@ function loadResourceFromElement(element: HTMLElement) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
element.onload = resolve; element.onload = resolve;
element.onerror = reject; element.onerror = reject;
document.head.appendChild(element); document.head!.appendChild(element);
}); });
} }

View File

@ -6,10 +6,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCorePackageVersion)" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(AspNetCorePackageVersion)" />
<PackageReference Include="Mono.WebAssembly.Interop" Version="$(JSInteropPackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\modules\jsinterop\src\Mono.WebAssembly.Interop\Mono.WebAssembly.Interop.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Components\Microsoft.AspNetCore.Components.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Components\Microsoft.AspNetCore.Components.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -21,7 +21,8 @@
<NuspecProperties> <NuspecProperties>
version=$(PackageVersion); version=$(PackageVersion);
publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir))); publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir)));
razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion);</NuspecProperties> razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion);
blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion);</NuspecProperties>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<_TargetFramework Include="$(TargetFrameworks)" /> <_TargetFramework Include="$(TargetFrameworks)" />

View File

@ -12,7 +12,7 @@
<dependencies> <dependencies>
<dependency id="Microsoft.AspNetCore.Razor.Design" version="$razorversion$" include="all" /> <dependency id="Microsoft.AspNetCore.Razor.Design" version="$razorversion$" include="all" />
<dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$version$" include="all" /> <dependency id="Microsoft.AspNetCore.Components.Analyzers" version="$version$" include="all" />
<dependency id="Microsoft.AspNetCore.Blazor.Mono" version="$version$" include="all" /> <dependency id="Microsoft.AspNetCore.Blazor.Mono" version="$blazormonoversion$" include="all" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@ -9,17 +9,8 @@
This is only intended for use by other projects in this repo. This is only intended for use by other projects in this repo.
--> -->
<!--
TODO: Remove this propertygroup once we start referencing Microsoft.AspNetCore.Blazor.Mono
as an external package dependency (i.e., not in same repo).
-->
<PropertyGroup> <PropertyGroup>
<BlazorBuildReferenceFromSource>true</BlazorBuildReferenceFromSource> <BlazorBuildReferenceFromSource>true</BlazorBuildReferenceFromSource>
<BlazorMonoRuntimeBasePath>$(MSBuildThisFileDirectory)../../blazor/src/Microsoft.AspNetCore.Blazor.Mono/</BlazorMonoRuntimeBasePath>
<MonoLinkerPath>$(BlazorMonoRuntimeBasePath)tools/binaries/illink/illink.dll</MonoLinkerPath>
<MonoBaseClassLibraryPath>$(BlazorMonoRuntimeBasePath)dist/bcl/</MonoBaseClassLibraryPath>
<MonoBaseClassLibraryFacadesPath>$(BlazorMonoRuntimeBasePath)dist/bcl/Facades/</MonoBaseClassLibraryFacadesPath>
<MonoWasmRuntimePath>$(BlazorMonoRuntimeBasePath)dist/wasm/</MonoWasmRuntimePath>
<BlazorJsPath>$(MSBuildThisFileDirectory)../Microsoft.AspNetCore.Components.Browser.JS/dist/blazor.*.js</BlazorJsPath> <BlazorJsPath>$(MSBuildThisFileDirectory)../Microsoft.AspNetCore.Components.Browser.JS/dist/blazor.*.js</BlazorJsPath>
</PropertyGroup> </PropertyGroup>
@ -27,6 +18,7 @@
<Import Project="$(MSBuildThisFileDirectory)targets/All.targets" /> <Import Project="$(MSBuildThisFileDirectory)targets/All.targets" />
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Mono" Version="$(MicrosoftAspNetCoreBlazorMonoPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="$(MicrosoftAspNetCoreRazorDesignPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="$(MicrosoftAspNetCoreRazorDesignPackageVersion)" />
</ItemGroup> </ItemGroup>
@ -41,8 +33,6 @@
<!-- Ensures these projects are built before the consuming project, but without <!-- Ensures these projects are built before the consuming project, but without
adding a runtime dependency on the .dll (to be equivalent to a <PackageDependency> adding a runtime dependency on the .dll (to be equivalent to a <PackageDependency>
given that the packed version of this project wouldn't add a .dll reference) --> given that the packed version of this project wouldn't add a .dll reference) -->
<MSBuild Projects="$(MSBuildThisFileDirectory)..\..\blazor\src\Microsoft.AspNetCore.Blazor.BuildTools\Microsoft.AspNetCore.Blazor.BuildTools.csproj" Targets="Build" />
<MSBuild Projects="$(MSBuildThisFileDirectory)..\..\blazor\src\Microsoft.AspNetCore.Blazor.Mono\Microsoft.AspNetCore.Blazor.Mono.csproj" Targets="Build" />
<MSBuild Projects="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Components.Build.csproj" Targets="Build" /> <MSBuild Projects="$(MSBuildThisFileDirectory)Microsoft.AspNetCore.Components.Build.csproj" Targets="Build" />
</Target> </Target>

View File

@ -5,7 +5,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\modules\jsinterop\src\Microsoft.JSInterop\Microsoft.JSInterop.csproj" /> <PackageReference Include="Microsoft.JSInterop" Version="$(JSInteropPackageVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -28,6 +28,7 @@
<PackageReference Include="xunit" Version="2.3.1" /> <PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" /> <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="Mono.Cecil" Version="0.10.0-beta7" /> <PackageReference Include="Mono.Cecil" Version="0.10.0-beta7" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Mono" Version="$(MicrosoftAspNetCoreBlazorMonoPackageVersion)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -41,7 +42,13 @@
<!-- A bit of msbuild magic to support reference resolver tests --> <!-- A bit of msbuild magic to support reference resolver tests -->
<Target Name="CreateReferenceHintPathsList" AfterTargets="Build"> <Target Name="CreateReferenceHintPathsList" AfterTargets="Build">
<ItemGroup>
<_BclDirectory Include="$(MonoBaseClassLibraryPath)" />
<_BclDirectory Include="$(MonoBaseClassLibraryFacadesPath)" />
</ItemGroup>
<WriteLinesToFile Lines="@(ReferencePath)" File="$(TargetDir)referenceHints.txt" WriteOnlyWhenDifferent="true" Overwrite="true" /> <WriteLinesToFile Lines="@(ReferencePath)" File="$(TargetDir)referenceHints.txt" WriteOnlyWhenDifferent="true" Overwrite="true" />
<WriteLinesToFile Lines="@(_BclDirectory)" File="$(TargetDir)bclLocations.txt" WriteOnlyWhenDifferent="true" Overwrite="true" />
</Target> </Target>
</Project> </Project>

View File

@ -16,11 +16,13 @@ namespace Microsoft.AspNetCore.Components.Build.Test
// Arrange // Arrange
var standaloneAppAssembly = typeof(StandaloneApp.Program).Assembly; var standaloneAppAssembly = typeof(StandaloneApp.Program).Assembly;
var mainAssemblyLocation = standaloneAppAssembly.Location; var mainAssemblyLocation = standaloneAppAssembly.Location;
var mainAssemblyDirectory = Path.GetDirectoryName(mainAssemblyLocation);
// This list of hints is populated by MSBuild so it will be on the output // This list of hints is populated by MSBuild so it will be on the output
// folder. // folder.
var hintPaths = File.ReadAllLines(Path.Combine( var hintPaths = File.ReadAllLines(Path.Combine(
Path.GetDirectoryName(mainAssemblyLocation), mainAssemblyDirectory, "referenceHints.txt"));
"referenceHints.txt")); var bclLocations = File.ReadAllLines(Path.Combine(
mainAssemblyDirectory, "bclLocations.txt"));
var references = new[] var references = new[]
{ {
"Microsoft.AspNetCore.Components.Browser.dll", "Microsoft.AspNetCore.Components.Browser.dll",
@ -32,13 +34,6 @@ namespace Microsoft.AspNetCore.Components.Build.Test
}.Select(a => hintPaths.Single(p => Path.GetFileName(p) == a)) }.Select(a => hintPaths.Single(p => Path.GetFileName(p) == a))
.ToArray(); .ToArray();
var basePath = Path.GetDirectoryName(typeof(RuntimeDependenciesResolverTest).Assembly.Location);
var bclLocations = new []
{
Path.Combine(basePath, "../../../../../blazor/src/Microsoft.AspNetCore.Blazor.Mono/dist/bcl/"),
Path.Combine(basePath, "../../../../../blazor/src/Microsoft.AspNetCore.Blazor.Mono/dist/bcl/Facades/"),
};
var expectedContents = new[] var expectedContents = new[]
{ {
/* /*
@ -64,10 +59,8 @@ namespace Microsoft.AspNetCore.Components.Build.Test
"Microsoft.Extensions.DependencyInjection.Abstractions.dll", "Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"Microsoft.Extensions.DependencyInjection.dll", "Microsoft.Extensions.DependencyInjection.dll",
"Microsoft.JSInterop.dll", "Microsoft.JSInterop.dll",
"Microsoft.JSInterop.pdb",
"Mono.Security.dll", "Mono.Security.dll",
"Mono.WebAssembly.Interop.dll", "Mono.WebAssembly.Interop.dll",
"Mono.WebAssembly.Interop.pdb",
"mscorlib.dll", "mscorlib.dll",
"netstandard.dll", "netstandard.dll",
"StandaloneApp.dll", "StandaloneApp.dll",