diff --git a/pkg/.gitignore b/pkg/.gitignore new file mode 100644 index 000000000..c9af6fe2f --- /dev/null +++ b/pkg/.gitignore @@ -0,0 +1,5 @@ +feed/ +publish/ +obj/ +ref/ +.dotnet/ diff --git a/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.csproj b/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.csproj new file mode 100644 index 000000000..16bb95df7 --- /dev/null +++ b/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.1 + <_AspNetCoreAppSharedFxIsEnabled>false + https://api.nuget.org/v3/index.json + + + + + + diff --git a/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.nuspec b/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.nuspec new file mode 100644 index 000000000..94c80b787 --- /dev/null +++ b/pkg/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.nuspec @@ -0,0 +1,27 @@ + + + + Microsoft.AspNetCore.App.RefOnly + 2.1.0 + Microsoft + Microsoft + true + https://raw.githubusercontent.com/aspnet/Home/2.0.0/LICENSE.txt + https://asp.net/ + https://go.microsoft.com/fwlink/?LinkID=288859 + Microsoft.AspNetCore.App + © Microsoft Corporation. All rights reserved. + aspnetcore + true + + + + + + + + + + + + diff --git a/pkg/Microsoft.AspNetCore.App.RefOnly/build/netcoreapp2.1/Microsoft.AspNetCore.App.RefOnly.targets b/pkg/Microsoft.AspNetCore.App.RefOnly/build/netcoreapp2.1/Microsoft.AspNetCore.App.RefOnly.targets new file mode 100644 index 000000000..bf2c1adee --- /dev/null +++ b/pkg/Microsoft.AspNetCore.App.RefOnly/build/netcoreapp2.1/Microsoft.AspNetCore.App.RefOnly.targets @@ -0,0 +1,11 @@ + + + Microsoft.AspNetCore.App.RefOnly + + + + + + diff --git a/pkg/Microsoft.AspNetCore.App.RefOnly/lib/netcoreapp2.1/_._ b/pkg/Microsoft.AspNetCore.App.RefOnly/lib/netcoreapp2.1/_._ new file mode 100644 index 000000000..e69de29bb diff --git a/pkg/build.ps1 b/pkg/build.ps1 new file mode 100644 index 000000000..b6d0a99a6 --- /dev/null +++ b/pkg/build.ps1 @@ -0,0 +1,42 @@ +$ErrorActionPreference = 'stop' + +mkdir -p "$PSScriptRoot/obj" -ea ignore | out-null + +function Invoke-Block ([scriptblock] $_cmd) { + & $_cmd + if ((-not $?) -or ($LASTEXITCODE -ne 0)) { + throw "command failed" + } +} + +$nuget = "$PSScriptRoot/obj/nuget.exe" +if (-not (Test-Path $nuget)) { + iwr -o $nuget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +} + +$dotnet = "$PSScriptRoot/.dotnet/dotnet" +$dotnetInstall = "$PSScriptRoot/obj/dotnet-install.ps1" +if (-not (Test-Path $dotnetInstall)) { + iwr -o $dotnetInstall https://raw.githubusercontent.com/dotnet/cli/release/2.1.3xx/scripts/obtain/dotnet-install.ps1 +} +& $dotnetInstall -installdir "$PSScriptRoot/.dotnet" -version 2.1.300 +Copy-Item -Recurse "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App" "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App.RefOnly" +mv "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App.RefOnly/2.1.0/Microsoft.AspNetCore.App.deps.json" "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App.RefOnly/2.1.0/Microsoft.AspNetCore.App.RefOnly.deps.json" +mv "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App.RefOnly/2.1.0/Microsoft.AspNetCore.App.runtimeconfig.json" "$PSScriptRoot/.dotnet/shared/Microsoft.AspNetCore.App.RefOnly/2.1.0/Microsoft.AspNetCore.App.RefOnly.runtimeconfig.json" +$refsPublish = "$PSScriptRoot/Microsoft.AspNetCore.App.RefOnly/ref/netcoreapp2.1" +Invoke-Block { & $dotnet publish Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.csproj --output $refsPublish } +rm "$refsPublish/Microsoft.AspNetCore.App.RefOnly.dll" +rm "$refsPublish/runtimes/" -Recurse +rm "$refsPublish/*.json" +Invoke-Block { & $nuget pack "$PSScriptRoot/Microsoft.AspNetCore.App.RefOnly/Microsoft.AspNetCore.App.RefOnly.nuspec" -OutputDirectory "$PSScriptRoot/feed" } + +rm $env:USERPROFILE/.nuget/packages/Microsoft.AspNetCore.App.RefOnly -Recurse -ea ignore +Invoke-Block { & $dotnet publish test/test.csproj -o "$(pwd)/publish/" } + +pushd publish +try { + Invoke-Block { & $dotnet test.dll } +} +finally { + popd +} diff --git a/pkg/global.json b/pkg/global.json new file mode 100644 index 000000000..915fb1cb7 --- /dev/null +++ b/pkg/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "2.1.300" + } +} diff --git a/pkg/test/Program.cs b/pkg/test/Program.cs new file mode 100644 index 000000000..bbe8b534a --- /dev/null +++ b/pkg/test/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace test +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/pkg/test/Startup.cs b/pkg/test/Startup.cs new file mode 100644 index 000000000..83831998b --- /dev/null +++ b/pkg/test/Startup.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace test +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.Run(async (context) => + { + await context.Response.WriteAsync("Hello World!"); + }); + } + } +} diff --git a/pkg/test/test.csproj b/pkg/test/test.csproj new file mode 100644 index 000000000..962bb8c9a --- /dev/null +++ b/pkg/test/test.csproj @@ -0,0 +1,12 @@ + + + + netcoreapp2.1 + https://api.nuget.org/v3/index.json;$(MSBuildProjectDirectory)\..\feed\ + + + + + + +