Skip to content

Commit 368c0d7

Browse files
committed
.Net 4.0 Cross Compile, Updated Dynamitey
1 parent 9f826d6 commit 368c0d7

File tree

10 files changed

+125
-18
lines changed

10 files changed

+125
-18
lines changed

FSharp.Dynamic/AssemblyInfo.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ open System.Runtime.InteropServices;
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the ‘*’ as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[<assembly: AssemblyVersion("1.3.3.0")>]
35+
[<assembly: AssemblyVersion("1.4.2")>]
3636
()

FSharp.Dynamic/FSharp.Dynamic.fsproj

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
<RootNamespace>FSharp.Dynamic</RootNamespace>
1111
<AssemblyName>FSharp.Dynamic</AssemblyName>
1212
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
13+
<UseNet40 Condition=" '$(UseNet40)' == '' ">false</UseNet40>
14+
<UseNet40 Condition=" $(OS) != 'Windows_NT' ">true</UseNet40>
15+
<TargetFrameworkProfile Condition=" $(UseNet40) == false ">Profile47</TargetFrameworkProfile>
1316
<Name>FSharp.Dynamic</Name>
1417
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1518
<RestorePackages>true</RestorePackages>
1619
</PropertyGroup>
17-
<PropertyGroup Condition="$(OS) == 'Windows_NT'">
18-
<TargetFrameworkProfile>Profile47</TargetFrameworkProfile>
19-
</PropertyGroup>
20-
2120
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2221
<DebugSymbols>true</DebugSymbols>
2322
<DebugType>full</DebugType>
@@ -37,31 +36,45 @@
3736
<WarningLevel>3</WarningLevel>
3837
<DocumentationFile>bin\Release\FSharp.Dynamic.XML</DocumentationFile>
3938
</PropertyGroup>
39+
<PropertyGroup Condition=" $(UseNet40) == true ">
40+
<DocumentationFile>bin\Release.net40\FSharp.Dynamic.XML</DocumentationFile>
41+
</PropertyGroup>
4042
<PropertyGroup>
4143
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
4244
</PropertyGroup>
43-
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets" Condition="$(OS) == 'Windows_NT'" />
44-
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition="$(OS) != 'Windows_NT' And Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
45-
45+
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets" Condition=" $(UseNet40) == false " />
46+
<Import Project="$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets" Condition="$(UseNet40) == true And Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets')" />
4647
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
4748
<ItemGroup>
4849
<Compile Include="AssemblyInfo.fs" />
4950
<Compile Include="Util.fs" />
5051
<Compile Include="Dynamic.fs" />
5152
<None Include="packages.config" />
5253
</ItemGroup>
53-
<ItemGroup>
54+
55+
<ItemGroup Condition=" $(UseNet40) == true " >
5456
<Reference Include="Dynamitey">
55-
<HintPath>..\packages\Dynamitey.0.8.0.6\lib\portable-win+net45+sl40\Dynamitey.dll</HintPath>
57+
<HintPath>..\packages\Dynamitey.1.0.2.0\lib\net40\Dynamitey.dll</HintPath>
5658
<Private>True</Private>
5759
</Reference>
60+
<Reference Include="FSharp.Core">
61+
<Name>FSharp.Core</Name>
62+
<AssemblyName>FSharp.Core.dll</AssemblyName>
63+
<HintPath>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\FSharp.Core.dll</HintPath>
64+
</Reference>
65+
</ItemGroup>
66+
<ItemGroup Condition=" $(UseNet40) == false ">
5867
<Reference Include="FSharp.Core">
5968
<Name>FSharp.Core</Name>
6069
<AssemblyName>FSharp.Core.dll</AssemblyName>
6170
<HintPath>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll</HintPath>
6271
</Reference>
72+
<Reference Include="Dynamitey">
73+
<HintPath>..\packages\Dynamitey.1.0.2.0\lib\portable-win+net45+sl40+wp80\Dynamitey.dll</HintPath>
74+
<Private>True</Private>
75+
</Reference>
6376
</ItemGroup>
64-
<ItemGroup Condition="$(OS) != 'Windows_NT'">
77+
<ItemGroup>
6578
<Reference Include="Microsoft.CSharp" />
6679
<Reference Include="System" />
6780
<Reference Include="System.Core" />

FSharp.Dynamic/FSharp.Dynamic.nuspec

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@
99
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
1010
<projectUrl>https://github.com/ekonbenefits/FSharp.Dynamic</projectUrl>
1111
<!--<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>-->
12-
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
1313
<description>$description$</description>
1414
<releaseNotes>PCL port.</releaseNotes>
1515
<copyright>Copyright 2013</copyright>
1616
<tags>fsharp dynamic dlr pcl</tags>
1717
</metadata>
18+
<files>
19+
<file src="bin\Release.net40\FSharp.Dynamic.dll" target="lib\net40\FSharp.Dynamic.dll" />
20+
<file src="bin\Release.net40\FSharp.Dynamic.pdb" target="lib\net40\FSharp.Dynamic.pdb" />
21+
<file src="bin\Release.net40\FSharp.Dynamic.XML" target="lib\net40\FSharp.Dynamic.XML" />
22+
</files>
1823
</package>

