-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rule for 'javax.inject:javax.inject'
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
.../main/java/de/jjohannes/gradle/javaecosystem/capabilities/rules/JakartaInjectApiRule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.jjohannes.gradle.javaecosystem.capabilities.rules; | ||
|
||
import org.gradle.api.artifacts.CacheableRule; | ||
import org.gradle.api.artifacts.ComponentMetadataContext; | ||
import org.gradle.api.artifacts.ComponentMetadataRule; | ||
|
||
@CacheableRule | ||
public abstract class JakartaInjectApiRule implements ComponentMetadataRule { | ||
|
||
public static final String CAPABILITY_GROUP = "javax.inject"; | ||
public static final String CAPABILITY_NAME = "javax.inject"; | ||
|
||
public static final String[] MODULES = { | ||
"jakarta.inject:jakarta.inject-api" | ||
}; | ||
|
||
@Override | ||
public void execute(ComponentMetadataContext context) { | ||
String version = context.getDetails().getId().getVersion(); | ||
context.getDetails().allVariants(variant -> variant.withCapabilities(capabilities -> capabilities.addCapability( | ||
CAPABILITY_GROUP, CAPABILITY_NAME, version | ||
))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters