Skip to content

Commit ce795f3

Browse files
committed
[WP7] Fix WP7 project
1 parent e354d17 commit ce795f3

File tree

6 files changed

+215
-18
lines changed

6 files changed

+215
-18
lines changed

.nuget/NuGet.Config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
</configuration>

.nuget/NuGet.exe

677 KB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
32+
</PropertyGroup>
33+
34+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
35+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
36+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
37+
<PackagesConfig>packages.config</PackagesConfig>
38+
</PropertyGroup>
39+
40+
<PropertyGroup>
41+
<!-- NuGet command -->
42+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
43+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
44+
45+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
46+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
47+
48+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
49+
50+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
51+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
52+
53+
<!-- Commands -->
54+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " </RestoreCommand>
55+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
56+
57+
<!-- We need to ensure packages are restored prior to assembly resolve -->
58+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
59+
RestorePackages;
60+
$(BuildDependsOn);
61+
</BuildDependsOn>
62+
63+
<!-- Make the build depend on restore packages -->
64+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
65+
$(BuildDependsOn);
66+
BuildPackage;
67+
</BuildDependsOn>
68+
</PropertyGroup>
69+
70+
<Target Name="CheckPrerequisites">
71+
<!-- Raise an error if we're unable to locate nuget.exe -->
72+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
73+
<!--
74+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
75+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
76+
parallel builds will have to wait for it to complete.
77+
-->
78+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
79+
</Target>
80+
81+
<Target Name="_DownloadNuGet">
82+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
83+
</Target>
84+
85+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
86+
<Exec Command="$(RestoreCommand)"
87+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
88+
89+
<Exec Command="$(RestoreCommand)"
90+
LogStandardErrorAsError="true"
91+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
92+
</Target>
93+
94+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
95+
<Exec Command="$(BuildCommand)"
96+
Condition=" '$(OS)' != 'Windows_NT' " />
97+
98+
<Exec Command="$(BuildCommand)"
99+
LogStandardErrorAsError="true"
100+
Condition=" '$(OS)' == 'Windows_NT' " />
101+
</Target>
102+
103+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
104+
<ParameterGroup>
105+
<OutputFilename ParameterType="System.String" Required="true" />
106+
</ParameterGroup>
107+
<Task>
108+
<Reference Include="System.Core" />
109+
<Using Namespace="System" />
110+
<Using Namespace="System.IO" />
111+
<Using Namespace="System.Net" />
112+
<Using Namespace="Microsoft.Build.Framework" />
113+
<Using Namespace="Microsoft.Build.Utilities" />
114+
<Code Type="Fragment" Language="cs">
115+
<![CDATA[
116+
try {
117+
OutputFilename = Path.GetFullPath(OutputFilename);
118+
119+
Log.LogMessage("Downloading latest version of NuGet.exe...");
120+
WebClient webClient = new WebClient();
121+
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
122+
123+
return true;
124+
}
125+
catch (Exception ex) {
126+
Log.LogErrorFromException(ex);
127+
return false;
128+
}
129+
]]>
130+
</Code>
131+
</Task>
132+
</UsingTask>
133+
</Project>

Tempest.All.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tempest.Tests", "iOS\Tempes
2323
EndProject
2424
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tempest.Android", "Android\Tempest\Tempest.Android.csproj", "{A876AF1D-C592-4A50-957D-2EB3EB4BE361}"
2525
EndProject
26+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{73F1D2F6-CABC-4765-90F6-E6512D21F150}"
27+
ProjectSection(SolutionItems) = preProject
28+
.nuget\NuGet.Config = .nuget\NuGet.Config
29+
.nuget\NuGet.exe = .nuget\NuGet.exe
30+
.nuget\NuGet.targets = .nuget\NuGet.targets
31+
EndProjectSection
32+
EndProject
2633
Global
2734
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2835
Debug|Any CPU = Debug|Any CPU

