Skip to content

Commit

Permalink
Return early if a Jar is not modified and all checks are disabled (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjohannes authored Jan 29, 2025
1 parent 8ea18cb commit acfd46e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ public void transform(TransformOutputs outputs) {
if (willBeMerged(originalJar, moduleSpecs.values())) { // No output if this Jar will be merged
return;
}

// We return the original Jar without further analysis, if there is
// (1) no spec (2) no auto-module check (3) no missing module-info check (4) no auto-name derivation
if (moduleSpec == null
&& !getParameters().getFailOnAutomaticModules().get()
&& !getParameters().getFailOnMissingModuleInfo().get()
&& !getParameters().getDeriveAutomaticModuleNamesFromFileNames().get()) {
outputs.file(originalJar);
return;
}

boolean realModule = isModule(originalJar);
if (moduleSpec instanceof ModuleInfo) {
if (realModule && !((ModuleInfo) moduleSpec).patchRealModule) {
Expand Down

0 comments on commit acfd46e

Please sign in to comment.