如何使用Java在TFS中修改构建定义?

时间:2020-12-14 03:03:13

I am using Eclipse with the Team Foundation Server plug-in (2010) to create Java code to be stored in TFS. I have successfully created a build definition using the wizard and an ANT build.xml file. However, I would like to modify the build definition to include the ability to set the build quality on successful build so that TFS Deployer will pick up the files and deploy them.

我正在使用Eclipse和Team Foundation Server插件(2010)来创建要存储在TFS中的Java代码。我已使用向导和ANT build.xml文件成功创建了构建定义。但是,我想修改构建定义以包括在成功构建时设置构建质量的功能,以便TFS Deployer将获取文件并进行部署。

I have found a number of articles on how to create a new build definition from one of the OOB ones, but they all rely on the Visual Studio build processing which has a "process" tab in the New Build Definition wizard. Java builds do not have the "process" tab, they have a "project" tab. I also understand that this project tab uses the upgrade template.

我发现了一些关于如何从其中一个OOB创建新构建定义的文章,但它们都依赖于Visual Studio构建处理,它在New Build Definition向导中有一个“process”选项卡。 Java构建没有“进程”选项卡,它们有一个“项目”选项卡。我也明白这个项目标签使用升级模板。

How would I modify my processing so that I can set the build quality? Should this be done in the TFSBuld.proj file, by somehow modifying the build template, or maybe even in the ANT build script?

如何修改我的处理以便设置构建质量?这应该在TFSBuld.proj文件中完成,通过某种方式修改构建模板,甚至可能在ANT构建脚本中?

1 个解决方案

#1


0  

I'm afraid that you cannot modify the XAML process that the build definition uses from Eclipse. However - you could modify the build definition from Visual Studio to use a modified UpgradeTemplate if you wanted to set the build quality in the process template XAML.

我担心你无法修改构建定义从Eclipse使用的XAML进程。但是 - 如果要在流程模板XAML中设置构建质量,则可以从Visual Studio修改构建定义以使用已修改的UpgradeTemplate。

Alternatively, you could modify the TFSBuild.proj file associated with the build and get it to set the build quality by adding a target similar to this:

或者,您可以修改与构建关联的TFSBuild.proj文件,并通过添加类似于此的目标来设置构建质量:

<Target Name="AfterDropBuild">
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)" 
                        Quality="Ready for Deployment" />
</Target>

#1


0  

I'm afraid that you cannot modify the XAML process that the build definition uses from Eclipse. However - you could modify the build definition from Visual Studio to use a modified UpgradeTemplate if you wanted to set the build quality in the process template XAML.

我担心你无法修改构建定义从Eclipse使用的XAML进程。但是 - 如果要在流程模板XAML中设置构建质量,则可以从Visual Studio修改构建定义以使用已修改的UpgradeTemplate。

Alternatively, you could modify the TFSBuild.proj file associated with the build and get it to set the build quality by adding a target similar to this:

或者,您可以修改与构建关联的TFSBuild.proj文件,并通过添加类似于此的目标来设置构建质量:

<Target Name="AfterDropBuild">
    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)" 
                        Quality="Ready for Deployment" />
</Target>