Permalink
Browse files

Adaptation for the .net35 compact framework

  • Loading branch information...
1 parent 41037bd commit 5340d0d0cca5a41bf1531ea7ea4c18c91bccd90f @cail committed Jul 1, 2011
View
@@ -2,6 +2,7 @@
PUSHD "%~dp0"
SET MSBuild=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
+SET MSBuild35=%SystemRoot%\Microsoft.NET\Framework\v3.5\MSBuild.exe
IF NOT EXIST "%MSBuild%" (
ECHO Installation of .NET Framework 4.0 is required to build this project, including .NET v2.0 and v3.5 releases
ECHO http://www.microsoft.com/downloads/details.aspx?FamilyID=0a391abd-25c1-4fc0-919f-b21f31ab88b7
@@ -34,6 +35,12 @@ ECHO.
FOR %%i IN (%FrameworkVer%) DO "%MSBuild%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkVersion=%%i;Configuration=%Configuration%
+REM .net 3.5 Compact Framework -----------------------------------------------------
+
+IF EXIST "C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.CSharp.targets" (
+ "%MSBuild35%" src/JsonFx/JsonFx.csproj /target:rebuild /property:TargetFrameworkIdentifier=netcf;Configuration=%Configuration%
+)
+
REM Silverlight -----------------------------------------------------
IF EXIST "%ProgramFiles%\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" (
@@ -81,6 +88,7 @@ ECHO Copying files for packages...
xcopy build\%Configuration%_v4.0\*.* "packages\lib\net40\" /Y
xcopy build\%Configuration%_v3.5\*.* "packages\lib\net35\" /Y
xcopy build\%Configuration%_v2.0\*.* "packages\lib\net20\" /Y
+xcopy build\%Configuration%_v3.5_netcf\*.* "packages\lib\netcf35\" /Y
xcopy build\%Configuration%_v3.5_Silverlight\*.* "packages\lib\sl35\" /Y
xcopy build\%Configuration%_v4.0_Silverlight\*.* "packages\lib\sl40\" /Y
xcopy build\%Configuration%_v4.0_WindowsPhone\*.* "packages\lib\sl40-wp\" /Y
@@ -38,6 +38,7 @@ THE SOFTWARE.
namespace JsonFx
{
+#if NET4
public class AssertPatchedTests
{
#region Constants
@@ -141,6 +142,7 @@ public void AssertPatched_EquivalentNotStrictDictionaries_Passes()
#endregion AssertPatched Tests
}
+#endif
/// <summary>
/// Patches xunit.Assert to allow less strict comparisons (doesn't enforce exact type)
@@ -37,6 +37,17 @@ THE SOFTWARE.
namespace JsonFx.IO
{
+
+#if !NET40
+ public static class SequenceBufferHelpers
+ {
+ public static void Clear(this StringBuilder sb)
+ {
+ sb.Length = 0;
+ }
+ }
+#endif
+
public class SequenceBufferTests
{
#region Constants
@@ -69,6 +69,7 @@
<Reference Include="System.XML" />
<Reference Include="xunit">
<HintPath>$(SolutionDir)\lib\xUnit.net\xunit.dll</HintPath>
+ <HintPath>..\..\lib\xUnit.net\xunit.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkVersion)' != 'v2.0' And '$(TargetFrameworkVersion)' != 'v3.0' ">
@@ -87,11 +88,17 @@
<Compile Include="Bson\BsonFormatterTests.cs" />
<Compile Include="Bson\BsonConverterTests.cs" />
<Compile Include="CodeGen\DynamicMethodGeneratorTests.cs" />
+ </ItemGroup>
+ <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != 'netcf'">
<Compile Include="Model\ModelAnalyzerTests.cs" />
<Compile Include="Model\ModelWalkerTests.cs" />
<Compile Include="Model\Filters\Iso8601DateFilterTests.cs" />
<Compile Include="Model\Filters\MSAjaxDateFilterTests.cs" />
<Compile Include="Model\ModelSubsequencerTests.cs" />
+ <Compile Include="Serialization\TypeCoercionUtilityTests.cs" />
+ <Compile Include="Linq\QueryEngineTests.cs" />
+ </ItemGroup>
+ <ItemGroup>
<Compile Include="Html\HtmlFormatterTests.cs" />
<Compile Include="Html\HtmlTokenizerTests.cs" />
<Compile Include="Html\HtmlOutTransformerTests.cs" />
@@ -107,11 +114,9 @@
<Compile Include="Json\JsonFormatterTests.cs" />
<Compile Include="Json\JsonTokenizerTests.cs" />
<Compile Include="Json\Resolvers\JsonResolverStrategyTests.cs" />
- <Compile Include="Linq\QueryEngineTests.cs" />
<Compile Include="Serialization\Resolvers\ConventionResolverStrategyTests.cs" />
<Compile Include="Serialization\Resolvers\CombinedResolverStrategyTests.cs" />
<Compile Include="Serialization\Resolvers\DataContractResolverStrategyTests.cs" />
- <Compile Include="Serialization\TypeCoercionUtilityTests.cs" />
<Compile Include="Xml\XmlConverterTests.cs" />
<Compile Include="Xml\XmlFormatterTests.cs" />
<Compile Include="Xml\XmlInTransformerTests.cs" />
View
@@ -9,6 +9,11 @@
<ProjectGuid>{3082284B-B579-4808-A4A4-D88DDA4025CB}</ProjectGuid>
<ProjectTypeGuids Condition=" '$(TargetFrameworkIdentifier)' == 'Silverlight' ">{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<ProjectTypeGuids Condition=" '$(TargetFrameworkProfile)' == 'WindowsPhone' ">{C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+
+ <PlatformID Condition=" '$(TargetFrameworkIdentifier)' == 'netcf' ">b2c48bd2-963d-4549-9169-1fa021dce484</PlatformID>
+ <PlatformFamilyName Condition=" '$(TargetFrameworkIdentifier)' == 'netcf' ">PocketPC</PlatformFamilyName>
+ <TargetFrameworkVersion Condition=" '$(TargetFrameworkIdentifier)' == 'netcf' ">v3.5</TargetFrameworkVersion>
+
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>JsonFx</RootNamespace>
@@ -68,9 +73,12 @@
<PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v4.0' ">
<DefineConstants>$(DefineConstants);NET40</DefineConstants>
</PropertyGroup>
- <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v3.5' ">
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v3.5' and '$(TargetFrameworkIdentifier)' != 'netcf' ">
<DefineConstants>$(DefineConstants);NET35</DefineConstants>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v3.5' and '$(TargetFrameworkIdentifier)' == 'netcf' ">
+ <DefineConstants>$(DefineConstants);NETCF;NET30;SILVERLIGHT</DefineConstants>
+ </PropertyGroup>
<PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == 'v3.0' ">
<DefineConstants>$(DefineConstants);NET20</DefineConstants>
<TargetFrameworkProfile>
@@ -201,13 +209,13 @@
<ItemGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == 'v3.0' ">
<Compile Include="Linq\ExtensionAttribute.cs" />
</ItemGroup>
- <ItemGroup Condition=" '$(TargetFrameworkProfile)' == 'WindowsPhone' ">
+ <ItemGroup Condition=" '$(TargetFrameworkProfile)' == 'WindowsPhone' or '$(TargetFrameworkIdentifier)' == 'netcf' ">
<Compile Include="CodeGen\DynamicMethodGenerator_NoEmit.cs" />
</ItemGroup>
- <ItemGroup Condition=" '$(TargetFrameworkProfile)' != 'WindowsPhone' ">
+ <ItemGroup Condition=" '$(TargetFrameworkProfile)' != 'WindowsPhone' and '$(TargetFrameworkIdentifier)' != 'netcf' ">
<Compile Include="CodeGen\DynamicMethodGenerator.cs" />
</ItemGroup>
- <ItemGroup Condition=" '$(TargetFrameworkVersion)' != 'v2.0' And '$(TargetFrameworkVersion)' != 'v3.0' And '$(TargetFrameworkProfile)' != 'WindowsPhone' ">
+ <ItemGroup Condition=" '$(TargetFrameworkVersion)' != 'v2.0' And '$(TargetFrameworkVersion)' != 'v3.0' And '$(TargetFrameworkProfile)' != 'WindowsPhone' and '$(TargetFrameworkIdentifier)' != 'netcf' ">
<Compile Include="Model\ModelReader_Query.cs" />
<Compile Include="Model\Query`1.cs" />
<Compile Include="Linq\BaseQueryProvider.cs" />
@@ -220,7 +228,8 @@
<Compile Include="Linq\Query`1.cs" />
</ItemGroup>
<ItemGroup />
- <Import Condition=" '$(TargetFrameworkIdentifier)' != 'Silverlight' " Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Condition=" '$(TargetFrameworkIdentifier)' != 'Silverlight' and '$(TargetFrameworkIdentifier)' != 'netcf' " Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <Import Condition=" '$(TargetFrameworkIdentifier)' == 'netcf' " Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<Import Condition=" '$(TargetFrameworkIdentifier)' == 'Silverlight' And '$(TargetFrameworkProfile)' != 'WindowsPhone' And '$(TargetFrameworkVersion)' == 'v3.5' " Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" />
<Import Condition=" '$(TargetFrameworkIdentifier)' == 'Silverlight' And '$(TargetFrameworkProfile)' != 'WindowsPhone' And '$(TargetFrameworkVersion)' != 'v3.5' " Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(TargetFrameworkVersion)\Microsoft.Silverlight.CSharp.targets" />
<Import Condition=" '$(TargetFrameworkProfile)' == 'WindowsPhone' " Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight for Phone\$(TargetFrameworkVersion)\Microsoft.Silverlight.$(TargetFrameworkProfile).Overrides.targets" />
@@ -257,7 +257,11 @@ private static string GetTypeName(Type type)
}
}
- if (typeof(IDictionary).IsAssignableFrom(type) || type.GetInterface(TypeCoercionUtility.TypeGenericIDictionary, false) != null)
+ if (typeof(IDictionary).IsAssignableFrom(type)
+#if !NETCF
+ || type.GetInterface(TypeCoercionUtility.TypeGenericIDictionary, false) != null
+#endif
+ )
{
// generic IDictionary or IDictionary<,>
return "object";

0 comments on commit 5340d0d

Please sign in to comment.