网站搜索

我如何在 Linux 上使用 Mono 的 xbuild 来构建 TypeScript 项目?


我正在 Windows 上使用 Visual Studio 开发这个项目,但在我添加一些需要用 TypeScript 构建的文件之前,我在 Linux 上用 xbuild 编译它时没有遇到任何问题。具体来说,一组 .ts 文件被编译生成 app.js,然后作为嵌入资源包含。这个构建在 VS 中可以正常工作,但用 xbuild 时我得到这个错误:

xbuild Guncho.sln
XBuild Engine Version 12.0
Mono, Version 3.10.0.0
Copyright (C) 2005-2013 Various Mono authors

Build started 12/23/2014 13:00:53.
__________________________________________________
Project "/home/guncho/test-guncho/Guncho.sln" (default target(s)):
        Target ValidateSolutionConfiguration:
                Building solution configuration "Debug|Any CPU".
        Target Build:
                Project "/home/guncho/test-guncho/Guncho.Site/Guncho.Site.csproj" (default target(s)):
                        Target PrepareForBuild:
                                Configuration: Debug Platform: AnyCPU
                        Target CopyNonResxEmbeddedResources:
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: error : Cannot copy /home/guncho/test-guncho/Guncho.Site/app/app.js to /home/guncho/test-guncho/Guncho.Site/obj/Debug/Guncho.Site.app.app.js, as the source file doesn't exist.
/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: error : Cannot copy /home/guncho/test-guncho/Guncho.Site/app/app.js.map to /home/guncho/test-guncho/Guncho.Site/obj/Debug/Guncho.Site.app.app.js.map, as the source file doesn't exist.
                        Task "Copy" execution -- FAILED
                        Done building target "CopyNonResxEmbeddedResources" in project "/home/guncho/test-guncho/Guncho.Site/Guncho.Site.csproj".-- FAILED
                Done building project "/home/guncho/test-guncho/Guncho.Site/Guncho.Site.csproj".-- FAILED
        Task "MSBuild" execution -- FAILED
        Done building target "Build" in project "/home/guncho/test-guncho/Guncho.sln".-- FAILED
Done building project "/home/guncho/test-guncho/Guncho.sln".-- FAILED

Build FAILED.

它甚至没有尝试 TypescriptCompile 步骤。如果我手动运行 tsc 生成 app.js,构建是可以工作的,但我需要做什么才能让它自动工作?