Skip to content

Commit

Permalink
Add strong naming (#16)
Browse files Browse the repository at this point in the history
* Add Strong Naming
  • Loading branch information
jackthorley committed May 9, 2016
1 parent 445d03e commit 9b6ed4f
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 27 deletions.
Binary file added .solution/KeyFile.snk
Binary file not shown.
25 changes: 25 additions & 0 deletions .solution/build.msbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
<PropertyGroup>
<solutionToBuild>..\com.esendex.sdk.sln</solutionToBuild>
<buildProperties>Configuration=Release;Platform=Any CPU</buildProperties>
</PropertyGroup>

<Target Name="Build" DependsOnTargets="apply_visible">
<MSBuild Projects="$(solutionToBuild)"
Targets="Rebuild"
Properties="$(buildProperties)"/>
</Target>

<Target Name="apply_visible">
<ItemGroup>
<AssemblyAttributes Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>com.esendex.sdk.test</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2</_Parameter1>
</AssemblyAttributes>
</ItemGroup>
<WriteCodeFragment Language="C#" OutputFile="..\source\Properties\BuildInfo.cs" AssemblyAttributes="@(AssemblyAttributes)" />
</Target>
</Project>
25 changes: 25 additions & 0 deletions .solution/buildsigned.msbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
<PropertyGroup>
<solutionToBuild>..\com.esendex.sdk.sln</solutionToBuild>
<buildProperties>Configuration=Release;Platform=Any CPU;DefineConstants="SIGNED"</buildProperties>
</PropertyGroup>

<Target Name="Build" DependsOnTargets="apply_sn">
<MSBuild Projects="$(solutionToBuild)"
Targets="Rebuild"
Properties="$(buildProperties)"/>
</Target>

<Target Name="apply_sn">
<ItemGroup>
<AssemblyAttributes Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>com.esendex.sdk.test,PublicKey=00240000048000009400000006020000002400005253413100040000010001007da9ad8afead9400c99245e496c17484254c424dffbcf7874dfde37c94538691227946eb79f059df426b7aa7b7b5aa5a3eb9191e2bbf0fa51df19799eb54ac2d833c22ba87de438d074a7c9a1cecd1f37f623792d6356c91ca3e7504b5f7fc820ad313b77c46325779ae10a212078860e9118a5a5d88f467762b64da81569eaf</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>DynamicProxyGenAssembly2,PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7</_Parameter1>
</AssemblyAttributes>
</ItemGroup>
<WriteCodeFragment Language="C#" OutputFile="..\source\Properties\BuildInfo.cs" AssemblyAttributes="@(AssemblyAttributes)" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install:
- nuget restore com.esendex.sdk.sln
- nuget install NUnit.Runners -Version 2.6.2 -OutputDirectory testrunner
script:
- xbuild /p:Configuration=Release com.esendex.sdk.sln
- xbuild .solution/build.msbuild
- mono ./testrunner/NUnit.Runners.2.6.2/tools/nunit-console.exe ./test/bin/Release/com.esendex.sdk.test.dll

cache:
Expand Down
11 changes: 10 additions & 1 deletion com.esendex.sdk.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "com.esendex.sdk", "source\com.esendex.sdk.csproj", "{E5FFC32F-9C13-47FB-A1E7-8834EAF289B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "com.esendex.sdk.test", "test\com.esendex.sdk.test.csproj", "{1AE63BDE-FAEC-4EE3-BC52-61DF6581DFB9}"
Expand All @@ -14,6 +16,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{39FA5B
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".solution", ".solution", "{E7C0ED30-2AA4-48E9-A307-FF0231D80235}"
ProjectSection(SolutionItems) = preProject
.solution\build.msbuild = .solution\build.msbuild
.solution\buildsigned.msbuild = .solution\buildsigned.msbuild
.solution\KeyFile.snk = .solution\KeyFile.snk
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
7 changes: 2 additions & 5 deletions source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyFileVersion("2.2.0")]
[assembly: InternalsVisibleTo("com.esendex.sdk.test")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyFileVersion("2.3.0")]
2 changes: 2 additions & 0 deletions source/Properties/BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("com.esendex.sdk.test")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicProxyGenAssembly2")]
25 changes: 19 additions & 6 deletions source/com.esendex.sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\com.esendex.sdk.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" !$(DefineConstants.Contains('SIGNED')) ">
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" $(DefineConstants.Contains('SIGNED')) ">
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\.solution\KeyFile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net35\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -99,6 +108,7 @@
<Compile Include="messaging\VoiceMessageLanguage.cs" />
<Compile Include="models\requests\SurveysAddRecipientRequest.cs" />
<Compile Include="models\requests\SurveysAddRecipientsRequest.cs" />
<Compile Include="Properties\BuildInfo.cs" />
<Compile Include="Request.cs" />
<Compile Include="rest\resources\ContactsResource.cs" />
<Compile Include="rest\resources\InboxMessagesResource.cs" />
Expand Down Expand Up @@ -137,18 +147,21 @@
<Compile Include="ServiceBase.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\.solution\KeyFile.snk">
<Link>KeyFile.snk</Link>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="builders\" />
</ItemGroup>
<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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
Expand Down
9 changes: 4 additions & 5 deletions source/com.esendex.sdk.nuspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<title>Esendex .NET SDK</title>
<title>Esendex .NET SDK</title>
<id>esendex-dotnet-sdk</id>
<version>$version$</version>
<authors>Esendex</authors>
<owners>EsendexDevelopment</owners>
<iconUrl>http://www.esendex.co.uk/sites/all/themes/esendex14/favicon.ico</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<description>Esendex API .NET SDK</description>
<licenseUrl>http://opensource.org/licenses/BSD-3-Clause</licenseUrl>
<!-- <releaseNotes>Initial NuGet release</releaseNotes> -->
<tags>SDK API Esendex .NET</tags>
<projectUrl>http://developers.esendex.com/SDKs/DotNet-SDK</projectUrl>
<licenseUrl>http://opensource.org/licenses/BSD-3-Clause</licenseUrl>
<tags>SDK API Esendex .NET</tags>
<projectUrl>http://developers.esendex.com/SDKs/DotNet-SDK</projectUrl>
</metadata>
</package>
29 changes: 21 additions & 8 deletions test/com.esendex.sdk.test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" !$(DefineConstants.Contains('SIGNED')) ">
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" $(DefineConstants.Contains('SIGNED')) ">
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>..\.solution\KeyFile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
<Reference Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -147,16 +157,19 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="..\.solution\KeyFile.snk">
<Link>KeyFile.snk</Link>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- 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.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
2 changes: 1 addition & 1 deletion test/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.0.10827" targetFramework="net40" />
<package id="Moq" version="4.2.1510.2205" targetFramework="net40" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net40" />
<package id="NUnit" version="2.6.2" targetFramework="net40" />
</packages>

0 comments on commit 9b6ed4f

Please sign in to comment.