Skip to content

Commit

Permalink
Konvert to KoreBuild
Browse files Browse the repository at this point in the history
  • Loading branch information
rynowak authored and SteveSandersonMS committed Mar 14, 2018
1 parent 2575939 commit f30ce5a
Show file tree
Hide file tree
Showing 38 changed files with 946 additions and 234 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ test: 'off'
deploy: 'off'
os: Visual Studio 2017 Preview
build_script:
- dotnet build Blazor.sln
- build.cmd /p:SkipTests=true
before_test:
- choco install googlechrome --ignore-checksum
- npm install -g selenium-standalone
- selenium-standalone install
- ps: $SeleniumProcess = Start-Process "selenium-standalone" -ArgumentList "start" -PassThru
test_script:
- dotnet test test\AllTests.proj
- build.cmd /t:Test /p:BlazorAllTests=true
after_test:
- ps: Stop-Process -Id $SeleniumProcess.Id
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ install:
- curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --version latest --install-dir "$DOTNET_INSTALL_DIR"
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
script:
- dotnet build Blazor.sln
- ./build.sh /p:SkipTests=true
- selenium-standalone start &
- dotnet test test/AllTests.proj
- ./build.sh /t:Test /p:BlazorAllTests=true
148 changes: 138 additions & 10 deletions Blazor.sln

Large diffs are not rendered by default.

112 changes: 0 additions & 112 deletions BlazorTooling.sln

This file was deleted.

18 changes: 17 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
<Project>
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />

<Import Project="version.props" />
<Import Project="build\dependencies.props" />
<Import Project="build\sources.props" />

<PropertyGroup>
<Product>Microsoft ASP.NET Core Blazor</Product>
<RepositoryUrl>https://github.com/aspnet/blazor</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\Key.snk</AssemblyOriginatorKeyFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts\build</PackageOutputPath>
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>

<!-- Our customizations -->
<SignAssembly>false</SignAssembly>
<EnableApiCheck>false</EnableApiCheck>
<PublicSign>false</PublicSign>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
</ItemGroup>