Windows Phone/Tempest/Tempest.csproj

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
<SilverlightApplication>false</SilverlightApplication>
1919
<ValidateXaml>true</ValidateXaml>
2020
<ThrowErrorsInValidation>true</ThrowErrorsInValidation>
21+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
22+
<RestorePackages>true</RestorePackages>
2123
</PropertyGroup>
2224
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2325
<DebugSymbols>true</DebugSymbols>
2426
<DebugType>full</DebugType>
2527
<Optimize>false</Optimize>
2628
<OutputPath>Bin\Debug</OutputPath>
27-
<DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;SAFE</DefineConstants>
29+
<DefineConstants>TRACE;DEBUG;SILVERLIGHT;WINDOWS_PHONE;SAFE;NOEMIT</DefineConstants>
2830
<NoStdLib>true</NoStdLib>
2931
<NoConfig>true</NoConfig>
3032
<ErrorReport>prompt</ErrorReport>
@@ -34,19 +36,31 @@
3436
<DebugType>pdbonly</DebugType>
3537
<Optimize>true</Optimize>
3638
<OutputPath>Bin\Release</OutputPath>
37-
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;TASKS;SAFE</DefineConstants>
39+
<DefineConstants>TRACE;SILVERLIGHT;WINDOWS_PHONE;SAFE;NOEMIT</DefineConstants>
3840
<NoStdLib>true</NoStdLib>
3941
<NoConfig>true</NoConfig>
4042
<ErrorReport>prompt</ErrorReport>
4143
<WarningLevel>4</WarningLevel>
4244
</PropertyGroup>
4345
<ItemGroup>
44-
<Reference Include="AsyncCtpLibrary_Phone, Version=1.1.4304.19911, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
45-
<HintPath>..\AsyncCtpLibrary_Phone.dll</HintPath>
46-
</Reference>
4746
<Reference Include="DH.Scrypt">
4847
<HintPath>..\..\Silverlight\Tempest\DH.Scrypt.dll</HintPath>
4948
</Reference>
49+
<Reference Include="Microsoft.Threading.Tasks">
50+
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.16\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Microsoft.Threading.Tasks.Extensions">
53+
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.16\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
54+
</Reference>
55+
<Reference Include="Microsoft.Threading.Tasks.Extensions.Phone">
56+
<HintPath>..\..\packages\Microsoft.Bcl.Async.1.0.16\lib\sl4-windowsphone71\Microsoft.Threading.Tasks.Extensions.Phone.dll</HintPath>
57+
</Reference>
58+
<Reference Include="System.Runtime">
59+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\sl4-windowsphone71\System.Runtime.dll</HintPath>
60+
</Reference>
61+
<Reference Include="System.Threading.Tasks">
62+
<HintPath>..\..\packages\Microsoft.Bcl.1.0.19\lib\sl4-windowsphone71\System.Threading.Tasks.dll</HintPath>
63+
</Reference>
5064
<Reference Include="System.Windows" />
5165
<Reference Include="system" />
5266
<Reference Include="System.Core" />
@@ -67,9 +81,6 @@
6781
<Compile Include="..\..\Desktop\Tempest\BufferValueWriter.cs">
6882
<Link>BufferValueWriter.cs</Link>
6983
</Compile>
70-
<Compile Include="..\..\Desktop\Tempest\ClientBase.cs">
71-
<Link>ClientBase.cs</Link>
72-
</Compile>
7384
<Compile Include="..\..\Desktop\Tempest\CollectionExtensions.cs">
7485
<Link>CollectionExtensions.cs</Link>
7586
</Compile>
@@ -91,15 +102,24 @@
91102
<Compile Include="..\..\Desktop\Tempest\IConnection.cs">
92103
<Link>IConnection.cs</Link>
93104
</Compile>
105+
<Compile Include="..\..\Desktop\Tempest\IConnectionlessMessenger.cs">
106+
<Link>IConnectionlessMessenger.cs</Link>
107+
</Compile>
94108
<Compile Include="..\..\Desktop\Tempest\IConnectionProvider.cs">
95109
<Link>IConnectionProvider.cs</Link>
96110
</Compile>
97111
<Compile Include="..\..\Desktop\Tempest\IContext.cs">
98112
<Link>IContext.cs</Link>
99113
</Compile>
114+
<Compile Include="..\..\Desktop\Tempest\IListener.cs">
115+
<Link>IListener.cs</Link>
116+
</Compile>
100117
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\AcknowledgeConnectMessage.cs">
101118
<Link>InternalProtocol\AcknowledgeConnectMessage.cs</Link>
102119
</Compile>
120+
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\AcknowledgeMessage.cs">
121+
<Link>InternalProtocol\AcknowledgeMessage.cs</Link>
122+
</Compile>
103123
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\ConnectedMessage.cs">
104124
<Link>InternalProtocol\ConnectedMessage.cs</Link>
105125
</Compile>
@@ -112,12 +132,21 @@
112132
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\FinalConnectMessage.cs">
113133
<Link>InternalProtocol\FinalConnectMessage.cs</Link>
114134
</Compile>
115-
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\PingMessage.cs">
116-
<Link>InternalProtocol\PingMessage.cs</Link>
135+
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\ReliablePingMessage.cs">
136+
<Link>InternalProtocol\ReliablePingMessage.cs</Link>
137+
</Compile>
138+
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\ReliablePongMessage.cs">
139+
<Link>InternalProtocol\ReliablePongMessage.cs</Link>
117140
</Compile>
118141
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\TempestMessage.cs">
119142
<Link>InternalProtocol\TempestMessage.cs</Link>
120143
</Compile>
144+
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\UnreliablePingMessage.cs">
145+
<Link>InternalProtocol\UnreliablePingMessage.cs</Link>
146+
</Compile>
147+
<Compile Include="..\..\Desktop\Tempest\InternalProtocol\UnreliablePongMessage.cs">
148+
<Link>InternalProtocol\UnreliablePongMessage.cs</Link>
149+
</Compile>
121150
<Compile Include="..\..\Desktop\Tempest\IPublicKeyCrypto.cs">
122151
<Link>IPublicKeyCrypto.cs</Link>
123152
</Compile>
@@ -142,6 +171,9 @@
142171
<Compile Include="..\..\Desktop\Tempest\IValueWriter.cs">
143172
<Link>IValueWriter.cs</Link>
144173
</Compile>
174+
<Compile Include="..\..\Desktop\Tempest\LocalClient.cs">
175+
<Link>LocalClient.cs</Link>
176+
</Compile>
145177
<Compile Include="..\..\Desktop\Tempest\Message.cs">
146178
<Link>Message.cs</Link>
147179
</Compile>
@@ -154,9 +186,6 @@
154186
<Compile Include="..\..\Desktop\Tempest\MessageHeader.cs">
155187
<Link>MessageHeader.cs</Link>
156188
</Compile>
157-
<Compile Include="..\..\Desktop\Tempest\MessageStream.cs">
158-
<Link>MessageStream.cs</Link>
159-
</Compile>
160189
<Compile Include="..\..\Desktop\Tempest\MutableLookup.cs">
161190
<Link>MutableLookup.cs</Link>
162191
</Compile>
@@ -166,6 +195,12 @@
166195
<Compile Include="..\..\Desktop\Tempest\Protocol.cs">
167196
<Link>Protocol.cs</Link>
168197
</Compile>
198+
<Compile Include="..\..\Desktop\Tempest\Providers\Network\ClientMessageSerializer.cs">
199+
<Link>Providers\Network\ClientMessageSerializer.cs</Link>
200+
</Compile>
201+
<Compile Include="..\..\Desktop\Tempest\Providers\Network\MessageSerializer.cs">
202+
<Link>Providers\Network\MessageSerializer.cs</Link>
203+
</Compile>
169204
<Compile Include="..\..\Desktop\Tempest\Providers\Network\NetworkClientConnection.cs">
170205
<Link>Providers\Network\NetworkClientConnection.cs</Link>
171206
</Compile>
@@ -184,15 +219,21 @@
184219
<Compile Include="..\..\Desktop\Tempest\SerializerExtensions.cs">
185220
<Link>SerializerExtensions.cs</Link>
186221
</Compile>
187-
<Compile Include="..\..\Desktop\Tempest\ServerBase.cs">
188-
<Link>ServerBase.cs</Link>
222+
<Compile Include="..\..\Desktop\Tempest\Server.cs">
223+
<Link>Server.cs</Link>
189224
</Compile>
190225
<Compile Include="..\..\Desktop\Tempest\StreamValueReader.cs">
191226
<Link>StreamValueReader.cs</Link>
192227
</Compile>
193228
<Compile Include="..\..\Desktop\Tempest\StreamValueWriter.cs">
194229
<Link>StreamValueWriter.cs</Link>
195230
</Compile>
231+
<Compile Include="..\..\Desktop\Tempest\Target.cs">
232+
<Link>Target.cs</Link>
233+
</Compile>
234+
<Compile Include="..\..\Desktop\Tempest\TargetExtensions.cs">
235+
<Link>TargetExtensions.cs</Link>
236+
</Compile>
196237
<Compile Include="..\..\Desktop\Tempest\Timer.cs">
197238
<Link>Timer.cs</Link>
198239
</Compile>
@@ -202,20 +243,24 @@
202243
<Compile Include="..\..\Desktop\Tempest\TypeMap.cs">
203244
<Link>TypeMap.cs</Link>
204245
</Compile>
205-
<Compile Include="..\..\Silverlight\Tempest\Trace.cs">
206-
<Link>Trace.cs</Link>
246+
<Compile Include="..\..\iOS\Tempest\TraceSwitch.cs">
247+
<Link>TraceSwitch.cs</Link>
207248
</Compile>
208249
<Compile Include="InternalBufferOverflowException.cs" />
209250
<Compile Include="Properties\AssemblyInfo.cs" />
210251
</ItemGroup>
211-
<ItemGroup />
252+
<ItemGroup>
253+
<None Include="packages.config" />
254+
</ItemGroup>
212255
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
213256
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
214257
<ProjectExtensions>
215258
<VisualStudio>
216259
<UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="d6a2003c-cbb2-47b0-b306-521141d3068d" />
217260
</VisualStudio>
218261
</ProjectExtensions>
262+
<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.7\tools\Microsoft.Bcl.Build.targets" />
263+
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
219264
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
220265
Other similar extension points exist, see Microsoft.Common.targets.
221266
<Target Name="BeforeBuild">

Windows Phone/Tempest/packages.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.Bcl" version="1.0.19" targetFramework="wp71" />
4+
<package id="Microsoft.Bcl.Async" version="1.0.16" targetFramework="wp71" />
5+
<package id="Microsoft.Bcl.Build" version="1.0.7" targetFramework="wp71" />
6+
</packages>

0 commit comments

Comments
 (0)