我在FAKE
下的OSX上使用mono
构建工具作为构建链的一部分。
所有工具链均已使用homebrew
安装。
部分构建是在nuget
包中捆绑发布工件 - 这是在CreatePackage
构建文件的build.fsx
目标中处理的。
正在从包装器bash
脚本运行构建文件,如下所示:
#!/usr/bin/env bash
export EnableNuGetPackageRestore=true
nuget "Install" "FAKE" "-OutputDirectory" "./build/packages" “-ExcludeVersion"
nuget "Install" "FSharp.Data" "-OutputDirectory" "./build/packages" "-ExcludeVersion"
mono "./build/packages/FAKE/tools/Fake.exe" build.fsx "$1"
当我最初运行时,我收到以下错误:
Cannot open assembly '***/tools/NuGet/NuGet.exe': No such file or directory.
我尝试修复此问题只是创建预期的目录结构,并从nuget.exe
安装目录复制brew
程序集。
此时运行构建然后会出现以下错误:
System.Exception: Error during NuGet package creation. ***/tools/NuGet/nuget.exe pack -Version 1.0.0 -OutputDirect
Method 'String.Format' not found.
为了完整性,我的build.fsx
构建文件的CreatePackage目标如下(截断):
Target "CreatePackage" (fun _ ->
projectName
|> sprintf "%s.nuspec"
|> NuGet (fun p ->
{p with
Authors = authors
Project = packageName
Description = projectDescription
OutputPath = deployDir
WorkingDir = root
Version = version
Dependencies = dependenciesWithVersion
Files = [(@"build/tmp/**", Some "lib", None)
(@"MyProject/dsc/modules/**/*", Some "dsc", None)
(@"MyProject/dsc/manifests/*", Some "dsc", None)
(@"MyProject/Install/*", Some "tools", None)]
Publish = false })
)