FSharp.Dynamic/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Dynamitey" version="0.8.0.6" targetFramework="portable-win+net45+sl50" />
3+
<package id="Dynamitey" version="1.0.2.0" targetFramework="portable-win+net45+sl50" />
44
</packages>

Tests/Tests.fsproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
<RootNamespace>Tests</RootNamespace>
1111
<AssemblyName>Tests</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<UseNet40 Condition=" '$(UseNet40)' == '' ">false</UseNet40>
14+
<UseNet40 Condition=" $(OS) != 'Windows_NT' ">true</UseNet40>
15+
<TargetFrameworkVersion Condition=" $(UseNet40) == true ">v4.0</TargetFrameworkVersion>
1316
<Name>Tests</Name>
1417
<TargetFrameworkProfile />
1518
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@@ -35,8 +38,7 @@
3538
<DocumentationFile>bin\Release\Tests.XML</DocumentationFile>
3639
</PropertyGroup>
3740
<ItemGroup>
38-
<Reference Include="Dynamitey">
39-
<HintPath>..\packages\Dynamitey.0.8.0.6\lib\portable-win+net45+sl40\Dynamitey.dll</HintPath>
41+
<Reference Include="Dynamitey, Version=1.0.2.0, Culture=neutral, PublicKeyToken=cbf53ea3aeb972c6">
4042
<Private>True</Private>
4143
</Reference>
4244
<Reference Include="FsUnit.NUnit">

Tests/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Dynamitey" version="0.8.0.6" targetFramework="net45" />
3+
<package id="Dynamitey" version="1.0.2.0" targetFramework="net45" />
44
<package id="FsUnit" version="1.2.1.0" targetFramework="net45" />
55
<package id="NUnit" version="2.6.2" targetFramework="net40" />
66
</packages>

dist/build.proj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolName Condition=" '$(SolName)' == '' ">MySolution</SolName>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<ProjectToBuild Include="..\$(SolName).sln">
8+
<Properties>Configuration=Release;</Properties>
9+
</ProjectToBuild>
10+
<ProjectToBuild Include="..\$(SolName).sln">
11+
<Properties>Configuration=Release;OutputPath=bin\Release.net40\;IntermediateOutputPath=obj\Release.net40\;UseNet40=true;</Properties>
12+
</ProjectToBuild>
13+
</ItemGroup>
14+
<Target Name="Build">
15+
<MSBuild Projects="@(ProjectToBuild)"/>
16+
</Target>
17+
</Project>

dist/create-nuget.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/create-nuget.ps1

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
try{
2+
3+
$solname = "FSharp.Dynamic"
4+
$testname = "Tests"
5+
$projectname = $solname
6+
$projecttype ="fsproj"
7+
8+
#Build PCL and .NET version from one project using msbuild script
9+
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe build.proj /p:solname=$solname
10+
11+
if (!$?){
12+
throw $error[0].Exception
13+
}
14+
15+
#Download and configure Nunit test runner
16+
..\.nuget\nuget.exe install NUnit.Runners -Version 2.6.2 -o ..\packages
17+
Copy-Item nunit-console.exe.config ..\packages\NUnit.Runners.2.6.2\tools\
18+
19+
if (!$?){
20+
throw $error[0].Exception
21+
}
22+
23+
#Test .net 40
24+
Echo "Testing Net40"
25+
..\packages\NUnit.Runners.2.6.2\tools\nunit-console.exe /framework:net-4.0 /noxml /nodots /labels /stoponerror /exclude=Performance ..\$testname\bin\Release.net40\$testname.dll
26+
27+
if (!$?){
28+
throw $error[0].Exception
29+
}
30+
31+
#Test portable
32+
Echo "Testing Portable"
33+
..\packages\NUnit.Runners.2.6.2\tools\nunit-console.exe /framework:net-4.5 /noxml /nodots /labels /stoponerror /exclude=Performance ..\$testname\bin\Release\$testname.dll
34+
35+
if (!$?){
36+
throw $error[0].Exception
37+
}
38+
39+
40+
}catch{
41+
Echo "Build Failed"
42+
exit
43+
}
44+
45+
#if successful create nuget package
46+
..\.nuget\nuget.exe pack ..\$projectname\$projectname.$projecttype -Properties Configuration=Release -Symbols
47+
Echo "Nuget Success"

dist/nunit-console.exe.config

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<!--
4+
The .NET 2.0 build of the console runner only
5+
runs under .NET 2.0 or higher. The setting
6+
useLegacyV2RuntimeActivationPolicy only applies
7+
under .NET 4.0 and permits use of mixed mode
8+
assemblies, which would otherwise not load
9+
correctly.
10+
-->
11+
<startup useLegacyV2RuntimeActivationPolicy="true">
12+
<!-- Comment out the next line to force use of .NET 4.0 -->
13+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
14+
</startup>
15+
<runtime>
16+
<!-- Ensure that test exceptions don't crash NUnit -->
17+
<legacyUnhandledExceptionPolicy enabled="1"/>
18+
<!-- Run partial trust V2 assemblies in full trust under .NET 4.0 -->
19+
<loadFromRemoteSources enabled="true"/>
20+
<!-- Look for addins in the addins directory for now -->
21+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
22+
<probing privatePath="lib;addins"/>
23+
</assemblyBinding>
24+
</runtime>
25+
</configuration>

0 commit comments

Comments
 (0)