Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup conversion to Arcade #1014

Merged
merged 14 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ node_modules/
BenchmarkDotNet.Artifacts/
*.binlog
dist/
.dotnet/
48 changes: 12 additions & 36 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,66 +1,42 @@
<Project>
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />

<PropertyGroup>
<UsingToolXliff>false</UsingToolXliff>
</PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<RepoRelativeProjectDir>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))</RepoRelativeProjectDir>

<!-- Update variables to match this repo's conventions for project naming. -->
<PropertyGroup Condition="'$(IsUnitTestProject)' == ''">
<!-- Set these before importing Arcade to override Arcade's defaults -->
<IsUnitTestProject>false</IsUnitTestProject>
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests'))">true</IsUnitTestProject>
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.FunctionalTests'))">true</IsUnitTestProject>
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests')) OR $(MSBuildProjectName.EndsWith('.FunctionalTests'))">true</IsUnitTestProject>
<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance'))">true</IsBenchmarkProject>
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('samples'))">true</IsSampleProject>
</PropertyGroup>

<Import Project="eng\Workarounds.BeforeArcade.props" />
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="eng\Workarounds.AfterArcade.props" />

<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<Serviceable Condition="'$(Configuration)' == 'Release'">true</Serviceable>
<PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl>
<PackageIconUrl>https://go.microsoft.com/fwlink/?LinkID=288859</PackageIconUrl>
<PackageProjectUrl>https://asp.net</PackageProjectUrl>
<NoPackageAnalysis>true</NoPackageAnalysis>
<LangVersion>7.2</LangVersion>
<LangVersion>7.3</LangVersion>

<Product>Microsoft .NET Extensions</Product>
<RepositoryUrl>https://github.com/aspnet/Extensions</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<SignAssembly>true</SignAssembly>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Enables Strict mode for Roslyn compiler -->
<Features>strict</Features>

<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<ArtifactsDir>$(MSBuildThisFileDirectory)artifacts\</ArtifactsDir>
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts\build\</PackageOutputPath>
<SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\src\</SharedSourceRoot>
<ArtifactsConfigurationDir>$(ArtifactsDir)$(Configuration)\</ArtifactsConfigurationDir>
<BasePackageOutputPath>$(ArtifactsConfigurationDir)packages\</BasePackageOutputPath>
<DebugType>portable</DebugType>

<RepoRelativeProjectDir>$([MSBuild]::MakeRelative($(RepositoryRoot), $(MSBuildProjectDirectory)))</RepoRelativeProjectDir>

<!--
By default, all projects which produce packages are not intended to ship to NuGet.org as a product package.
Packages which are intended to ship to NuGet.org must opt-in by setting this to true in their project file.
-->
<IsProductComponent>false</IsProductComponent>

<IsBenchmarkProject Condition="$(MSBuildProjectName.EndsWith('.Performance'))">true</IsBenchmarkProject>
<IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
<IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('samples'))">true</IsSampleProject>
</PropertyGroup>

<PropertyGroup>
<DeveloperBuildTestTfms>netcoreapp3.0</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
</PropertyGroup>

<ItemGroup Condition=" '$(IsTestProject)' == 'true' ">
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'true' ">
<Reference Include="Microsoft.AspNetCore.Testing" />
<Reference Include="Moq" />
<Reference Include="xunit.analyzers" />
Expand Down
4 changes: 0 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
<Description Condition=" '$(Description)' == ''">$(PackageId)</Description>
<IsPackable Condition="'$(IsPackable)' == '' AND ( '$(IsUnitTestProject)' == 'true' OR '$(IsTestAssetProject)' == 'true' OR '$(IsBenchmarkProject)' == 'true' OR '$(IsSampleProject)' == 'true' ) ">false</IsPackable>
<IsPackable Condition="'$(IsPackable)' == '' ">true</IsPackable>
<IsShipping>$(IsProductComponent)</IsShipping>
</PropertyGroup>

<Import Project="eng\Baseline.Designer.props" />
Expand All @@ -35,9 +34,6 @@
<PropertyGroup>
<!-- Implementation projects are the projects which produce nuget packages or shipping assemblies. -->
<IsImplementationProject Condition=" '$(IsImplementationProject)' == '' AND '$(IsTestAssetProject)' != 'true' AND '$(IsUnitTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true' AND '$(IsSampleProject)' != 'true' ">true</IsImplementationProject>

<!-- Suppress KoreBuild warnings about the mismatch of repo version and local project version. The versioning in this mega repo is sufficiently complicated that KoreBuild's validation isn't helpful. -->
<VerifyVersion>false</VerifyVersion>
</PropertyGroup>

