Skip to content

Add build support for OS X #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Shared.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#r @"packages\FSharp.Data\lib\net40\FSharp.Data.dll"
#r "packages/FSharp.Data/lib/net40/FSharp.Data.dll"
#r "System.Xml.Linq.dll"

open FSharp.Data
Expand All @@ -12,11 +12,11 @@ open Microsoft.FSharp.Reflection
/// Global variables
/// ===========================================
module GlobalVars =
if not (Directory.Exists(__SOURCE_DIRECTORY__ + @"\generated")) then
Directory.CreateDirectory(__SOURCE_DIRECTORY__ + @"\generated") |> ignore
if not (Directory.Exists(__SOURCE_DIRECTORY__ + @"/generated")) then
Directory.CreateDirectory(__SOURCE_DIRECTORY__ + @"/generated") |> ignore

let inputFolder = __SOURCE_DIRECTORY__ + @"\inputfiles"
let makeTextWriter fileName = File.CreateText(__SOURCE_DIRECTORY__ + @"\generated\" + fileName) :> TextWriter
let inputFolder = __SOURCE_DIRECTORY__ + @"/inputfiles"
let makeTextWriter fileName = File.CreateText(__SOURCE_DIRECTORY__ + @"/generated/" + fileName) :> TextWriter
// let jsWebOutput = makeTextWriter "domWeb.js"
// let jsWinOutput = makeTextWriter "domWindows.js"
// let jsWorkerOutput = makeTextWriter "dedicatedworker.js"
Expand Down Expand Up @@ -49,13 +49,13 @@ module JsonItems =
type ItemsType = JsonProvider<"inputfiles/sample.json">

let overriddenItems =
File.ReadAllText(GlobalVars.inputFolder + @"\overridingTypes.json") |> ItemsType.Parse
File.ReadAllText(GlobalVars.inputFolder + @"/overridingTypes.json") |> ItemsType.Parse

let removedItems =
File.ReadAllText(GlobalVars.inputFolder + @"\removedTypes.json") |> ItemsType.Parse
File.ReadAllText(GlobalVars.inputFolder + @"/removedTypes.json") |> ItemsType.Parse

let addedItems =
File.ReadAllText(GlobalVars.inputFolder + @"\addedTypes.json") |> ItemsType.Parse
File.ReadAllText(GlobalVars.inputFolder + @"/addedTypes.json") |> ItemsType.Parse

// This is the kind of items in the external json files that are used as a
// correction for the spec.
Expand Down Expand Up @@ -95,7 +95,7 @@ module JsonItems =
module Comments =
type CommentType = JsonProvider<"inputfiles/comments.json">

let comments = File.ReadAllText(__SOURCE_DIRECTORY__ + @"\inputfiles\comments.json") |> CommentType.Parse
let comments = File.ReadAllText(__SOURCE_DIRECTORY__ + @"/inputfiles/comments.json") |> CommentType.Parse

let GetCommentForProperty iName pName =
match comments.Interfaces |> Array.tryFind (fun i -> i.Name = iName) with
Expand Down
19 changes: 19 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
if [ ! -d ".paket" ]; then
mkdir ".paket"
curl https://github.com/fsprojects/Paket/releases/download/2.12.5/paket.bootstrapper.exe -L --insecure -o .paket/paket.bootstrapper.exe
fi

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 build.fsx