使用NAnt脚本进行ScriptSharp编译 [英] ScriptSharp compilation with NAnt script

查看:104
本文介绍了使用NAnt脚本进行ScriptSharp编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近在我们的项目中添加了出色的脚本#.当前,我们拥有它,以便我们的VS构建仅将已编译的.js文件从输出目录复制到Web应用程序的scripts目录中.

We've recently added the excellent script# to our project. Currently we have it so that our VS build simply copies the compiled .js file from the output directory to the scripts directory of our web app.

我们已经决定使其成为永久性功能,因此希望使其成为.js文件作为Web构建NAnt脚本的一部分来生成,以确保其始终是最新的.有什么方法可以很好地做到这一点,还是需要从我的NAnt脚本中调用MSBuild并指定.csproj文件来运行编译?

We've decided to make it a permanent feature and so would like to make it so that the .js file gets generated as part of our web build NAnt script to ensure that it's always up to date. Is there any way to do this nicely or do I need to call MSBuild from my NAnt script specifying the .csproj file to run the compilation?

谢谢

斯图

推荐答案

这不可能是完整的答案(如果我没有NAnt的经验),但我还是会提供它,因为它可能会有所帮助.

This isn't likely the full answer (given I don't have experience with NAnt), but I'll offer it anyway, as it may help.

脚本#csproj与依赖于msbuild的任何其他csproj非常相似.如果您有某种方法可以将其他msbuild项目集成到NAnt构建脚本中,则理想情况下,同一模型也应适用于script#项目.

A script# csproj is very much like any other csproj relying on msbuild. If you've got some way to integrate other msbuild projects into your NAnt build script, the same model should ideally apply to script# projects as well.

在github存储库中的script#版本中,Web项目可以添加对script#项目的引用(从而变得依赖于script#项目),并包含msbuild部署任务,该任务将复制从已构建的script#项目到Web项目的脚本.您可以在Todo示例( https://github.com/nikhilk/scriptsharp/tree/cc/samples/Todo )

In the version of script# that is in the github repository, a web project can add a reference to a script# project (thereby becoming dependent on the script# project), and include an msbuild deploy task, that will copy over scripts from the built script# project into the web project. You can see this in action in the Todo sample (https://github.com/nikhilk/scriptsharp/tree/cc/samples/Todo)

这篇关于使用NAnt脚本进行ScriptSharp编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