<Import Project="eng\targets\Packaging.targets" Condition=" '$(MSBuildProjectExtension)' == '.csproj' " />
Expand Down
4 changes: 0 additions & 4 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
<configuration>
<packageSources>
<clear />
<add key="aspnetcore dev" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
<add key="aspnetcore tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
<add key="arcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json" />
<add key="myget dnc" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
Expand Down
17 changes: 8 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ variables:
# CI and PR triggers
trigger:
- master
- release/*
- internal/release/*

pr:
- master
autoCancel: false
branches:
include:
- '*'

jobs:
- template: /eng/common/templates/jobs/jobs.yml
Expand All @@ -24,8 +29,7 @@ jobs:
# For public or PR jobs, use the hosted pool. For internal jobs use the internal pool.
# Will eventually change this to two BYOC pools.
${{ if ne(variables['System.TeamProject'], 'internal') }}:
name: Hosted VS2017
vmImage: vs2017-win2016
name: dotnet-external-temp
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: dotnet-internal-temp
variables:
Expand Down Expand Up @@ -53,15 +57,13 @@ jobs:
_BuildConfig: Debug
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs:

Release:
_BuildConfig: Release
# PRs or external builds are not signed.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs:
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: real
_DotNetPublishToBlobFeed: true
Expand All @@ -70,12 +72,11 @@ jobs:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
-warnaserror $False
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
displayName: Build and Publish
- powershell: eng\common\msbuild.ps1 eng/repo.targets '/p:IsFinalBuild=$(IsFinalBuild)' '/p:CI=true'
- powershell: eng\common\msbuild.ps1 eng/repo.targets /t:TagCiBuilds '/p:IsFinalBuild=$(IsFinalBuild)' '/p:CI=true'
displayName: Set CI Tags
condition: eq(variables['_BuildConfig'], 'Release')
- task: PublishBuildArtifacts@1
Expand Down Expand Up @@ -110,7 +111,6 @@ jobs:
- checkout: self
clean: true
- script: eng/common/cibuild.sh
--warnAsError false
--configuration $(_BuildConfig)
--prepareMachine
displayName: Build
Expand All @@ -135,7 +135,6 @@ jobs:
- checkout: self
clean: true
- script: eng/common/cibuild.sh
--warnAsError false
--configuration $(_BuildConfig)
--prepareMachine
displayName: Build
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -warnaserror $False -build -restore -pack %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -build -restore -pack %*"
exit /b %ErrorLevel%
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/eng/common/build.sh" --pack --build --restore --warnAsError false $@
"$scriptroot/eng/common/build.sh" --pack --build --restore $@
40 changes: 7 additions & 33 deletions docs/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,14 @@ Building ASP.NET Core on macOS or Linux requires:
* At least 5 GB of disk space and a good internet connection (our build scripts download a lot of tools and dependencies)
* Git <https://git-scm.org>

## Building in Visual Studio / Code
## Building in Visual Studio

Before opening our .sln files in Visual Studio or VS Code, executing the following on command-line:
Visual Studio requires special tools and command lien parameters. You can acquire these by executing the following on command-line:
```
.\build.cmd /t:Restore
.\restore.cmd
.\startvs.cmd
```
This will download required tools.

#### PATH

For VS Code and Visual Studio to work correctly, you must place the following location in your PATH.
```
Windows: %USERPROFILE%\.dotnet\x64
Linux/macOS: $HOME/.dotnet
```
This must come **before** any other installation of `dotnet`. In Windows, we recommend removing `C:\Program Files\dotnet` from PATH in system variables and adding `%USERPROFILE%\.dotnet\x64` to PATH in user variables.

<img src="http://i.imgur.com/Tm2PAfy.png" width="400" />
This will download required tools and start Visual Studio with the correct environment variables.

## Building on command-line

Expand All @@ -57,22 +47,6 @@ On macOS/Linux:
./build.sh
```

#### Build properties

Additional properties can be added as an argument in the form `/property:$name=$value`, or `/p:$name=$value` for short. For example:
```
.\build.cmd /p:Configuration=Release
```

Common properties include:

Property | Description
-------------------------|---------------------------------------------------------
BuildNumber | (string). A specific build number, typically from a CI counter
Configuration | `Debug` or `Release`. Default = `Debug`.
SkipTests | `true` or `false`. When true, builds without running tests.
NoBuild | `true` or `false`. Runs tests without rebuilding.

## Use the result of your build

After building Extensions from source, you can use these in a project by pointing NuGet to the folder containing the .nupkg files.
Expand All @@ -84,7 +58,7 @@ After building Extensions from source, you can use these in a project by pointin
<configuration>
<packageSources>
<clear />
<add key="MyBuildOfExtensions" value="C:\src\aspnet\Extensions\artifacts\build\" />
<add key="MyBuildOfExtensions" value="C:\src\aspnet\Extensions\artifacts\packages\Debug\Shipping\" />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
Expand All @@ -100,4 +74,4 @@ After building Extensions from source, you can use these in a project by pointin
```

Some features, such as new target frameworks, may require prerelease tooling builds for Visual Studio.
These are available in the [Visual Studio Preview](https://www.visualstudio.com/vs/preview/).
These are available in the [Visual Studio Preview](https://www.visualstudio.com/vs/preview/).
Loading