-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port MSBuild targets from Korebuild into an SDK package
- Loading branch information
Nate McMaster
committed
Jan 11, 2017
1 parent
9d32de7
commit efa9ff1
Showing
16 changed files
with
264 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
; EditorConfig to support per-solution formatting. | ||
; Use the EditorConfig VS add-in to make this work. | ||
; http://editorconfig.org/ | ||
|
||
; This is the default for the codeline. | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{cs}] | ||
indent_size = 4 | ||
|
||
; All XML-based file formats | ||
[*.{config,csproj,nuspec,props,resx,targets,xml}] | ||
indent_size = 2 | ||
|
||
[*.{json}] | ||
indent_size = 2 | ||
|
||
[*.{ps1}] | ||
indent_size = 4 | ||
|
||
[*.{sh}] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" /> | ||
<clear /> | ||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" /> | ||
</packageSources> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<Project> | ||
<Import Project="..\version.props" /> | ||
<Import Project="..\.build\common.props" Condition="Exists('..\.build\common.props')" /> | ||
|
||
<PropertyGroup> | ||
<!-- these imports substitute for a package reference to Internal.AspNetCore.Sdk --> | ||
<_AspNetToolsSdkPath>$([MSBuild]::GetDirectoryNameOfFileAbove($(MsBuildThisFileDirectory), NuGet.config))\src\Internal.AspNetCore.Sdk</_AspNetToolsSdkPath> | ||
<CustomBeforeMicrosoftCommonProps>$(_AspNetToolsSdkPath)\build\Internal.AspNetCore.Sdk.props</CustomBeforeMicrosoftCommonProps> | ||
<CustomAfterMicrosoftCommonTargets>$(_AspNetToolsSdkPath)\build\Internal.AspNetCore.Sdk.targets</CustomAfterMicrosoftCommonTargets> | ||
<CustomAfterMicrosoftCommonCrossTargetingTargets>$(_AspNetToolsSdkPath)\buildCrossTargeting\Internal.AspNetCore.Sdk.targets</CustomAfterMicrosoftCommonCrossTargetingTargets> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<RepositoryUrl>https://github.com/aspnet/BuildTools</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
</PropertyGroup> | ||
|
||
<Target Name="EnsureInitialized" | ||
BeforeTargets="Build" | ||
Condition="!Exists('$(MSBuildThisFileDirectory)..\.build\common.props')"> | ||
<Error File="$(MSBuildProjectFile)" | ||
Text="Project has not been initialized. Run 'build initialize' in the solution directory." /> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sdk": { | ||
"version": "1.0.0-preview4-004233" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Internal.AspNetCore.Sdk/Internal.AspNetCore.Sdk.nuspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0"?> | ||
<package> | ||
<metadata> | ||
<id>Internal.AspNetCore.Sdk</id> | ||
<version>1.0.0-$versionsuffix$</version> | ||
<authors>Microsoft</authors> | ||
<description>Build targets and customizations to Microsoft.NET.Sdk</description> | ||
<!-- TODO use contentFiles for cs files--> | ||
</metadata> | ||
<files> | ||
<file src="**\*" target="/" /> | ||
</files> | ||
</package> |
4 changes: 4 additions & 0 deletions
4
src/Internal.AspNetCore.Sdk/build/AssemblyInfo.Serviceable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// 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. | ||
|
||
[assembly: System.Reflection.AssemblyMetadata("Serviceable", "True")] |
9 changes: 9 additions & 0 deletions
9
src/Internal.AspNetCore.Sdk/build/Internal.AspNetCore.Sdk.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\targets\Common.props" Condition="'$(TargetFrameworks)'==''" /> | ||
|
||
</Project> |
10 changes: 10 additions & 0 deletions
10
src/Internal.AspNetCore.Sdk/build/Internal.AspNetCore.Sdk.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)Workarounds.targets" /> | ||
<Import Project="$(MSBuildThisFileDirectory)..\targets\BuildNumber.targets" Condition="'$(TargetFrameworks)'==''" /> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
|
||
<!-- this file is dedicated to working around bugs in Microsoft.NET.Sdk RC.2 release --> | ||
<Project> | ||
<!-- workaround https://github.com/Microsoft/vstest/issues/191 --> | ||
<PropertyGroup | ||
Condition="$(MSBuildProjectName.EndsWith('Test')) OR $(MSBuildProjectName.EndsWith('Tests'))"> | ||
<OutputType Condition="$(TargetFramework.StartsWith('netcoreapp'))">exe</OutputType> | ||
</PropertyGroup> | ||
<!-- end workaround --> | ||
|
||
<!-- workaround https://github.com/NuGet/Home/issues/4063 --> | ||
<!-- workaround https://github.com/NuGet/Home/issues/3953 --> | ||
<Target Name="ResolveActualPackageVersions" | ||
BeforeTargets="GenerateNuSpec" | ||
DependsOnTargets="ResolvePackageDependenciesDesignTime"> | ||
|
||
<ItemGroup> | ||
<_ProjectReferences Update="@(_ProjectReferences)" Condition="'%(PackageVersion)'==''"> | ||
<PackageVersion>$(Version)</PackageVersion> | ||
</_ProjectReferences> | ||
|
||
<_FloatingVersions Include="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" /> | ||
<_ResolvedFloatingVersion Include="@(_FloatingVersions)"> | ||
<ResolvedName>%(_DependenciesDesignTime.Name)</ResolvedName> | ||
<Version>%(_DependenciesDesignTime.Version)</Version> | ||
</_ResolvedFloatingVersion> | ||
<_PackageReferences Remove="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" /> | ||
<_PackageReferences Include="@(_ResolvedFloatingVersion)" Condition="'%(Identity)'=='%(_ResolvedFloatingVersion.ResolvedName)'" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="Low" Text="Proj: %(_ProjectReferences.FileName) %(_ProjectReferences.PackageVersion)" /> | ||
<Message Importance="Low" Text="Pkg: %(_PackageReferences.Identity) %(_PackageReferences.Version)" /> | ||
</Target> | ||
<!-- end workaround --> | ||
|
||
<!-- workaround https://github.com/dotnet/sdk/issues/490 --> | ||
<ItemGroup> | ||
<!-- TODO use contentFiles in this package instead --> | ||
<!-- checking DesignTimeBuild hides the file from from VS solution explorer which does not yet support 'Visible' --> | ||
<!-- see https://github.com/dotnet/roslyn-project-system/issues/1126--> | ||
<Compile Include="$(MSBuildThisFileDirectory)AssemblyInfo.Serviceable.cs" | ||
Condition="'$(DesignTimeBuild)'!='true'" | ||
Visible="false" /> | ||
</ItemGroup> | ||
<!-- end workaround --> | ||
</Project> |
9 changes: 9 additions & 0 deletions
9
src/Internal.AspNetCore.Sdk/buildCrossTargeting/Internal.AspNetCore.Sdk.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)..\targets\Common.props" /> | ||
|
||
</Project> |
12 changes: 12 additions & 0 deletions
12
src/Internal.AspNetCore.Sdk/buildCrossTargeting/Internal.AspNetCore.Sdk.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
|
||
<!-- TODO rename folder to buildMultiTargeting. See https://github.com/NuGet/Home/issues/4098 in RC.3 --> | ||
|
||
<Import Project="$(MSBuildThisFileDirectory)Workarounds.targets" /> | ||
<Import Project="$(MSBuildThisFileDirectory)..\targets\BuildNumber.targets" /> | ||
|
||
</Project> |
37 changes: 37 additions & 0 deletions
37
src/Internal.AspNetCore.Sdk/buildCrossTargeting/Workarounds.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
--> | ||
<Project> | ||
<!-- workaround https://github.com/NuGet/Home/issues/4063 --> | ||
<!-- workaround https://github.com/NuGet/Home/issues/3953 --> | ||
<Target Name="ResolveActualPackageVersions" BeforeTargets="GenerateNuspec"> | ||
<ItemGroup> | ||
<_TargetFramework Include="$(TargetFrameworks)" /> | ||
</ItemGroup> | ||
|
||
<MSBuild Projects="$(MSBuildProjectFile)" | ||
Targets="ResolvePackageDependenciesDesignTime" | ||
Properties="TargetFramework=%(_TargetFramework.Identity)"> | ||
<Output TaskParameter="TargetOutputs" ItemName="_DependenciesDesignTime" /> | ||
</MSBuild> | ||
|
||
<ItemGroup> | ||
<_ProjectReferences Update="@(_ProjectReferences)" Condition="'%(PackageVersion)'==''"> | ||
<PackageVersion>$(Version)</PackageVersion> | ||
</_ProjectReferences> | ||
|
||
<_FloatingVersions Include="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" /> | ||
<_ResolvedFloatingVersion Include="@(_FloatingVersions)"> | ||
<ResolvedName>%(_DependenciesDesignTime.Name)</ResolvedName> | ||
<Version>%(_DependenciesDesignTime.Version)</Version> | ||
</_ResolvedFloatingVersion> | ||
<_PackageReferences Remove="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" /> | ||
<_PackageReferences Include="@(_ResolvedFloatingVersion)" Condition="'%(Identity)'=='%(_ResolvedFloatingVersion.ResolvedName)'" /> | ||
</ItemGroup> | ||
|
||
<Message Importance="Low" Text="Proj: %(_ProjectReferences.FileName) %(_ProjectReferences.PackageVersion)" /> | ||
<Message Importance="Low" Text="Pkg: %(_PackageReferences.Identity) %(_PackageReferences.Version)" /> | ||
</Target> | ||
<!-- end workaround --> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
Usage: This file needs to be imported into the 'outer build'. | ||
For multi-targeting projects, this will be imported from buildMultiTargeting/Internal.AspNetCore.Sdk.targets. | ||
For single-tfm projects, this will be imported from build/Internal.AspNetCore.Sdk.targets. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
<!-- version options --> | ||
<PropertyGroup> | ||
<!-- | ||
Create second-based build number for local builds. | ||
635556672000000000 is Jan 1, 2015. | ||
--> | ||
<_SecondBasedTimeStamp>$([System.DateTime]::UtcNow.Subtract($([System.DateTime]::FromBinary(635556672000000000))).TotalSeconds.ToString("F0"))</_SecondBasedTimeStamp> | ||
<_SecondBasedTimeStamp>t$([System.Int64]::Parse($(_SecondBasedTimeStamp)).ToString("x9"))</_SecondBasedTimeStamp> | ||
|
||
<!-- for aspnet CI --> | ||
<!-- TODO can be removed when we retire project.json from all repos --> | ||
<BuildNumber Condition="'$(BuildNumber)'==''">$(KOREBUILD_BUILD_NUMBER)</BuildNumber> | ||
|
||
<!-- fallback build number if not set by KoreBuild--> | ||
<BuildNumber Condition="'$(BuildNumber)'==''">$(_SecondBasedTimeStamp)</BuildNumber> | ||
<VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix> | ||
<VersionSuffix Condition="'$(VersionSuffix)'==''">$(BuildNumber)</VersionSuffix> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
WARNING: These targets are intended for building Microsoft's ASP.NET Core repos, and is not intended | ||
for use outside of Microsoft. | ||
Usage: this should be imported once via NuGet at the top of the file. | ||
--> | ||
<Project ToolsVersion="15.0"> | ||
|
||
<!-- common package options --> | ||
<PropertyGroup> | ||
<NeutralLanguage Condition="'$(NeutralLanguage)'==''">en-US</NeutralLanguage> | ||
<Company Condition="'$(Company)'==''">Microsoft Corporation.</Company> | ||
<Authors Condition="'$(Authors)'==''">Microsoft</Authors> | ||
<Copyright Condition="'$(Copyright)'==''">© Microsoft Corporation. All rights reserved.</Copyright> | ||
<ProjectUrl Condition="'$(ProjectUrl)'==''">https://asp.net</ProjectUrl> | ||
<RequireLicenseAcceptance Condition="'$(RequireLicenseAcceptance)'==''">true</RequireLicenseAcceptance> | ||
<Serviceable Condition="'$(Configuration)' == 'Release' AND '$(Serviceable)'==''">true</Serviceable> | ||
</PropertyGroup> | ||
|
||
<!-- common build options --> | ||
<PropertyGroup> | ||
<!-- make disabling warnings opt-out --> | ||
<WarningsAsErrors Condition="'$(WarningsAsErrors)'==''">true</WarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
</Project> |
6 changes: 6 additions & 0 deletions
6
src/Microsoft.AspNetCore.BuildTools.ApiCheck/Microsoft.AspNetCore.BuildTools.ApiCheck.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0"> | ||
|
||
<Import Project="..\..\build\common.props" /> | ||
|
||
<PropertyGroup> | ||
<VersionPrefix>1.0.1</VersionPrefix> | ||
<TargetFrameworks>netcoreapp1.0;net451</TargetFrameworks> | ||
<RuntimeIdentifier Condition=" '$(TargetFramework)'!='netcoreapp1.0' ">win7-x64</RuntimeIdentifier> | ||
<Platform>AnyCPU</Platform> | ||
<OutputType>exe</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="**\*.cs" /> | ||
<EmbeddedResource Include="**\*.resx" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.DotNet.ProjectModel" Version="1.0.0-rc3-003121" /> | ||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.0.0" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' "> | ||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.0" /> | ||
<PackageReference Include="System.Runtime.Loader" Version="4.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |