Skip to content

Commit b3a7f8c

Browse files
author
Michael Hallett
committed
Added capability for strong naming on the core library. This was done by adding duplicate CSPROJ files and a SLN file to allow both to live in the same structure.
1 parent b30e131 commit b3a7f8c

15 files changed

+1161
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ restsharp-computed.nuspec
4040
Backup/
4141
*.htm
4242
*.orig
43+
DownloadSigned/

RestSharp.Build/NuSpecUpdateTask.cs

+4
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ public override bool Execute()
4040

4141
var name = this._assembly.GetName();
4242

43+
#if SIGNED
44+
this.Id = name.Name + "Signed";
45+
#else
4346
this.Id = name.Name;
47+
#endif
4448
this.Authors = this.GetAuthors(this._assembly);
4549
this.Description = this.GetDescription(this._assembly);
4650
this.Version = this.GetVersion(this._assembly);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{CCC30138-3D68-44D8-AF1A-D22F769EE8DC}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>RestSharp.Build</RootNamespace>
12+
<AssemblyName>RestSharp.Build</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<TargetFrameworkProfile />
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\DebugSigned\</OutputPath>
22+
<IntermediateOutputPath>obj\DebugSigned\</IntermediateOutputPath>
23+
<DefineConstants>TRACE;DEBUG;SIGNED</DefineConstants>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
<Prefer32Bit>false</Prefer32Bit>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<DebugType>pdbonly</DebugType>
30+
<Optimize>true</Optimize>
31+
<OutputPath>bin\ReleaseSigned\</OutputPath>
32+
<IntermediateOutputPath>obj\ReleaseSigned\</IntermediateOutputPath>
33+
<DefineConstants>TRACE;SIGNED</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
37+
<Prefer32Bit>false</Prefer32Bit>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<Reference Include="Microsoft.Build.Framework" />
41+
<Reference Include="Microsoft.Build.Utilities.v3.5" />
42+
<Reference Include="System" />
43+
<Reference Include="System.Core" />
44+
<Reference Include="System.Xml.Linq" />
45+
<Reference Include="System.Data.DataSetExtensions" />
46+
<Reference Include="System.Data" />
47+
<Reference Include="System.Xml" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<Compile Include="NuSpecUpdateTask.cs" />
51+
<Compile Include="Properties\AssemblyInfo.cs" />
52+
</ItemGroup>
53+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
54+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
55+
Other similar extension points exist, see Microsoft.Common.targets.
56+
<Target Name="BeforeBuild">
57+
</Target>
58+
<Target Name="AfterBuild">
59+
</Target>
60+
-->
61+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>9.0.30729</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{47D3EBB9-0300-4AF8-BAC5-740D51454A63}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>RestSharp.IntegrationTests</RootNamespace>
12+
<AssemblyName>RestSharp.IntegrationTests</AssemblyName>
13+
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<FileUpgradeFlags>
16+
</FileUpgradeFlags>
17+
<OldToolsVersion>3.5</OldToolsVersion>
18+
<UpgradeBackupLocation />
19+
<TargetFrameworkProfile />
20+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
21+
<RestorePackages>true</RestorePackages>
22+
</PropertyGroup>
23+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
24+
<DebugSymbols>true</DebugSymbols>
25+
<DebugType>full</DebugType>
26+
<Optimize>false</Optimize>
27+
<OutputPath>bin\DebugSigned\</OutputPath>
28+
<IntermediateOutputPath>obj\DebugSigned\</IntermediateOutputPath>
29+
<DefineConstants>TRACE;DEBUG;FRAMEWORK, NET4, SIGNED</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
33+
</PropertyGroup>
34+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
35+
<DebugType>pdbonly</DebugType>
36+
<Optimize>true</Optimize>
37+
<OutputPath>bin\ReleaseSigned\</OutputPath>
38+
<IntermediateOutputPath>obj\ReleaseSigned\</IntermediateOutputPath>
39+
<DefineConstants>TRACE;FRAMEWORK, NET4, SIGNED</DefineConstants>
40+
<ErrorReport>prompt</ErrorReport>
41+
<WarningLevel>4</WarningLevel>
42+
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
43+
<DocumentationFile>
44+
</DocumentationFile>
45+
<NoWarn>
46+
</NoWarn>
47+
</PropertyGroup>
48+
<PropertyGroup>
49+
<SignAssembly>true</SignAssembly>
50+
</PropertyGroup>
51+
<PropertyGroup>
52+
<AssemblyOriginatorKeyFile>..\RestSharp.snk</AssemblyOriginatorKeyFile>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<Reference Include="System" />
56+
<Reference Include="System.Core">
57+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
58+
</Reference>
59+
<Reference Include="System.Xml.Linq">
60+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
61+
</Reference>
62+
<Reference Include="System.Data" />
63+
<Reference Include="System.Xml" />
64+
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
65+
<SpecificVersion>False</SpecificVersion>
66+
<HintPath>..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
67+
</Reference>
68+
<Reference Include="xunit.extensions">
69+
<HintPath>..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
70+
</Reference>
71+
</ItemGroup>
72+
<ItemGroup>
73+
<Compile Include="AsyncTests.cs" />
74+
<Compile Include="AuthenticationTests.cs" />
75+
<Compile Include="AsyncRequestBodyTests.cs" />
76+
<Compile Include="NonProtocolExceptionHandlingTests.cs" />
77+
<Compile Include="Helpers\Extensions.cs" />
78+
<Compile Include="FileTests.cs" />
79+
<Compile Include="Helpers\Handlers.cs" />
80+
<Compile Include="Models\LinkedINMemberProfile.cs" />
81+
<Compile Include="MultipartFormDataTests.cs" />
82+
<Compile Include="oAuth1Tests.cs" />
83+
<Compile Include="Properties\AssemblyInfo.cs" />
84+
<Compile Include="CompressionTests.cs" />
85+
<Compile Include="Helpers\SimpleServer.cs" />
86+
<Compile Include="RequestBodyTests.cs" />
87+
<Compile Include="StatusCodeTests.cs" />
88+
<Compile Include="RequestHeadTests.cs" />
89+
</ItemGroup>
90+
<ItemGroup>
91+
<Content Include="Assets\Koala.jpg">
92+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
93+
</Content>
94+
</ItemGroup>
95+
<ItemGroup>
96+
<None Include="..\RestSharp.snk">
97+
<Link>RestSharp.snk</Link>
98+
</None>
99+
<None Include="App.config" />
100+
<None Include="packages.config" />
101+
</ItemGroup>
102+
<ItemGroup>
103+
<ProjectReference Include="..\RestSharp.Net4\RestSharp.Net4.Signed.csproj">
104+
<Project>{5ff943a5-260f-4042-b4ce-c4977bad4ebb}</Project>
105+
<Name>RestSharp.Net4.Signed</Name>
106+
</ProjectReference>
107+
</ItemGroup>
108+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
109+
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
110+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
111+
Other similar extension points exist, see Microsoft.Common.targets.
112+
<Target Name="BeforeBuild">
113+
</Target>
114+
<Target Name="AfterBuild">
115+
</Target>
116+
-->
117+
</Project>

