Skip to content

Commit

Permalink
CompileWithFilter for DynamicsNAV
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 5, 2018
1 parent 30f7e60 commit bba06fb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 4.64.8 - 05.03.2018
* CompileWithFilter for DynamicsNAV

#### 4.64.7 - 01.03.2018
* Allow REST calls without credentials

Expand Down
23 changes: 22 additions & 1 deletion src/app/FakeLib/DynamicsNavHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,28 @@ let ImportFiles connectionInfo importFileName files =
with _ -> ())
raise exn

/// Compiles all filtered uncompiled objects in the Dynamics NAV client.
let CompileWithFilter filter (connectionInfo:DynamicsNavParams) =
let sw = System.Diagnostics.Stopwatch()
sw.Start()
let details = ""
use __ = traceStartTaskUsing "CompileAll" details
let args =
sprintf "command=compileobjects, filter=\"Compiled=0;%s\", logfile=\"%s\", servername=\"%s\", database=\"%s\""
filter
(FullName connectionInfo.TempLogFile) connectionInfo.ServerName connectionInfo.Database
if 0 <> ExecProcess (fun info ->
info.FileName <- connectionInfo.ToolPath
info.WorkingDirectory <- connectionInfo.WorkingDir
info.Arguments <- args) connectionInfo.TimeOut
then reportError (sprintf "Compile with filter %s failed." filter) connectionInfo.TempLogFile
tracefn "Compile with filter %s took %dms" filter sw.ElapsedMilliseconds


/// Compiles all uncompiled objects in the Dynamics NAV client.
let CompileAll connectionInfo =
let sw = System.Diagnostics.Stopwatch()
sw.Start()
let details = ""
use __ = traceStartTaskUsing "CompileAll" details
let args =
Expand All @@ -244,7 +264,8 @@ let CompileAll connectionInfo =
info.FileName <- connectionInfo.ToolPath
info.WorkingDirectory <- connectionInfo.WorkingDir
info.Arguments <- args) connectionInfo.TimeOut
then reportError "CompileAll failed" connectionInfo.TempLogFile
then reportError "CompileAll failed." connectionInfo.TempLogFile
tracefn "CompileAll took %dms" sw.ElapsedMilliseconds

/// The parameter type allows to interact with Dynamics NAV RTC.
type RTCParams =
Expand Down

0 comments on commit bba06fb

Please sign in to comment.