我对.NET流程自动化有一些疑问。我的想法是将Nant用作Jenkins CI服务器的构建自动化工具。詹金斯(Jenkins)在Debian Linux上的Tomcat中运行。

在我的项目中,我有一些依赖性,例如实体框架。依赖项在我们自己的Nuget服务器中进行管理。我还需要版本控制的好处,因为并非所有子项目都可以使用最新的库版本。

问题 : 我如何从Nant的Nuget Server获得第三方依赖性以运行编译?

我知道Nuget有一个自定义的Nant任务,但我可以找到任何 文档如何使用此任务.

感谢您的建议。

有帮助吗?

解决方案

即使没有文档,您也可以检查Nant扩展名的源代码。只要您熟悉C#,您就会发现代码是自称的。

如果您问 nuget-update, ,从来源您可以看到:

[TaskName("nuget-update")]
public class NugetUpdateTask : Task
{
    [TaskAttribute("solution-dir", Required = true)]
    public DirectoryInfo SolutionDir { get; set; }

    [TaskAttribute("repository", Required = false)]
    public DirectoryInfo RepositoryPath { get; set; }
    //...

用法将是:

<nuget-update solution-dir="file:///your/solution/dir" repository="file:///your-repository" />

您可能已经注意到了, solution-dir 需要,但是 repository 不是。

相同 nuget-get-files.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top