简体   繁体   English

如何创建依赖于“目标项目”的包的包?

[英]How do I create a package that depends on a package that “targets projects”?

I am trying to create a chocolatey package. 我正在尝试创建一个巧克力包。 I initially created a version that did not have any dependencies and I simply put an exe file in the tools/bin directory and then made a simple nuspec file, and this correctly would install the exe file to the path, which is all I need for this internal tool. 我最初创建了一个没有任何依赖项的版本,我只是将一个exe文件放在tools / bin目录中,然后创建一个简单的nuspec文件,这正确地将exe文件安装到路径中,这就是我需要的所有内容这个内部工具。

However, the project has now been restructured so that it depends on an external dependency. 但是,该项目现在已经过重组,因此它依赖于外部依赖性。 The dependency is a nuget package which is in the same repository as the main project. 依赖项是一个nuget包,它与主项目位于同一个存储库中。 To add the dependency, I added it to the dependencies section. 要添加依赖项,我将其添加到依赖项部分。 The project itself in Visual Studio is also dependent on the same. Visual Studio中的项目本身也依赖于它。 Here is my nuspec file: (I removed some data, marked by rm, but it should not affect it. Everything else is the same) 这是我的nuspec文件:(我删除了一些数据,标记为rm,但它不应该影响它。其他一切都是一样的)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesnt appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
   <metadata>
      <!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
      <id>lisp-translator</id>
      <title>lisp-translator (Install)</title>
      <version>0.1.0</version>
      <authors>rm</authors>
      <owners>rm</owners>
      <summary>rm</summary>
      <description>rm</description>
      <projectUrl>rm</projectUrl>
      <tags>lisp-translator admin</tags>
      <copyright />
      <licenseUrl>rm</licenseUrl>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <!--<iconUrl>http://cdn.rawgit.com/__REPLACE_YOUR_REPO__/master/icons/lisp-translator.png</iconUrl>-->
      <dependencies>
         <dependency id="LispParsingLibrary" version="1.1.0.17190" />
      </dependencies>
      <releaseNotes />
   </metadata>
</package>

However, when I try to install it, I get a rather esoteric error: 但是,当我尝试安装它时,我得到一个相当深奥的错误:

lisp-translator not installed. An error occurred during installation:
 External packages cannot depend on packages that target projects.
The install of lisp-translator was NOT successful.
lisp-translator not installed. An error occurred during installation:
 External packages cannot depend on packages that target projects.

Chocolatey installed 0/1 package(s). 1 package(s) failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures:
 - lisp-translator

What am I doing wrong regarding adding of this dependency? 关于添加这种依赖,我做错了什么?

That's a really old, dumb nuget packaging issue. 这是一个非常古老,愚蠢的nuget包装问题。 The package LispParsingLibrary has a folder called "content" in it. 包LispParsingLibrary中有一个名为“content”的文件夹。 Which means that your package also would need a content folder in it. 这意味着您的包也需要一个内容文件夹。

We don't recommend that at all. 我们根本不建议这样做。 Please ask the maintainer of the LispParsingLibrary to remove that folder or create it on install and copy files into it. 请要求LispParsingLibrary的维护者删除该文件夹或在安装时创建它并将文件复制到其中。

I thought we had an issue filed to track this, but I added https://github.com/chocolatey/choco/issues/290 我认为我们有一个问题要跟踪这个,但我添加了https://github.com/chocolatey/choco/issues/290

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM