Skip to content

Commit

Permalink
Convert to Paket
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 17, 2015
1 parent d6c2975 commit 1e656ba
Show file tree
Hide file tree
Showing 31 changed files with 214 additions and 244 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ tests/obj/*
*.suo
packages/*
TestResults.xml
temp/*
temp/*
.paket/paket.exe
*.orig
docs/output
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.
36 changes: 36 additions & 0 deletions .paket/paket.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">true</RestorePackages>
<!-- Download Paket.exe if it does not already exist -->
<DownloadPaket Condition=" '$(DownloadPaket)' == '' ">true</DownloadPaket>
<PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>
<PaketRootPath>$(MSBuildThisFileDirectory)..\</PaketRootPath>
</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) restore</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)'" />
<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="$(PaketRootPath)" />
</Target>
</Project>
18 changes: 9 additions & 9 deletions FSharp.Charting.Tests.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{47D32F6E-7247-4196-8F8F-277C52DCA647}"
ProjectSection(SolutionItems) = preProject
paket.dependencies = paket.dependencies
paket.lock = paket.lock
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Charting.Tests", "tests\FSharp.Charting.Tests.fsproj", "{5EF9FF95-1C75-458A-983A-168E43945913}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A9E8062-1D58-4E25-B89A-16B72E95A012}"
Expand All @@ -16,13 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
examples\StockAndCandlestickCharts.fsx = examples\StockAndCandlestickCharts.fsx
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5FF52F30-670D-4E8C-85FA-27F7A5D6C591}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
18 changes: 9 additions & 9 deletions FSharp.Charting.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{35EEF783-8EF0-4A55-B13B-7EEC6B2D1BA3}"
ProjectSection(SolutionItems) = preProject
paket.dependencies = paket.dependencies
paket.lock = paket.lock
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Charting", "src\FSharp.Charting.fsproj", "{6EBFDE55-9687-40A9-8C1A-6E204ECB117F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{36E72EB1-5847-4B38-8993-B951648CB0D9}"
Expand All @@ -14,13 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{36E7
RELEASE_NOTES.md = RELEASE_NOTES.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{5FF52F30-670D-4E8C-85FA-27F7A5D6C591}"
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Charting.Gtk", "src\FSharp.Charting.Gtk.fsproj", "{6EBFDE55-9687-40A9-8C1A-6E204ECB117D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{E0C29A24-145E-4364-A268-2687F5136613}"
Expand Down
13 changes: 11 additions & 2 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
@echo off
if not exist packages\FAKE\tools\Fake.exe (
.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion -Prerelease
cls

.paket\paket.bootstrapper.exe
if errorlevel 1 (
exit /b %errorlevel%
)

.paket\paket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

packages\FAKE\tools\FAKE.exe build.fsx %*
26 changes: 1 addition & 25 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ Target "UpdateFsxVersions" (fun _ ->
File.WriteAllText(path, text3)
)

// --------------------------------------------------------------------------------------
// Restore NuGet packages

Target "RestorePackages" (fun _ ->
!! "./**/packages.config"
|> Seq.iter (RestorePackage (fun p -> { p with ToolPath = "./.nuget/NuGet.exe" }))
)

// --------------------------------------------------------------------------------------
// Clean build results

Expand Down Expand Up @@ -118,22 +110,12 @@ Target "BuildGtk" (fun _ ->
// Run the unit tests using test runner & kill test runner when complete

Target "RunTests" (fun _ ->

// Will get NUnit.Runner NuGet package if not present
// (needed to run tests using the 'NUnit' target)
!! "./**/packages.config"
|> Seq.iter (RestorePackage (fun p -> { p with ToolPath = "./.nuget/NuGet.exe" }))

let nunitVersion = GetPackageVersion "packages" "NUnit.Runners"
let nunitPath = sprintf "packages/NUnit.Runners.%s/Tools" nunitVersion

ActivateFinalTarget "CloseTestRunner"

if not compilingOnUnix then
(files [ "tests/bin/Release/FSharp.Charting.Tests.dll"])
|> NUnit (fun p ->
{ p with
ToolPath = nunitPath
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 20.
OutputFile = "TestResults.xml" })
Expand All @@ -151,7 +133,6 @@ Target "NuGet" (fun _ ->
// Format the description to fit on a single line (remove \r\n and double-spaces)
let description = description.Replace("\r", "").Replace("\n", "").Replace(" ", " ")
let descriptionGtk = descriptionGtk.Replace("\r", "").Replace("\n", "").Replace(" ", " ")
let nugetPath = ".nuget/NuGet.exe"

if not compilingOnUnix then
NuGet (fun p ->
Expand All @@ -164,7 +145,6 @@ Target "NuGet" (fun _ ->
ReleaseNotes = releaseNotes
Tags = tags
OutputPath = "bin"
ToolPath = nugetPath
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetkey"
Dependencies = []
Expand All @@ -181,7 +161,6 @@ Target "NuGet" (fun _ ->
ReleaseNotes = releaseNotes
Tags = tagsGtk
OutputPath = "bin"
ToolPath = nugetPath
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetkey"
Dependencies = []
Expand Down Expand Up @@ -218,15 +197,12 @@ Target "Release" DoNothing
Target "All" DoNothing

"Clean"
==> "RestorePackages"
==> "AssemblyInfo"
==> "UpdateFsxVersions"
==> "Build"
==> "RunTests"

"RestorePackages"
==> "AssemblyInfo"
==> "UpdateFsxVersions"
"UpdateFsxVersions"
==> "BuildGtk"

"Build" ==> "NuGet"
Expand Down
35 changes: 32 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
#!/bin/bash
if [ ! -f packages/FAKE/tools/FAKE.exe ]; then
mono .nuget/NuGet.exe install FAKE -OutputDirectory packages -ExcludeVersion -Prerelease
if test "$OS" = "Windows_NT"
then
# use .Net

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

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

packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
else
# use mono
mono .paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
fi

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

mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi
mono packages/FAKE/tools/FAKE.exe build.fsx $@
Loading

0 comments on commit 1e656ba

Please sign in to comment.