代码拉取完成,页面将自动刷新
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open System.IO
open Fake.Testing
let buildDir = "" // using the defaults build output
let appReferences = !! "./*.sln" // still building from the solution
let deployDir = "./BuildArtefacts/"
let testDir = "./NAudioTests/bin/Debug/"
let testDlls = !! (testDir + "*Tests.dll")
let buildLogo = """ _ _ _ _ _
| \ | | / \ _ _ __| (_) ___
| \| | / _ \| | | |/ _` | |/ _ \
| |\ |/ ___ \ |_| | (_| | | (_) |
|_| \_/_/ \_\__,_|\__,_|_|\___/
"""
traceHeader buildLogo
Target "DebugBuild" (fun _ ->
MSBuildDebug buildDir "Build" appReferences
|> ignore //Log "Build output: "
)
Target "ReleaseBuild" (fun _ ->
MSBuildRelease buildDir "Build" appReferences
|> Log "Build output: "
)
Target "Test" (fun _ ->
trace "Running unit tests"
testDlls
|> NUnit3 (fun p ->
{p with
Where = "cat != IntegrationTest";
ShadowCopy = true;
ResultSpecs = [testDir + "TestResults.xml"]})
)
Target "Clean" (fun _ ->
trace "Cleaning up"
MSBuildDebug buildDir "Clean" appReferences
|> Log "Debug clean: "
MSBuildRelease buildDir "Clean" appReferences
|> Log "Release clean: "
CleanDirs [deployDir]
)
Target "NuGet" (fun _ ->
(*NuGetDefaults()
|> sprintf "%A"
|> trace*)
NuGet (fun p ->
{p with
(*Authors = authors
Project = projectName
Description = projectDescription
Summary = projectSummary
WorkingDir = packagingDir
AccessKey = myAccesskey*)
Version = "1.9.0" // todo get the version number from elsewhere
WorkingDir = "."
OutputPath = deployDir
Publish = false })
"NAudio.nuspec"
)
Target "Release" DoNothing
Target "ZipAll" DoNothing
// a bit hacky, but persuading CreateZipOfIncludes to create the directory structure we want
let demoIncludes =
!! "**"
-- "**/*.pdb"
-- "*.vshost.*"
-- "*nunit*"
let demoApps = ["AudioFileInspector"; "NAudioDemo"; "NAudioWpfDemo"]
let demoFiles =
demoApps
|> Seq.map (fun a -> a, Path.GetFullPath (sprintf "./%s/bin/Debug" a))
|> Seq.map (fun (a,b) -> a, { demoIncludes with BaseDirectory = b })
|> List.ofSeq
Target "ZipDemo" (fun _ ->
CreateZipOfIncludes (deployDir + "NAudio-Demos.zip") "" DefaultZipLevel demoFiles
)
Target "ZipSource" (fun _ ->
let errorCode = Shell.Exec( "git","archive --format zip --output " + deployDir + "NAudio-Source.zip master", ".")
()
)
// Create a zip release library
Target "ZipLib" (fun _ ->
let zipFiles = [@".\NAudio\bin\Release\NAudio.dll";
@".\NAudio\bin\Release\NAudio.xml";
"license.txt";
"readme.txt"
]
let flatten = true
let comment = ""
let workingDir = "."
CreateZip workingDir (deployDir + "NAudio-Release.zip") comment DefaultZipLevel flatten zipFiles
)
"Clean"
==> "DebugBuild"
==> "Test"
?=> "ReleaseBuild"
==> "Release"
"ZipDemo" ==> "ZipAll"
"ZipLib" ==> "ZipAll"
"ZipSource" ==> "ZipAll"
"ReleaseBuild" ==> "ZipLib"
RunTargetOrDefault "Test"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。