Skip to content

Commit ced9fde

Browse files
committed
Modernize build
1 parent 6b94129 commit ced9fde

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

build.fsx

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ FinalTarget "CloseAndroid" (fun _ ->
144144

145145
Target "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

149155
Target "Restore" (fun _ ->
@@ -244,13 +250,7 @@ Target "PrepareRelease" (fun _ ->
244250
Target "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

256256
Target "AssembleForTest" (fun _ ->
@@ -260,12 +260,7 @@ Target "AssembleForTest" (fun _ ->
260260
Target "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

277272
Target "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

Comments
 (0)