Skip to content

Commit

Permalink
Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
humhei committed Jan 24, 2019
1 parent cc43ec9 commit b2d65fb
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
13 changes: 8 additions & 5 deletions FcsWatch.Tests/FcsWatchTests.fs
Expand Up @@ -19,8 +19,8 @@ let root = Path.getDirectory(__SOURCE_DIRECTORY__)



let projectDir = root </> "TestProject"
let projectFile = projectDir </> "TestProject.fsproj"
let entryProjectDir = root </> "TestProject"
let entryProjectFile = entryProjectDir </> "TestProject.fsproj"

let makeFileChange fullPath : FileChange =
let fullPath = Path.getFullName fullPath
Expand All @@ -35,18 +35,21 @@ type TestModel =
GetCompilerTmp: unit -> string list }

let inTest buildingConfig f =

dotnet root "build" [entryProjectFile]


let testProject = root </> @"TestLib2/TestLib2.fsproj"

let testFile = root </> @"TestLib2/Library.fs"
dotnet root "build" []
let watcher =
let buildConfig =
fun config ->
{config with WorkingDir = root; Logger = Logger.Normal}
|> buildingConfig

let checker = FSharpChecker.Create()
fcsWatcher buildConfig checker projectFile
fcsWatcher buildConfig checker entryProjectFile
let fileChange = makeFileChange testFile
let tmpEmitterAgent = watcher.PostAndReply FcsWatcherMsg.GetEmitterAgent
let getCompilerTmp () =
Expand Down Expand Up @@ -151,7 +154,7 @@ let functionTests =
[
/// "bin ref may be locked by program
testCase "obj ref only" <| fun _ ->
let infos = Fsproj.getAllFsprojInfosObjRefOnly projectFile
let infos = Fsproj.getAllFsprojInfosObjRefOnly entryProjectFile
let otherOptions = infos.[2].ProjOptions.OtherOptions
let p1 =
otherOptions
Expand Down
21 changes: 19 additions & 2 deletions README.md
@@ -1,10 +1,27 @@
# FCSWatch [![](https://img.shields.io/nuget/v/fcswatch.svg)](https://www.nuget.org/packages/FcsWatch)
Run standard fsharp codes in watch mode

## MiniSample
## Play around



### MiniSample
For a quick play around
Try https://github.com/humhei/FcsWatchMiniSample


### From source code interation test

* git clone https://github.com/humhei/FCSWatch.git
* cd FcsWatch.Tests
* tag single test `ftestCase "base interaction test"`
* dotnet run
* modify fs files in any of TestProject,TestLib2,TestLib1
* Set breakpoint in any of TestProject,TestLib2,TestLib1
* F5 Debug `Launch TestProject`
* modify fs files in any of TestProject,TestLib2,TestLib1
* add new fs file in any of TestProject,TestLib2,TestLib1
* Relaunch Debugger

## Get started

1. Install [fake5](https://fake.build/fake-gettingstarted.html)
Expand Down
2 changes: 1 addition & 1 deletion TestLib1/Library.fs
Expand Up @@ -2,5 +2,5 @@

module Say =
let hello11 name =
printfn "Hel %s" name
printfn "He l %s" name

2 changes: 1 addition & 1 deletion TestLib2/Library.fs
Expand Up @@ -2,5 +2,5 @@ namespace TestLib2

module Say =
let hello2 name =
printfn "Hello %s" name
printfn "He llo %s" name

2 changes: 0 additions & 2 deletions TestProject/Test.fs
Expand Up @@ -9,7 +9,5 @@ let main _ =
printfn "HWhatisello "
printfn "%sHsdsdaasasdasadadsadassssasello " FS.ss
Say.hello11 "g ogo"
let a = ""
Console.Read()
0 // return an integer exit code

0 comments on commit b2d65fb

Please sign in to comment.