摇篮:如何配置多安装有侧并排项目 [英] Gradle: How to configure multiproject setup with side-by-side projects

查看:121
本文介绍了摇篮:如何配置多安装有侧并排项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个建立这样一个老项目:

We have an old project that is set up like this:

.
├── customizationProject
│   ├── ejb
│   └── services
├── projectA
│   ├── ejb
│   └── shared
├── projectB
│   └── ejb
└── projectC
    ├── ejb
    └── services

的想法是,在customizationProject是其中递送的应用程序的最终组装happends,可能实际上是多个 customizationProjects 以及它们可能包括多个配置。也就是说,然而不是我tyring要解决的问题。

The idea is that the customizationProject is where the final assembly of the delivered application happends, there might in fact be multiple customizationProjects and they might include multiple configurations. That, however is not the problem I'm tyring to solve.

我想使customizationProject的项目的gradle的逻辑根项目。
如何配置个别项目,让他们
一)知道他们是一个多构建的一部分
B)可以正确执行,具有不同的范围,例如只是运行一个子项目的测试,同时也允许的所有的测试被翻过所有项目执行的?

I want to make the customizationProject the logical root project of the gradle projects. How do I configure the individual projects, so that they a) know they're part of a multiproject build b) can be properly executed, with different scopes, e.g. just running the tests of one subproject, while also allowing all tests to be executed accross all the projects?

推荐答案

这是一个相当简单的结构摇篮支持。一个settings.gradle文件添加到您customizationProject目录与此内容:

This is a fairly easy structure to support with Gradle. Add a settings.gradle file to your customizationProject directory with this content:

includeFlat 'projectA', 'projectB', 'projectC'

和可以确认在命令行项目结构:

And you can confirm the project structure from the command line:

$ gradle projects
:projects

------------------------------------------------------------
Root Project
------------------------------------------------------------

Root project 'customizationProject'
+--- Project ':projectA'
+--- Project ':projectB'
\--- Project ':projectC'

在includeFlat方法的描述是在<一个可用href=\"http://gradle.org/current/docs/dsl/org.gradle.api.initialization.Settings.html#org.gradle.api.initialization.Settings%3aincludeFlat%28java.lang.String%5b%5d%29\">Gradle文档。

希望帮助!

这篇关于摇篮:如何配置多安装有侧并排项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