简体   繁体   English

如何使用sharpsvn正确生成复杂的外部结构?

[英]How to correctly generate a complex externals structure with sharpsvn?

I have a very convoluted repository structure using subversion. 我使用subversion有一个非常复杂的存储库结构。 Much of this has to do with the limitations of my team, security requirements, and the dependencies of the project. 其中很大一部分与我的团队的局限性,安全性要求以及项目的依赖性有关。 The structure used here is not optional as a consequence and cannot be altered. 这里使用的结构因此不是可选的,不能改变。

The repository structure consists of the following pattern: 存储库结构包含以下模式:

root-|- main -|- branches
     |        |- tags
     |        |- trunk - main - plugins
     |
     |- modules -| - module1 -|- branches
                 |            |- tags
                 |            |- trunk - module1 - plugins - plugin1
                 |            |- modules - ...
                 |
                 | - module2 -|- branches
                 |            |- tags
                 |            |- trunk - module2 - plugins - plugin2
                 |            |- modules - ...

The source of each external is a pluginX folder. 每个外部的源是一个pluginX文件夹。 The target is the plugins folder of the trunk one level lower (or the plugins folder of main). 目标是低一级的主干的插件文件夹(或主要的插件文件夹)。 The documentation of the API is nigh non-existent unfortunately. 遗憾的是,API的文档几乎不存在。 I'm suspecting I need to the propset function somehow but how to point to the specific target directory and source directories is not described anywhere I've been able to find nor have I found any examples. 我怀疑我需要以某种方式使用propset函数但是如何指向特定的目标目录和源目录没有在我能够找到的任何地方描述,也没有找到任何示例。

Edit: Each module may be pulled separately and worked on independent of the root project. 编辑:每个模块可以单独拉出并独立于根项目进行处理。 I cannot just use the root for this. 我不能只为此使用root。 Hell, I can't even get a hostile response to this question!! 天啊,我甚至无法对这个问题做出恶意回应!!

create a folder build in 'root' folder and use relative path to reference projects in your solutions, then configure all projects of their output folder to build\\xxx folder , all output folders are relative path too. 在'root'文件夹中创建文件夹build并使用relative path引用解决方案中的项目,然后将其output folder所有项目配置为build\\xxx folder ,所有输出文件夹也是relative path and in main program, configure assembly bindings with relative path again. 在主程序中,再次使用相对路径配置程序集绑定 with this pattern, no matter who download repo, they could compile projects to same root folder, and debug with same configure. 使用这种模式,无论谁下载repo,他们都可以将项目编译到相同的根文件夹,并使用相同的configure进行调试。

For very complex dependencies, like A=>B=>C=>D, the first time to open solution A, if B/C/D is not compiled and not referenced, then A will show a reference warning, you have to open and compile B&C&D, then A will work. 对于非常复杂的依赖,例如A => B => C => D,第一次打开解决方案A,如果B / C / D未编译且未引用,则A将显示参考警告,您必须打开并编译B&C&D,然后A将工作。 but usually, we should add B/C/D to solution A, so, there is no more error at the first time we open it. 但通常情况下,我们应该将B / C / D添加到解决方案A中,因此,在我们第一次打开它时不会再出现错误。

Sometimes, some source code is not open for all developers, so they can only get a compiled dlls, for those dlls, we need another folder (like 'tools'), which include all compiled assemblies in Source code server. 有时候,某些源代码并不是针对所有开发人员开放的,所以他们只能获得一个已编译的dll,对于那些dll,我们需要另一个文件夹(如“工具”),其中包括源代码服务器中的所有已编译程序集。 we add file references with relative path in our solutions, and configure them as "Copy to local"=true 我们在解决方案中添加带有relative path file references ,并将它们配置为"Copy to local"=true

for many of project, we will use post-build or pre-build event to load or copy file from or to somewhere, all of them must be relative path too. 对于许多项目,我们将使用post-build或pre-build事件从某个地方加载或复制文件,所有这些都必须是相对路径。

Answering my own question. 回答我自己的问题。 The library I'm using has a function that sets the externals for a given folder in the local system given an absolute path to that folder. 我正在使用的库有一个函数,在给定该文件夹的绝对路径的情况下,为本地系统中的给定文件夹设置外部。 The library is a port from the C version of the library and apparently the authors just assumed that people would "just know" to look there. 该库是图书馆C版本的一个端口,显然作者只是假设人们“只知道”在那里看。

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

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