From dd1efeb9fab32076c03b62e2c72cc9ec8add52e6 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 27 May 2015 12:24:23 -0300 Subject: Allow upstream consumers to override build settings. Projects consuming and distributing Cecil in environments they don't control (i.e. an addin inside VS or XS) risk having the environment load an incompatible version of Cecil from another addin or location (depending on the process/domain configuration and the probing paths set up for the host). To shield from this issue, XS has forked Cecil, changed its assembly name and signing key, and now it has to maintain that fork in sync with upstream. Others with similar requirements (in particular, the Xamarin Visual Studio extension team now) will need to do the same, with the added maintainability burden. This commit provides a conditional import that allows products that distribute Cecil to tweak settings that will affect its build, without having to fork the project unnecessarily. The Mono.Cecil.overrides file is a plain MSBuild file with additional properties that can exist anywhere upwards from the current Cecil repo clone path, making it very flexible even if the project is submoduled. It's imported before the C# targets so that changes to the assembly name, signing key, etc. are properly overwritten before the C# targets process them. This involved moving the existing .settings files down in all .csproj files. Fixes #216 --- Mono.Cecil.csproj | 2 +- Mono.Cecil.settings | 39 ++++++++++++++++++++++++++-- Test/Mono.Cecil.Tests.csproj | 2 +- rocks/Mono.Cecil.Rocks.csproj | 2 +- rocks/Test/Mono.Cecil.Rocks.Tests.csproj | 2 +- symbols/mdb/Mono.Cecil.Mdb.csproj | 2 +- symbols/mdb/Test/Mono.Cecil.Mdb.Tests.csproj | 2 +- symbols/pdb/Mono.Cecil.Pdb.csproj | 2 +- symbols/pdb/Test/Mono.Cecil.Pdb.Tests.csproj | 2 +- 9 files changed, 45 insertions(+), 10 deletions(-) diff --git a/Mono.Cecil.csproj b/Mono.Cecil.csproj index 03b050e..0a5ea38 100644 --- a/Mono.Cecil.csproj +++ b/Mono.Cecil.csproj @@ -1,6 +1,5 @@  - {D68133BD-1E63-496E-9EDE-4FBDBF77B486} Mono.Cecil @@ -139,5 +138,6 @@ + \ No newline at end of file diff --git a/Mono.Cecil.settings b/Mono.Cecil.settings index 9c965bf..e95b285 100644 --- a/Mono.Cecil.settings +++ b/Mono.Cecil.settings @@ -16,14 +16,14 @@ true full false - DEBUG;TRACE; + $(DefineConstants);DEBUG;TRACE; prompt 4 pdbonly true - TRACE; + $(DefineConstants);TRACE; prompt 4 false @@ -86,4 +86,39 @@ + + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Mono.Cecil.overrides))\Mono.Cecil.overrides + + + + + diff --git a/Test/Mono.Cecil.Tests.csproj b/Test/Mono.Cecil.Tests.csproj index 456e9d3..ca324f3 100644 --- a/Test/Mono.Cecil.Tests.csproj +++ b/Test/Mono.Cecil.Tests.csproj @@ -1,6 +1,5 @@  - {A47B1F49-A81A-43E8-BE6B-DD28AF2C4055} Mono.Cecil.Tests @@ -85,5 +84,6 @@ + \ No newline at end of file diff --git a/rocks/Mono.Cecil.Rocks.csproj b/rocks/Mono.Cecil.Rocks.csproj index 1fda5b0..79d3a49 100644 --- a/rocks/Mono.Cecil.Rocks.csproj +++ b/rocks/Mono.Cecil.Rocks.csproj @@ -1,6 +1,5 @@ - {FBC6DD59-D09D-499C-B03C-99C1C78FF2AC} Mono.Cecil.Rocks @@ -25,5 +24,6 @@ Mono.Cecil + \ No newline at end of file diff --git a/rocks/Test/Mono.Cecil.Rocks.Tests.csproj b/rocks/Test/Mono.Cecil.Rocks.Tests.csproj index 4c85ca7..bd03aa2 100644 --- a/rocks/Test/Mono.Cecil.Rocks.Tests.csproj +++ b/rocks/Test/Mono.Cecil.Rocks.Tests.csproj @@ -1,6 +1,5 @@  - {C6CFD7E1-B855-44DC-B4CE-9CD72984AF52} Mono.Cecil.Rocks.Tests @@ -32,5 +31,6 @@ + \ No newline at end of file diff --git a/symbols/mdb/Mono.Cecil.Mdb.csproj b/symbols/mdb/Mono.Cecil.Mdb.csproj index 776d53c..2161dc7 100644 --- a/symbols/mdb/Mono.Cecil.Mdb.csproj +++ b/symbols/mdb/Mono.Cecil.Mdb.csproj @@ -1,6 +1,5 @@ - {8559DD7F-A16F-46D0-A05A-9139FAEBA8FD} Mono.Cecil.Mdb @@ -30,5 +29,6 @@ + \ No newline at end of file diff --git a/symbols/mdb/Test/Mono.Cecil.Mdb.Tests.csproj b/symbols/mdb/Test/Mono.Cecil.Mdb.Tests.csproj index cbe056c..3cc0242 100644 --- a/symbols/mdb/Test/Mono.Cecil.Mdb.Tests.csproj +++ b/symbols/mdb/Test/Mono.Cecil.Mdb.Tests.csproj @@ -1,6 +1,5 @@  - {AC71DF9C-99FA-4A63-990A-66C8010355A6} Mono.Cecil.Mdb.Tests @@ -27,5 +26,6 @@ + \ No newline at end of file diff --git a/symbols/pdb/Mono.Cecil.Pdb.csproj b/symbols/pdb/Mono.Cecil.Pdb.csproj index ff33736..76da79a 100644 --- a/symbols/pdb/Mono.Cecil.Pdb.csproj +++ b/symbols/pdb/Mono.Cecil.Pdb.csproj @@ -1,6 +1,5 @@  - {63E6915C-7EA4-4D76-AB28-0D7191EEA626} Mono.Cecil.Pdb @@ -50,5 +49,6 @@ + \ No newline at end of file diff --git a/symbols/pdb/Test/Mono.Cecil.Pdb.Tests.csproj b/symbols/pdb/Test/Mono.Cecil.Pdb.Tests.csproj index d571cb7..27bb988 100644 --- a/symbols/pdb/Test/Mono.Cecil.Pdb.Tests.csproj +++ b/symbols/pdb/Test/Mono.Cecil.Pdb.Tests.csproj @@ -1,6 +1,5 @@  - {29300103-CB76-4A1D-B6FD-FFD91C1EC8AA} Mono.Cecil.Pdb.Tests @@ -32,5 +31,6 @@ + \ No newline at end of file -- cgit v1.2.3