关于TeamCity的几个问题

发布于 2024-09-19 16:48:34 字数 687 浏览 4 评论 0原文

我想为一个大项目安装 CI 服务器已经有一段时间了,但是没有时间,而且我上面的人也不太关心它,他们只是说“这很有趣,它可以拯救我们”有一段时间”,但从未为此做过任何事情...

我已经有一些使用 CC.NET 的经验,但只是在小型项目中,并且是为了学习它的基础知识。最近闲暇时间多了,所以决定尝试一下TeamCity,并将其用于大项目。

然而,在处理引用时,我遇到了两个问题:

1)在处理多个项目时,我尽量不要制作包含所有项目的大型解决方案(加上并不总是可能的),因为我也使用 SVN,我使用指向其他项目的已编译程序集的相对路径(例如:...\Library A\trunk\Library\bin\release\LibraryA.dll)。它对我和参与该项目的同事来说一直运行良好,但我很难让 TC 项目拾取它,我应该如何设置我的依赖项?

2)其中一个库是由另一家公司制作的,并且与他们共享SVN存储库。他们最近必须添加对 Oracle DB 的访问,并且使用 Oracle Data Provider,该数据提供程序似乎与在 GAC 中注册的程序集一起使用,但在构建解决方案时,它会输出另一个类似的程序集,但具有不同的程序集版本(如果我错了,请纠正我,我一直使用内置的 Oracle 提供程序,因为它已经足够了)。在我的公司方面,我们使用“输出程序集”,项目编译并正常工作,但我们之前必须更改引用,并且无法修改存储库中的项目文件,是否有任何解决方法为了这?

感谢您的回复。

I've wanted to install a CI server for a big project for quite some time, but didn't have the time needed, nor the people above me cared too much about it, they just said "that's interesting, and it could save us some time" but never made anything for it...

I alreayd had some experience with CC.NET, but just in small projects, and for the sake of learning the basics of it. Lately had a bit more of spare time, so decided to give TeamCity a try, and set it for the big project.

There are, however, two problems popping out at me when dealing with references:

1) When working with multiple projects, I try not to make big solutions containing all of them (plus is not always possible), since I also work with SVN, I use the relative paths that point to the compiled assemblies from the other projects (eg.: ....\Library A\trunk\Library\bin\release\LibraryA.dll). It has always worked well for me and the co-workers that have participated in the project, but I'm having difficulties to make the TC project to pick it up, how should I set up my dependencies?

2) One of the libraries is made by another company, and the SVN repository is shared with them. They recently had to add access to an Oracle DB, and they work with the Oracle Data Provider, which seems to work with an assembly registered in the GAC, but when building the solution, it outputs another similar assembly but with a different assembly version (correct me if I'm wrong, I've always worked with the built-in Oracle provider since it was more than enough). At my company side, we work with that "output assembly", and the project compiles and works fine, but we previously have to change the reference, and modifying the project file in the repository would not be possible, is there any work-around for this?

Thanks for your replies.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

紫竹語嫣☆ 2024-09-26 16:48:34

对于1),您可以使用Svn externals 来获取程序集和其他依赖项当您的项目是由 TC 构建时,可以从其他项目中获取。

您还可以设置 TC 来检测外部更改并使用最新版本构建项目,或者您可以将 TC 项目链接在一起,以便它们按顺序构建。

我花了很多时间在我们的地方安装并运行 CI 服务器,它确实得到了回报。虽然仍然需要一些时间来让事情顺利进行,但我会认真建议你启动并运行一些东西。

抱歉无法帮助您解决 2)。

For 1) you can use Svn externals to grab assemblies and other dependencies from other projects when your project is built by TC.

You can also set TC to detect when externals have changed and build the project with the latest versions, or you can chain TC projects together so they build in sequence.

I've put alot of time into getting a CI server up and running at our place and it has really paid off. It still takes a bit of time to keep things ticking over but would seriously recommend you get something up and running.

Sorry can't help you with 2).

溺渁∝ 2024-09-26 16:48:34

对于 1),您可以为项目设置 ReferencePath 并指向包含已编译程序集的目录。

在我们的 TC 配置中,我们将所有 TeamCity 依赖项加载到名为“依赖项”的子目录中,并将编译器的 ReferencePath 设置为此目录。

使用 MSBuild Runner,这非常简单:

在构建的 den .proj 中,您需要定义一个属性(我们称之为 ReferencePath

<PropertyGroup>
    <ReferencePath>$(MSBuildProjectDirectory)\Dependencies\</ReferencePath>
</PropertyGroup>

,然后用它调用 MSBuild 任务:

<MSBuild Projects="$(ProjectFiles)" Properties="Configuration=Release;ReferencePath=$(ReferencePath)" Targets="Rebuild" />

@(ProjectFiles) 是一个简单的 ItemGroup,它收集所有 .csproj 文件。

<ItemGroup>
    <ProjectFiles Include="$(MSBuildProjectDirectory)\**\*.csproj" />
</ItemGroup>

For 1) You could set the ReferencePath for the Projects and point to the Directories with the compiled Assemblies.

In our TC Configuration we load all TeamCity Dependencies to a SubDirectory called "Dependencies" and set the ReferencePath for the Compiler to this Directory.

With the MSBuild Runner this is very easy:

In den .proj for the Build you need to define a Property (we call it ReferencePath)

<PropertyGroup>
    <ReferencePath>$(MSBuildProjectDirectory)\Dependencies\</ReferencePath>
</PropertyGroup>

And then call the MSBuild Task with it:

<MSBuild Projects="$(ProjectFiles)" Properties="Configuration=Release;ReferencePath=$(ReferencePath)" Targets="Rebuild" />

@(ProjectFiles) is a simple ItemGroup that collects all .csproj-Files.

<ItemGroup>
    <ProjectFiles Include="$(MSBuildProjectDirectory)\**\*.csproj" />
</ItemGroup>
能怎样 2024-09-26 16:48:34

通过修改引用属性并将其设置为不查找特定版本解决了#2。另一家公司似乎已经接受了。

仍然没有时间检查 #1 的 VCS Checkout 规则。

Solved #2 by modifying the reference properties and setting it not to look for the specific version. The other company seems to have accepted it.

Still haven't had the time check the VCS Checkout rules for #1.

朕就是辣么酷 2024-09-26 16:48:34

感谢大家的回复,学到了一些新东西。

昨天可以多玩一点 TC,了解更多有关 VCS 检查规则的信息,并发现,#1 可以通过工件轻松解决(用这个名字我一开始并没有意识到它们是什么),所以我使用到目前为止,我的项目构建没有任何问题。

你们对这种方法有何看法?这些库给我带来了同一项目的“核心”库的问题,所以我也已经为它们设置了一个项目。

Thanks for all the replies, learnt a couple new things.

Yesterday could play a bit more with TC, learnt more about VCS checkout rules, and found out, that #1 can be easily solved with artifacts (with that name I didn't realize at first what they were), so I'm using that and my projects are built with no problems so far.

What do you people think about this approach? The libraries giving me problems where "core" libraries of the same project, so I already had set a project for them as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文