zyxist / chainsaw

Gradle plugin: adds support for building Java 9 modules.
Apache License 2.0
70 stars 4 forks source link

Don't do anything, if there is no src/main/java directory #11

Closed zyxist closed 6 years ago

zyxist commented 6 years ago

In a multi-project setup, root project usually does not have /src/main/java directory - the sources are in the subprojects. However, the new module name detector fails, if it does not find module-info.java descriptor.

There is a workaround for that:

javaModule.name = ''

It is a bit ugly. Generally, if there is no directory with the sources, we should skip parsing module-info.java at all.

Vampire commented 6 years ago

You could also mix module-enabled projects and non-module-enabled projects (auto-modules). So you should probably not depend on whether the source directory is present, but whether there is a module-info.java? And also there could be multiple source sets, so you shouldn't only pimp the main source set, but also the other source sets?

Vampire commented 6 years ago

Yep, I just hit having a non-module-enabled project and your plugin chickens out