RestSharp.IntegrationTests/StatusCodeTests.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ public void Handles_GET_Request_404_Error()
2626
[Fact]
2727
public void Handles_GET_Request_404_Error_With_Body()
2828
{
29-
const string baseUrl = "http://localhost:8888/";
29+
Uri baseUrl = new Uri("http://localhost:8080/");
3030

31-
//using (SimpleServer.Create(baseUrl, Handlers.Generic<ResponseHandler>()))
32-
using (SimpleServer.Create(baseUrl, UrlToStatusCodeHandler))
31+
using (SimpleServer.Create(baseUrl.AbsoluteUri, UrlToStatusCodeHandler))
3332
{
34-
var client = new RestClient(new Uri("http://nonexistantdomainimguessing.org"));
35-
var request = new RestRequest("404WithBody");
33+
var client = new RestClient(baseUrl);
34+
var request = new RestRequest("404");
35+
36+
request.AddBody("This is the body");
37+
3638
var response = client.Execute(request);
3739

3840
Assert.Equal(HttpStatusCode.NotFound, response.StatusCode);

RestSharp.Net4/Properties/AssemblyInfo.cs

+5
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414

1515
// The following GUID is for the ID of the typelib if this project is exposed to COM
1616
[assembly: Guid("97044cbf-6c9d-4b08-87e3-bf30fbde1933")]
17+
18+
#if SIGNED
19+
[assembly: InternalsVisibleTo("RestSharp.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fda57af14a288d46e3efea89617037585c4de57159cd536ca6dff792ea1d6addc665f2fccb4285413d9d44db5a1be87cb82686db200d16325ed9c42c89cd4824d8cc447f7cee2ac000924c3bceeb1b7fcb5cc1a3901785964d48ce14172001084134f4dcd9973c3776713b595443b1064bb53e2eeb924969244d354e46495e9d")]
20+
#else
1721
[assembly: InternalsVisibleTo("RestSharp.IntegrationTests")]
22+
#endif

0 commit comments

Comments
 (0)