@@ -64,7 +64,7 @@ let srcDir = __SOURCE_DIRECTORY__ </> "src"
6464
6565let testDir = __ SOURCE_ DIRECTORY__ </> " tests" </> " IntegrationTests"
6666
67- let dotnetcliVersion = " 2.0.0 "
67+ let dotnetcliVersion = DotNetCli.GetDotNetSDKVersionFromGlobalJson ()
6868
6969let mutable dotnetExePath = " dotnet"
7070
@@ -144,6 +144,12 @@ FinalTarget "CloseAndroid" (fun _ ->
144144
145145Target " InstallDotNetCore" ( fun _ ->
146146 dotnetExePath <- DotNetCli.InstallDotNetSDK dotnetcliVersion
147+ let fi = FileInfo dotnetExePath
148+ let SEPARATOR = if isWindows then " ;" else " :"
149+ Environment.SetEnvironmentVariable(
150+ " PATH" ,
151+ fi.Directory.FullName + SEPARATOR + System.Environment.GetEnvironmentVariable " PATH" ,
152+ EnvironmentVariableTarget.Process)
147153)
148154
149155Target " Restore" ( fun _ ->
@@ -244,13 +250,7 @@ Target "PrepareRelease" (fun _ ->
244250Target " CompileForTest" ( fun _ ->
245251 ActivateFinalTarget " KillProcess"
246252
247- let result =
248- ExecProcess ( fun info ->
249- info.FileName <- dotnetExePath
250- info.WorkingDirectory <- srcDir
251- info.Arguments <- " fable npm-run compile-for-test" ) TimeSpan.MaxValue
252-
253- if result <> 0 then failwith " fable shut down. Please check logs above"
253+ run yarnTool " run fable-splitter -c splitter.config.js --define TEST" srcDir
254254)
255255
256256Target " AssembleForTest" ( fun _ ->
@@ -260,12 +260,7 @@ Target "AssembleForTest" (fun _ ->
260260Target " BuildRelease" ( fun _ ->
261261 ActivateFinalTarget " KillProcess"
262262
263- let result =
264- ExecProcess ( fun info ->
265- info.FileName <- dotnetExePath
266- info.WorkingDirectory <- srcDir
267- info.Arguments <- " fable npm-run build" ) TimeSpan.MaxValue
268- if result <> 0 then failwith " fable shut down. Please check logs above"
263+ run yarnTool " run fable-splitter -c splitter.config.js --define RELEASE" srcDir
269264 run gradleTool " assembleRelease --console plain" " android"
270265
271266 let outFile = " android" </> " app" </> " build" </> " outputs" </> " apk" </> " app-release.apk"
@@ -275,20 +270,9 @@ Target "BuildRelease" (fun _ ->
275270)
276271
277272Target " Debug" ( fun _ ->
278- let result =
279- ExecProcess ( fun info ->
280- info.FileName <- dotnetExePath
281- info.WorkingDirectory <- srcDir
282- info.Arguments <- " fable npm-run cold-start" ) TimeSpan.MaxValue
283- if result <> 0 then failwith " fable shut down."
273+ run yarnTool " run fable-splitter -c splitter.config.js --define DEBUG" srcDir
284274
285- let dotnetwatch = async {
286- let result =
287- ExecProcess ( fun info ->
288- info.FileName <- dotnetExePath
289- info.WorkingDirectory <- srcDir
290- info.Arguments <- " fable npm-run start" ) TimeSpan.MaxValue
291- if result <> 0 then failwith " fable shut down." }
275+ let dotnetwatch = async { run yarnTool " run fable-splitter -c splitter.config.js -w --define DEBUG" srcDir }
292276
293277 let reactNativeTool = async { run reactNativeTool " run-android" " " }
294278
0 commit comments