Skip to content

Commit

Permalink
Use Paket
Browse files Browse the repository at this point in the history
  • Loading branch information
forki authored and Gustavo Guerra committed Sep 20, 2014
1 parent b92943a commit 6a65f4e
Show file tree
Hide file tree
Showing 40 changed files with 659 additions and 308 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ TestResult.xml
*.userprefs
log.csv
log.txt
.paket/paket.exe
6 changes: 0 additions & 6 deletions .nuget/NuGet.Config

This file was deleted.

Binary file removed .nuget/NuGet.exe
Binary file not shown.
136 changes: 0 additions & 136 deletions .nuget/NuGet.targets

This file was deleted.

Binary file added .paket/paket.bootstrapper.exe
Binary file not shown.
65 changes: 65 additions & 0 deletions .paket/paket.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>

<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>

<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<PaketToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".paket"))</PaketToolsPath>
</PropertyGroup>

<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch paket.exe with the mono command if we're not on windows -->
<PaketToolsPath>$(SolutionDir).paket</PaketToolsPath>
</PropertyGroup>

<PropertyGroup>
<!-- Paket command -->
<PaketExePath Condition=" '$(PaketExePath)' == '' ">$(PaketToolsPath)\paket.exe</PaketExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)\paket.bootstrapper.exe</PaketBootStrapperExePath>

<PaketCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketExePath)"</PaketCommand>
<PaketCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>

<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT'">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>

<!-- Commands -->
<RestoreCommand>$(PaketCommand) install</RestoreCommand>
<DownloadPaketCommand>$(PaketBootStrapperCommand) </DownloadPaketCommand>

<!-- We need to ensure packages are restored prior to assembly resolve -->
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>
</PropertyGroup>

<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate paket.exe -->
<Error Condition="'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')" Text="Unable to locate '$(PaketExePath)'" />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download paket.exe once.
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="DownloadPaket" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)" />
</Target>

<Target Name="DownloadPaket">
<Exec Command="$(DownloadPaketCommand)" Condition=" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')" />
</Target>

<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
WorkingDirectory="$(SolutionDir)" />
</Target>

</Project>
12 changes: 8 additions & 4 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@echo off
if not exist packages\FAKE\tools\Fake.exe (
.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
.paket\paket.bootstrapper.exe
if errorlevel 1 (
exit /b %errorlevel%
)
if not exist packages\SourceLink.Fake\tools\SourceLink.fsx (
.nuget\nuget.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion

.paket\paket.exe install -v
if errorlevel 1 (
exit /b %errorlevel%
)

packages\FAKE\tools\FAKE.exe build.fsx %*
16 changes: 11 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
if [ ! -f packages/FAKE/tools/Fake.exe ]; then
mono --runtime=v4.0 .nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion
mono .paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi
#if [ ! -f packages/SourceLink.Fake/tools/Fake.fsx ]; then
# mono --runtime=v4.0 .nuget/NuGet.exe install SourceLink.Fake -OutputDirectory packages -ExcludeVersion
#fi

mono .paket/paket.exe install -v
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

mono --runtime=v4.0 packages/FAKE/tools/FAKE.exe build.fsx -d:MONO $@
15 changes: 15 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source http://nuget.org/api/v2

nuget Zlib.Portable 1.10.0
nuget FSharp.Charting 0.90.6
nuget FSharp.Compiler.Service 0.0.59
nuget FSharp.Formatting 2.4.21
nuget Microsoft.AspNet.Razor 2.0.30506.0
nuget NUnit 2.6.3
nuget NUnit.Runners 2.6.3
nuget RazorEngine 3.3.0
nuget FsCheck 0.9.2.0
nuget Nancy 0.20.0
nuget Nancy.Hosting.Self 0.20.0
nuget FAKE
nuget SourceLink.Fake
21 changes: 21 additions & 0 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
NUGET
remote: http://nuget.org/api/v2
specs:
FAKE (3.5.1)
FsCheck (0.9.2.0)
FSharp.Charting (0.90.6)
FSharp.Compiler.Service (0.0.59)
FSharp.Formatting (2.4.21)
Microsoft.AspNet.Razor (>= 2.0.30506.0)
RazorEngine (>= 3.3.0)
FSharp.Compiler.Service (>= 0.0.59)
Microsoft.AspNet.Razor (2.0.30506.0)
Nancy (0.20.0)
Nancy.Hosting.Self (0.20.0)
Nancy (>= 0.20.0)
NUnit (2.6.3)
NUnit.Runners (2.6.3)
RazorEngine (3.3.0)
Microsoft.AspNet.Razor (>= 2.0.30506.0)
SourceLink.Fake (0.3.4)
Zlib.Portable (1.10.0)
20 changes: 20 additions & 0 deletions src/FSharp.Data.DesignTime.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,24 @@
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetName).pdb" DestinationFolder="$(ProjectDir)..\bin" Condition="Exists('$(ProjectDir)$(OutDir)$(TargetName).pdb')" />
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetName).xml" DestinationFolder="$(ProjectDir)..\bin" />
</Target>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETPortable' And $(TargetFrameworkProfile) == 'Profile136' And $(TargetPlatformIdentifier) == 'Portable' And $(TargetPlatformVersion) == '7.0'">
<ItemGroup>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETPortable'">
<ItemGroup>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
</Project>
30 changes: 23 additions & 7 deletions src/FSharp.Data.Portable47.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -68,17 +68,13 @@
<Compile Include="Freebase\FreebaseOperators.fs" />
<Compile Include="Runtime.fs" />
<Compile Include="AssemblyInfo.Portable47.fs" />
<None Include="packages.config" />
<None Include="paket.references" />
</ItemGroup>
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETPortable\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable.1.10.0\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand All @@ -100,5 +96,25 @@
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetName).pdb" DestinationFolder="$(SolutionDir)bin\portable47" />
<Copy SourceFiles="$(ProjectDir)$(OutDir)$(TargetName).xml" DestinationFolder="$(SolutionDir)bin\portable47" />
</Target>
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="$(SolutionDir)\.paket\paket.targets" />
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETPortable' And $(TargetFrameworkProfile) == 'Profile136' And $(TargetPlatformIdentifier) == 'Portable' And $(TargetPlatformVersion) == '7.0'">
<ItemGroup>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == '.NETPortable'">
<ItemGroup>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
</Project>
Loading

0 comments on commit 6a65f4e

Please sign in to comment.