forked from dotnet/roslyn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The combination of the minified MSBuild syntax and Directory.Build.props / targets file will change when in the build process our central build files are executed. For instance Imports.targets will now be run much later in the build after Sdk.targets. Where before, when it manually invkoed Sdk.targets it was able to run both before and after it. To keep our build functioning the same way we need to move around some of the logic within our build files so that it executes in the same relative order as it did before
- Loading branch information
Showing
12 changed files
with
130 additions
and
107 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
|
||
<Import Project="build\Targets\Settings.props" /> | ||
</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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
|
||
<Import Project="build\Targets\Imports.targets" /> | ||
</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 |
---|---|---|
@@ -1,5 +1,111 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. --> | ||
<Project> | ||
|
||
<Choose> | ||
<When Condition="'$(RoslynProjectType)' == 'UnitTest' OR '$(RoslynProjectType)' == 'UnitTestPortable'"> | ||
<PropertyGroup> | ||
<_IsAnyUnitTest>true</_IsAnyUnitTest> | ||
<_NeedRuntimeAssets>true</_NeedRuntimeAssets> | ||
<CopyNuGetImplementations>true</CopyNuGetImplementations> | ||
<OutputPath>$(OutputPath)UnitTests\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(RoslynProjectType)' == 'Vsix'"> | ||
<PropertyGroup> | ||
<_CopyReferences>false</_CopyReferences> | ||
<_NeedRuntimeAssets>true</_NeedRuntimeAssets> | ||
<CopyNuGetImplementations>true</CopyNuGetImplementations> | ||
<OutputPath>$(OutputPath)Vsix\$(MSBuildProjectName)\</OutputPath> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(RoslynProjectType)' == 'Custom'"> | ||
<!-- Do nothing --> | ||
</When> | ||
<When Condition="'$(RoslynProjectType)' == '' AND '$(OutputType)' == 'Library'"> | ||
<PropertyGroup> | ||
<_CopyReferences>false</_CopyReferences> | ||
<_CopyProjectReferences>false</_CopyProjectReferences> | ||
<CopyNuGetImplementations>false</CopyNuGetImplementations> | ||
<OutputPath>$(OutputPath)Dlls\$(MSBuildProjectName)\</OutputPath> | ||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(RoslynProjectType)' == '' AND '$(OutputType)' == 'Exe'"> | ||
<PropertyGroup> | ||
<_NeedRuntimeAssets>true</_NeedRuntimeAssets> | ||
<CopyNuGetImplementations>true</CopyNuGetImplementations> | ||
<OutputPath>$(OutputPath)Exes\$(MSBuildProjectName)\</OutputPath> | ||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> | ||
</PropertyGroup> | ||
</When> | ||
<When Condition="'$(RoslynProjectType)' == '' AND '$(OutputType)' == 'WinExe'"> | ||
<PropertyGroup> | ||
<_NeedRuntimeAssets>true</_NeedRuntimeAssets> | ||
<CopyNuGetImplementations>true</CopyNuGetImplementations> | ||
<OutputPath>$(OutputPath)Exes\$(MSBuildProjectName)\</OutputPath> | ||
<ProduceReferenceAssembly>true</ProduceReferenceAssembly> | ||
</PropertyGroup> | ||
</When> | ||
</Choose> | ||
|
||
<!-- | ||
DocumentationFile needs to be set before importing common targets. | ||
C# common targets (unlike VB) prefix DocumentationFile path with IntermediateOutputPath. However, using that here does not work with multi-targeting as | ||
the IntermediateOutputPath will not yet have the TargetFramework appended, which will lead to a race where parallel builds for different TargetFrameworks | ||
attempt to write the doc xml to the same xml location. Instead, we can simply set GenerateDocumentationFile=true and let the SDK pick the correct path. | ||
Ideally, we'd just use the same construct for VB here, but that is currently blocked by https://github.com/dotnet/sdk/issues/1598. | ||
--> | ||
<PropertyGroup Condition="'$(GenerateDocumentationFile)' == '' AND '$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(AssemblyName)' != ''"> | ||
<DocumentationFile Condition="'$(ProjectLanguage)' == 'VB'">$(AssemblyName).xml</DocumentationFile> | ||
<GenerateDocumentationFile Condition="'$(ProjectLanguage)' == 'CSharp'">true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TargetFrameworks)' != ''"> | ||
<IntermediateOutputPath>$(IntermediateOutputPath)$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath> | ||
<OutputPath>$(OutputPath)$(TargetFramework.ToLowerInvariant())\</OutputPath> | ||
</PropertyGroup> | ||
|
||
<!-- If the project hasn't configured a ruleset, set a default ruleset. --> | ||
<Choose> | ||
<When Condition="'$(CodeAnalysisRuleSet)' == ''"> | ||
<Choose> | ||
<!-- We have different default rulesets for Build versus Running Code Analysis. --> | ||
<When Condition="'$(RunCodeAnalysis)' == 'true' OR '$(RunCodeAnalysisOnce)' == 'true'"> | ||
<PropertyGroup> | ||
<DefaultRulesetSuffix>_RunCodeAnalysisRules</DefaultRulesetSuffix> | ||
</PropertyGroup> | ||
</When> | ||
<Otherwise> | ||
<PropertyGroup> | ||
<DefaultRulesetSuffix>_BuildRules</DefaultRulesetSuffix> | ||
</PropertyGroup> | ||
</Otherwise> | ||
</Choose> | ||
|
||
<PropertyGroup> | ||
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == '' AND '$(NonShipping)' == 'true'">$(MSBuildThisFileDirectory)..\Rulesets\NonShippingProject$(DefaultRulesetSuffix).ruleset</CodeAnalysisRuleSet> | ||
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == '' AND '$(AnalyzerProject)' == 'true'">$(MSBuildThisFileDirectory)..\Rulesets\AnalyzerProject$(DefaultRulesetSuffix).ruleset</CodeAnalysisRuleSet> | ||
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == ''">$(MSBuildThisFileDirectory)..\Rulesets\Roslyn$(DefaultRulesetSuffix).ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
</When> | ||
</Choose> | ||
|
||
<!-- | ||
If TargetNetFX20 is true the project targets Framework 2.0 reference assemblies provided by Microsoft.NetFX20 nuget package. | ||
Use the latest Framework toolset to build, but set msbuild properties below | ||
so to avoid 4.5 specific artifacts to be added to the compilation (references, attributes). | ||
--> | ||
<PropertyGroup Condition="'$(TargetNetFX20)' == 'true'"> | ||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> | ||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences> | ||
<NoStdLib>true</NoStdLib> | ||
<FrameworkPathOverride>$(NuGetPackageRoot)\Microsoft.NetFX20\$(MicrosoftNetFX20Version)\lib\net20</FrameworkPathOverride> | ||
<ExecuteAsTool>false</ExecuteAsTool> | ||
<GenerateResourceMSBuildRuntime>CurrentRuntime</GenerateResourceMSBuildRuntime> | ||
</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
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
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
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
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
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
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
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 @@ | ||
using System; | ||
|
||
internal static class Program | ||
{ | ||
internal static void Main() | ||
{ | ||
throw new Exception("This should not be run"); | ||
} | ||
} |
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