【发布时间】:2013-03-12 18:16:19
【问题描述】:
我在 Jenkins 中出现以下错误(指磁盘上的路径,下面的每个实例可能不同,并且不一定与所有其他实例相同)
The command "tsc "C:\<path>\shared.editpage-default.ts" "C:\<path>\shared.editpage-editenabled.ts" "C:\<path>\shared.filters.ts" "C:\<path>\perfect.common.interfaces.d.ts" "C:\<path>\perfect.hide-and-seek.ts" "C:\<path>\perfect.domutils.ts" "C:\<path>\jquery.validation.d.ts" "C:\<path>\perfect.pagination.ts" "C:\<path>\perfect.sorting.ts" "C:\<path>\jquery.d.ts" "C:\<path>\perfect.langchange.ts" "C:\<path>\perfect.switchbox.ts" "C:\<path>\perfect.validation.ts"" exited with code 9009.
c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847,9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\<path>\<proj>.csproj]
现在,问题是这样的。我们的项目文件中有一个部分用于构建我们的 TypeScript 文件并在每次保存 TypeScript 文件时创建 .js 文件。这是部分:
<Target Name="BeforeBuild">
<Message Text="Compiling TypeScript files" />
<Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" />
<Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'"%(fullpath)"', ' ')" IgnoreExitCode="true" />
</Target>
这一切在本地运行良好,但在 Jenkins 中失败,因为 Jenkins 服务器没有安装 TypeScript。问题是我实际上不需要在 Jenkins 上执行 TypeScript 命令,因为正如我所说,生成的 .js 文件是在保存时构建和创建的,我们将它们签入。所以有三个选项。
- 在构建服务器上安装 TypeSctipt。
- 更改项目文件中的命令,使其只执行
<Exec Command="tsc ...,如果我们在配置中是Debug。 - 将我的构建脚本更改为不构建 TypeScript 文件。
这是我尝试过的。
- 我想我会尝试在构建服务器上安装 TypeScript,但该服务器是旧的 Windows Server 2003 机器,当我尝试在其上安装 TypeScript 0.8.3 时出现以下错误。所以,我在机器上安装了最新的 Windows 更新,然后重新启动并重新运行 TypeScript 安装,得到了同样的错误。
至于选项 2 和 3。
我认为 2 将是最简单的一个,尽管我只是不知道我必须使用的 if 语句,我必须使用它来构建 Debug 配置。如果这是解决方案,请告诉我命令。
我认为选项 3 可能相当困难。
请提出一些建议。
【问题讨论】:
-
职业培训中心。这真的很本地化。也许在 Jenkins 用户论坛上会更好?
标签: visual-studio-2012 msbuild jenkins typescript