Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
152 views
Welcome To Ask or Share your Answers For Others

1 Answer

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'

The description of the includeFlat method is available in the Gradle documentation.

Hope that helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...