<PropertyGroup>
<RazorPackageVersion>2.1.0-preview2-30230</RazorPackageVersion>
</PropertyGroup>
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">$(MicrosoftNETCoreApp20PackageVersion)</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">$(MicrosoftNETCoreApp21PackageVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>
43 changes: 18 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ We are still *very early* in this project. There isn't yet anything you can down
## Build

Prerequisites:
- [.NET Core SDK](https://dot.net/core) (>2.1.4)
- [Node.js](https://nodejs.org/) (>8.3)

Run `dotnet build Blazor.sln` from the solution directory.
The build script will acquire the required version of the .NET runtime and .NET SDK on first run.

## Run tests
Run `build.cmd` or `build.sh` from the solution directory.

Run `dotnet test test/<dir>/<project>.Test.csproj`
## Run unit tests

Run `build.cmd /t:Test` or `build.sh /t:Test`

## Run end-to-end tests

Expand All @@ -52,35 +53,27 @@ Prerequisites:

Run `selenium-standalone start`

Run `dotnet test test\Microsoft.AspNetCore.Blazor.E2ETest\Microsoft.AspNetCore.Blazor.E2ETest.csproj`

## Run all tests

Install prerequisites for E2E tests
Run `build.cmd /t:Test /p:BlazorAllTests=true` or `build.sh /t:Test /p:BlazorAllTests=true`

Run `dotnet test test\AllTests.proj`

## Build VS Tooling
## Opening in Visual Studio

Prerequisites:
- Visual Studio 2017 15.6 (or newer)
- Visual Studio extension development features (install via Visual Studio Installer)

Open a VS Developer Command Prompt
- Visual Studio 2017 15.7 preview 1 (or newer) - [download](https://www.visualstudio.com/thank-you-downloading-visual-studio/?ch=pre&sku=Enterprise&rel=15)

Run the following instructions from the solution directory.
We recommend getting the preview version of Visual Studio and updating it frequently. The Blazor
editing experience in Visual Studio depends on new features of the Razor language tooling and
will be updated frequently.

```shell
msbuild BlazorTooling.sln /t:Restore
msbuild BlazorTooling.sln
```
When installing Visual Studio choose the following workloads:
- ASP.NET and Web Development
- Visual Studio extension development features

## Use VS Tooling
## Developing the Blazor VS Tooling

To install the Tooling following prerequisites must be installed first:
To do local development of the Blazor tooling experience in VS, select the `Microsoft.VisualStudio.BlazorExtension`
project and launch the debugger.

- Visual Studio 2017 15.6 (or newer)
- Workload: ASP.NET and web development
The Blazor Visual Studio tooling will build as part of the command line build when on Windows.

## Contributing

Expand Down
2 changes: 2 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
chmod +x "$DIR/run.sh"; sync
"$DIR/run.sh" default-build "$@"
120 changes: 120 additions & 0 deletions build/VSIX.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<Project>
<PropertyGroup>
<BuildVSIX Condition="'$(BuildVSIX)' ==''">true</BuildVSIX>
<RestoreDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(RestoreDependsOn);RestoreVSIX</RestoreDependsOn>
<PackageDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(PackageDependsOn);PackageVSIX</PackageDependsOn>
<GetArtifactInfoDependsOn Condition="'$(OS)'=='Windows_NT' AND '$(BuildVSIX)' == 'true'">$(GetArtifactInfoDependsOn);GetVSIXArtifactInfo</GetArtifactInfoDependsOn>
<VSIXName>Microsoft.VisualStudio.BlazorExtension</VSIXName>
<VSIXOutputPath>$(BuildDir)$(VSIXName).vsix</VSIXOutputPath>
<VSIXManifestOutputPath>$(BuildDir)$(VSIXName).json</VSIXManifestOutputPath>
<VSIXProject>$(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj</VSIXProject>
<VSIXSymbolsOutputPath>$(BuildDir)$(VSIXName).pdb</VSIXSymbolsOutputPath>
<VSIXArtifactCategory>shipoob</VSIXArtifactCategory>
</PropertyGroup>

<Target
Name="GenerateVSIX"
DependsOnTargets="RestoreVSIX;PackageVSIX"
Condition="'$(OS)'=='Windows_NT'" />

<!-- This target is required so KoreBuild can generate a bill of materials with relevant information about the VSIX. -->
<Target Name="GetVSIXArtifactInfo">
<ItemGroup>

<ArtifactInfo Include="$(VSIXOutputPath)">
<ArtifactType>VsixPackage</ArtifactType>
<Version>$(PackageVersion)</Version>
<Category>$(VSIXArtifactCategory)</Category>
<PackageId>$(VSIXName)</PackageId>
</ArtifactInfo>

<ArtifactInfo Include="$(VSIXSymbolsOutputPath)">
<ArtifactType>SymbolsFile</ArtifactType>
<Category>$(VSIXArtifactCategory)</Category>
<Dependencies>$(VSIXName).vsix</Dependencies>
<DebugType>full</DebugType>
</ArtifactInfo>

<ArtifactInfo Include="$(VSIXManifestOutputPath)" Condition="'$(IsProductComponent)'=='true'">
<ArtifactType>VsixPackageManifestFile</ArtifactType>
<Category>$(VSIXArtifactCategory)</Category>
<Dependencies>$(VSIXName).vsix</Dependencies>
<PackageId>$(VSIXName)</PackageId>
</ArtifactInfo>

<FilesToSign Include="$(VSIXOutputPath)" Certificate="Vsix" />
<FilesToExcludeFromSigning Include="$(VSIXManifestOutputPath)" />
<FilesToExcludeFromSigning Include="$(VSIXSymbolsOutputPath)" />

</ItemGroup>
</Target>

<!--
VisualStudioMSBuildx86Path is set by the GetToolsets target in KoreBuild if a version of VS matching the requirements in korebuild.json is found.
-->
<Target Name="RestoreVSIX" DependsOnTargets="GetToolsets">

<PropertyGroup>
<VSIXResponseFilePath>$(LogOutputDir)vsix-restore.rsp</VSIXResponseFilePath>
</PropertyGroup>

<ItemGroup>
<MSBuildArguments Remove="@(MSBuildArguments)" />
<MSBuildArguments Include="
$(VSIXProject);
/t:Restore;
/m;
/v:m;
/p:Configuration=$(Configuration);
/p:BuildNumber=$(BuildNumber);" />
<MSBuildArguments Include="/p:DotNetPackageVersionPropsPath=$(DotNetPackageVersionPropsPath)" Condition="'$(DotNetPackageVersionPropsPath)' != ''" />
<MSBuildArguments Include="/p:DotNetRestoreSourcePropsPath=$(DotNetRestoreSourcePropsPath)" Condition="'$(DotNetRestoreSourcePropsPath)' != ''" />
</ItemGroup>

<MakeDir Directories="$(LogOutputDir)" />

<WriteLinesToFile
File="$(VSIXResponseFilePath)"
Lines="@(MSBuildArguments)"
Overwrite="true" />

<Exec Command="&quot;$(VisualStudioMSBuildx86Path)&quot; @&quot;$(VSIXResponseFilePath)&quot;"
Condition="'$(VisualStudioMSBuildx86Path)' != ''" />
</Target>

<Target Name="PackageVSIX" DependsOnTargets="GetToolsets">

<Warning Text="Could not find a version of Visual Studio that has the Visual Studio SDK installed. This is required to build the Razor VSIX. Skipping."
Condition="'$(VisualStudioMSBuildx86Path)' == ''" />

<PropertyGroup>
<VSIXLogFilePath>$(LogOutputDir)vsix.log</VSIXLogFilePath>
<VSIXResponseFilePath>$(LogOutputDir)vsix-build.rsp</VSIXResponseFilePath>
</PropertyGroup>

<ItemGroup>
<MSBuildArguments Remove="@(MSBuildArguments)" />
<MSBuildArguments Include="
$(VSIXProject);
/m;
/v:M;
/fl;
/flp:LogFile=$(VSIXLogFilePath);
/p:DeployExtension=false;
/p:TargetVSIXContainer=$(VSIXOutputPath);
/p:SymbolsPublishDir=$(BuildDir);
/p:Configuration=$(Configuration);" />
</ItemGroup>

<MakeDir Directories="$(LogOutputDir)" />

<WriteLinesToFile
File="$(VSIXResponseFilePath)"
Lines="@(MSBuildArguments)"
Overwrite="true" />

<Exec Command="&quot;$(VisualStudioMSBuildx86Path)&quot; @&quot;$(VSIXResponseFilePath)&quot;"
Condition="'$(VisualStudioMSBuildx86Path)' != ''" />
</Target>

</Project>
7 changes: 1 addition & 6 deletions build/aspnetci-build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1' -OutFile .\build\dotnet-install.ps1
.\build\dotnet-install.ps1 -channel Current -version 2.1.3 -InstallDir dotnetsdk
dotnet --version
dotnet pack Blazor.sln --configuration Release
cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\aspnetci\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" BlazorTooling.sln /t:Restore
cmd /c "C:\Program Files (x86)\Microsoft Visual Studio\aspnetci\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" BlazorTooling.sln /p:DeployExtension=false /p:TargetVSIXContainer=..\..\artifacts\build\Microsoft.VisualStudio.BlazorExtension.vsix
build.cmd
10 changes: 10 additions & 0 deletions build/dependencies.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview2-15704</InternalAspNetCoreSdkPackageVersion>
</PropertyGroup>

<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
</Project>
Loading

0 comments on commit f30ce5a

Please sign in to comment.