加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.fsx 1.92 KB
一键复制 编辑 原始数据 按行查看 历史
Tom Clarke 提交于 2021-04-20 18:03 . Update build.fsx
#r "paket: groupref FakeBuild //"
#load ".fake/build.fsx/intellisense.fsx"
#if !FAKE
#r "netstandard"
#r "Facades/netstandard" // https://github.com/ionide/ionide-vscode-fsharp/issues/839#issuecomment-396296095
#endif
open System
open Fake.Core
open Fake.Core.TargetOperators
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.IO.FileSystemOperators
open Fake.JavaScript
Target.create "CleanDev" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
++ "dist"
++ ".fable"
|> Shell.cleanDirs
)
Target.create "Clean" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
++ "dist"
++ ".fable"
|> Shell.cleanDirs
Target.run 1 "KillZombies" []
)
Target.create "CleanFableJS" <| fun _ ->
!! (__SOURCE_DIRECTORY__ @@ "src/**/*.fs.js")
|> Seq.toList
|> File.deleteAll
Target.create "CleanNode" <| fun _ ->
Shell.cleanDir (__SOURCE_DIRECTORY__ @@ "node_modules")
File.delete (__SOURCE_DIRECTORY__ @@ "package-lock.json")
Target.create "DotnetRestore" (fun _ ->
DotNet.restore
(DotNet.Options.withWorkingDirectory __SOURCE_DIRECTORY__)
"issie.sln"
)
Target.create "NpmInstall" (fun _ ->
Npm.install id
)
Target.create "Build" (fun _ ->
Npm.run "compile" id
)
Target.create "Dev" (fun _ ->
Npm.run "dev" id
)
Target.create "Dist" (fun _ ->
Npm.run "dist" id
)
Target.create "DistDir" (fun _ ->
Npm.run "dist:dir" id
)
Target.create "KillZombies" <| fun _ ->
Fake.Core.Process.killAllByName "issie.exe"
Fake.Core.Process.killAllByName "node"
Fake.Core.Process.killAllByName "dotnet"
// Build order
"CleanFableJS"
==> "Clean"
"CleanFableJS"
==> "CleanDev"
"CleanDev"
==> "DotnetRestore"
==> "NpmInstall"
==> "Build"
"NpmInstall"
==> "Dev"
"NpmInstall"
==> "Dist"
"NpmInstall"
==> "DistDir"
"CleanFableJS"
==> "dev"
// start build
Target.runOrDefaultWithArguments "Dev"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化