I experimented with different approaches to auto-prepend the root-projectname to any subproject name.
Let me show what I have: a project / directory called “myProj”
/build.gradle
/settings.gradle
/module1/…
/module2/…
with settings.gradle
containing
include 'module1'
include 'module2'
or
include ':module1'
include ':module2'
What happens:
- the default behaviour is: the rootProjectname is the same as it’s directory is named, unless you specify the name in settings.gradle
rootProject.name = 'myProj'
- The modules are called as their directories, unless you specify a different name in
/settings.gradle
perproject(':module1').name = 'differentMod1Name'
- all artifacts are typically called as their project / subproject are named
What I want to archive:
- any subproject is still settled in a directory just called “moduleXY”
- their name should auto-prepend by the name of the rootProject
i.e. in this example above:
I expect to get artifacts for myProj-moduleXY
yes, I can define it line by line for each subproject, but this is not the point neither practical if there are lots of
another use-case that have some charms to get it dynamically would be: someone forks of the project but just renames the rootProject, he should just be forced to change one line
Any ideas?! Or it is just impossible?!
Thanks for your input
~Marcel