diff options
author | Alan McGovern <alan.mcgovern@gmail.com> | 2015-05-27 20:55:22 +0300 |
---|---|---|
committer | Alan McGovern <alan.mcgovern@gmail.com> | 2015-05-27 20:55:22 +0300 |
commit | 9251c65ad0eb530150a616d04f62be0f26278e56 (patch) | |
tree | 4f96c8410c7bf59d0bec663a271b8e9c3273bd0c | |
parent | a6eec3e8cb2cf240126b7f744b2a31b59e477c44 (diff) | |
parent | 6de5a2f0a1a73b440ad746007974fc7af8669ceb (diff) |
Merge pull request #3 from joj/master
Allow upstream consumers to override build settings
-rw-r--r-- | Mono.Cecil.csproj | 1 | ||||
-rw-r--r-- | Mono.Cecil.settings | 37 | ||||
-rw-r--r-- | rocks/Mono.Cecil.Rocks.csproj | 1 | ||||
-rw-r--r-- | symbols/mdb/Mono.Cecil.Mdb.csproj | 1 | ||||
-rw-r--r-- | symbols/pdb/Mono.Cecil.Pdb.csproj | 1 |
5 files changed, 41 insertions, 0 deletions
diff --git a/Mono.Cecil.csproj b/Mono.Cecil.csproj index 3a237c1..908575d 100644 --- a/Mono.Cecil.csproj +++ b/Mono.Cecil.csproj @@ -253,6 +253,7 @@ <ItemGroup> <None Include="mono.snk" /> </ItemGroup> + <Import Project="Mono.Cecil.Settings" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/Mono.Cecil.settings b/Mono.Cecil.settings new file mode 100644 index 0000000..6c837e3 --- /dev/null +++ b/Mono.Cecil.settings @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <!-- This optional import 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, and can exist anywhere upwards from the current Cecil repo + clone path, making it very flexible even if the project is submoduled. + --> + <PropertyGroup> + <CecilOverrides Condition="'$(CecilOverrides)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Mono.Cecil.overrides))\Mono.Cecil.overrides</CecilOverrides> + </PropertyGroup> + <Import Project="$(CecilOverrides)" Condition="Exists($(CecilOverrides))" /> + + <!-- This is an example of a custom override file --> + <!-- + <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <AssemblyName>$(AssemblyName.Replace('Mono', 'MyCompany'))</AssemblyName> + <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)MyCompany.snk</AssemblyOriginatorKeyFile> + </PropertyGroup> + <ItemGroup> + <Compile Include="$(MSBuildThisFileDirectory)MyCompany.AssemblyInfo.cs" /> + </ItemGroup> + </Project> + + The additional AssemblyInfo.cs added to the Compile group provides the InternalsVisibleTo so that + the Mdb/Pdb projects can compile successfully: + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: InternalsVisibleTo ("MyCompany.Cecil.Pdb, PublicKey=....")] +[assembly: InternalsVisibleTo ("MyCompany.Cecil.Mdb, PublicKey=...")] +[assembly: InternalsVisibleTo ("MyCompany.Cecil.Rocks, PublicKey=...")] +[assembly: InternalsVisibleTo ("MyCompany.Cecil.Tests, PublicKey=...")] + --> +</Project> diff --git a/rocks/Mono.Cecil.Rocks.csproj b/rocks/Mono.Cecil.Rocks.csproj index 6d34f0b..104c5ec 100644 --- a/rocks/Mono.Cecil.Rocks.csproj +++ b/rocks/Mono.Cecil.Rocks.csproj @@ -118,6 +118,7 @@ <Name>Mono.Cecil</Name> </ProjectReference> </ItemGroup> + <Import Project="..\Mono.Cecil.Settings" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/symbols/mdb/Mono.Cecil.Mdb.csproj b/symbols/mdb/Mono.Cecil.Mdb.csproj index ab37a5e..72e2a46 100644 --- a/symbols/mdb/Mono.Cecil.Mdb.csproj +++ b/symbols/mdb/Mono.Cecil.Mdb.csproj @@ -93,6 +93,7 @@ <Compile Include="Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs" /> <Compile Include="Mono.CompilerServices.SymbolWriter\SymbolWriterImpl.cs" /> </ItemGroup> + <Import Project="..\..\Mono.Cecil.Settings" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. diff --git a/symbols/pdb/Mono.Cecil.Pdb.csproj b/symbols/pdb/Mono.Cecil.Pdb.csproj index e35add0..0096e41 100644 --- a/symbols/pdb/Mono.Cecil.Pdb.csproj +++ b/symbols/pdb/Mono.Cecil.Pdb.csproj @@ -122,6 +122,7 @@ <Compile Include="Mono.Cecil.Pdb\SymDocumentWriter.cs" /> <Compile Include="Mono.Cecil.Pdb\SymWriter.cs" /> </ItemGroup> + <Import Project="..\..\Mono.Cecil.Settings" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. |