Skip to content

Commit

Permalink
Add minimal FAKE build script
Browse files Browse the repository at this point in the history
  • Loading branch information
dungpa committed Jun 8, 2015
1 parent 2648d2f commit 75e2552
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,4 @@ pip-log.txt
# Mac crap
.DS_Store
*.ncrunch*
TestResults.xml
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
language: objective-c
language: csharp

env:
matrix:
- MONO_VERSION="3.6.0"

install:
- wget "http://download.mono-project.com/archive/${MONO_VERSION}/macos-10-x86/MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg"
- sudo installer -pkg "MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg" -target /
- mono src/.nuget/NuGet.exe install NUnit.Runners -Version 2.6.3 -OutputDirectory src/packages -ExcludeVersion
sudo: false # use the new container-based Travis infrastructure

script:
- xbuild src/fantomas.sln /p:Configuration=Release
- mono --runtime=v4.5 src/packages/NUnit.Runners/tools/nunit-console.exe src/Fantomas.Tests/bin/Release/Fantomas.Tests.dll

- ./build.sh All
6 changes: 6 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
cls
if not exist packages\FAKE\tools\Fake.exe (
src\.nuget\nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion
)
packages\FAKE\tools\FAKE.exe build.fsx %*
68 changes: 68 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------

#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Git
open System

// Git configuration (used for publishing documentation in gh-pages branch)
// The profile where the project is posted
let gitHome = "https://github.com/dungpa"
// The name of the project on GitHub
let gitName = "fantomas"
let cloneUrl = "git@github.com:dungpa/fantomas.git"

// (<solutionFile>.sln is built during the building process)
let solutionFile = "fantomas"
let testAssemblies = "src/**/bin/Release/*Tests*.dll"

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

// --------------------------------------------------------------------------------------
// Clean build results & restore NuGet packages

Target "Clean" (fun _ ->
CleanDirs ["bin"]
)

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

// --------------------------------------------------------------------------------------
// Build library & test project

Target "Build" (fun _ ->
// We would like to build only one solution
!! (solutionFile + ".sln")
|> MSBuildRelease "" "Rebuild"
|> ignore
)

Target "UnitTests" (fun _ ->
!! testAssemblies
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 20.
Framework = "4.5"
Domain = NUnitDomainModel.MultipleDomainModel
OutputFile = "TestResults.xml" })
)

// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override

Target "All" DoNothing

"Clean"
==> "RestorePackages"
==> "Build"
==> "UnitTests"
==> "All"


RunTargetOrDefault "All"
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

mono zrc/.nuget/nuget.exe install FAKE -OutputDirectory packages -ExcludeVersion

mono packages/FAKE/tools/FAKE.exe build.fsx $@

0 comments on commit 75e2552

Please sign in to comment.