From 6cb8c638f4d49b8f723c8012707c1dca57dadd54 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Tue, 7 Feb 2017 11:26:01 -0800 Subject: Update Reference and ProjectReference ordering in our targets. Switch the to using a common DefaultReference notion between targets and eliminated targetingpack.props. Moved the default references for tests into tests.targets. Fixed where we added Private to References because in some cases it wasn't happing because the target that set Private=true was run before all the references were added. This is why we are now setting Reference Private=false in a different target from ProjectReference Private=false because they sometimes need to happen at different times in the target execution. Set _FindDependencies=false to block RAR from trying to automatically add the closure of the primary references as it added automatic references that folks could accidently start depending on and we want to be explicit about our dependencies. This was really noticable once we started auto referencing the netstandard facade which caused everything to get pulled into the reference set. To fix the various build scenarios where we add ProjectReferences automatically we needed a common target to hook on which we now have AddProjectReferencesDynamically target that correctly hooks into the various dependency chains. See comment in targets file for more details. --- Tools-Override/FrameworkTargeting.targets | 66 ++++++++++++++-------- Tools-Override/resolveContract.targets | 9 ++- Tools-Override/tests.targets | 19 +++++++ buildvertical.targets | 9 ++- dir.props | 2 - referenceFromRuntime.targets | 8 +-- .../tests/System.Linq.Expressions.Tests.csproj | 3 + .../tests/TestExtensions/TestOrderer.cs | 2 +- ...ime.Serialization.Json.Performance.Tests.csproj | 2 +- targetingpacks.props | 30 ---------- 10 files changed, 81 insertions(+), 69 deletions(-) delete mode 100644 targetingpacks.props diff --git a/Tools-Override/FrameworkTargeting.targets b/Tools-Override/FrameworkTargeting.targets index 21f9f35e9a..dcb87fe7ac 100644 --- a/Tools-Override/FrameworkTargeting.targets +++ b/Tools-Override/FrameworkTargeting.targets @@ -1,17 +1,6 @@ - - true - true - - - - - - - @@ -21,6 +10,8 @@ $(RefPath) $(ContractOutputPath) $(AssemblySearchPaths);$(ContractOutputPath);{RawFileName} + + <_FindDependencies>false .NETCoreApp,Version=v1.0 - - - - + + true + true + + + + + + - + + + + + false - - - - false - @@ -127,6 +123,28 @@ + + + AddProjectReferencesDynamically; + $(ResolveReferencesDependsOn); + + + AddProjectReferencesDynamically; + $(CleanDependsOn); + + + + + true diff --git a/Tools-Override/resolveContract.targets b/Tools-Override/resolveContract.targets index 9a76265298..f8f98711f1 100644 --- a/Tools-Override/resolveContract.targets +++ b/Tools-Override/resolveContract.targets @@ -2,15 +2,14 @@ - + ResolveMatchingContract; + $(AddProjectReferencesDynamicallyDependsOn); + + $(ResolveReferencesDependsOn); VerifyMatchingContract - - ResolveMatchingContract; - $(CleanDependsOn); - diff --git a/Tools-Override/tests.targets b/Tools-Override/tests.targets index 068a31a252..0e926536ab 100644 --- a/Tools-Override/tests.targets +++ b/Tools-Override/tests.targets @@ -99,6 +99,25 @@ + + + + + + + + + + + + + + + + + + + <_projectWithConfiguration Include="@(_projectBuildConfigurations->'%(OriginalItemSpec)')" /> @@ -83,7 +83,7 @@ @@ -116,6 +116,11 @@ Configuration=$(_projectReferenceConfiguration);%(ProjectReference.AdditionalProperties) + + + + false + diff --git a/dir.props b/dir.props index b4a3ae00b0..d18b2c5562 100644 --- a/dir.props +++ b/dir.props @@ -54,8 +54,6 @@ true - - true diff --git a/referenceFromRuntime.targets b/referenceFromRuntime.targets index 216157862b..5abd924aa5 100644 --- a/referenceFromRuntime.targets +++ b/referenceFromRuntime.targets @@ -9,8 +9,8 @@ - @@ -22,8 +22,8 @@ - - diff --git a/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj b/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj index 59cefeb5fb..e9c670df12 100644 --- a/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj +++ b/src/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj @@ -253,5 +253,8 @@ + + + \ No newline at end of file diff --git a/src/System.Linq.Expressions/tests/TestExtensions/TestOrderer.cs b/src/System.Linq.Expressions/tests/TestExtensions/TestOrderer.cs index 35985108d8..5168d7733a 100644 --- a/src/System.Linq.Expressions/tests/TestExtensions/TestOrderer.cs +++ b/src/System.Linq.Expressions/tests/TestExtensions/TestOrderer.cs @@ -16,7 +16,7 @@ namespace System.Linq.Expressions.Tests Dictionary> queue = new Dictionary>(); foreach (TTestCase testCase in testCases) { - Xunit.Abstractions.IAttributeInfo orderAttribute = ReflectionAbstractionExtensions.GetCustomAttributes(testCase.TestMethod.Method, typeof(TestOrderAttribute)).FirstOrDefault(); + Xunit.Abstractions.IAttributeInfo orderAttribute = testCase.TestMethod.Method.GetCustomAttributes(typeof(TestOrderAttribute)).FirstOrDefault(); int order; if (orderAttribute == null || (order = orderAttribute.GetConstructorArguments().Cast().First()) == 0) { diff --git a/src/System.Runtime.Serialization.Json/tests/Performance/System.Runtime.Serialization.Json.Performance.Tests.csproj b/src/System.Runtime.Serialization.Json/tests/Performance/System.Runtime.Serialization.Json.Performance.Tests.csproj index 83e7f2739b..623c621b5e 100644 --- a/src/System.Runtime.Serialization.Json/tests/Performance/System.Runtime.Serialization.Json.Performance.Tests.csproj +++ b/src/System.Runtime.Serialization.Json/tests/Performance/System.Runtime.Serialization.Json.Performance.Tests.csproj @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/targetingpacks.props b/targetingpacks.props deleted file mode 100644 index 9f4df8b4e7..0000000000 --- a/targetingpacks.props +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - -- cgit v1.2.3