Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/java/org/gradlex/javamodule/moduleinfo/ModuleInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class ModuleInfo extends ModuleSpec {
final Set<String> requiresStaticTransitive = new LinkedHashSet<>();
final Map<String, Set<String>> ignoreServiceProviders = new LinkedHashMap<>();
final Set<String> uses = new LinkedHashSet<>();
final Map<String, Set<String>> providers = new LinkedHashMap<>();

boolean exportAllPackages;
boolean requireAllDefinedDependencies;
Expand Down Expand Up @@ -92,6 +93,22 @@ public void requiresStaticTransitive(String requiresStaticTransitive) {
addOrThrow(this.requiresStaticTransitive, requiresStaticTransitive);
}

/**
* @param provides corresponds to the directive in a 'module-info.java' file
* @param with specifys the package(s) containing provided service classes
*/
public void provides(String provides, String... with) {
addOrThrow(this.providers, provides, with);
}

/**
* Getter for the providers map (needed for the transformation logic)
* @return
*/
public Map<String, Set<String>> getProviders() {
return providers;
}

/**
* @param uses corresponds to the directive in a 'module-info.java' file
*/
Expand Down