Skip to content

Commit

Permalink
Add rule for 'net.jcip:jcip-annotations'
Browse files Browse the repository at this point in the history
Resolves #50
  • Loading branch information
jjohannes committed Jan 4, 2024
1 parent 9dd558c commit 47aee31
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ Each Capability's GA coordinates correspond to the GA coordinates of the Compone
* [junit:junit-dep](https://search.maven.org/artifact/junit/junit-dep)
* [net.java.dev.jna:platform](https://search.maven.org/artifact/net.java.dev.jna/platform) ([JnaPlatformRule](src/main/java/org/gradlex/javaecosystem/capabilities/rules/JnaPlatformRule.java))
* [net.java.dev.jna:jna-platform](https://search.maven.org/artifact/net.java.dev.jna/jna-platform)
* [net.jcip:jcip-annotations](https://search.maven.org/artifact/net.jcip/jcip-annotations) ([JcipAnnotationsRule](src/main/java/org/gradlex/javaecosystem/capabilities/rules/JcipAnnotationsRule.java))
* [com.github.stephenc.jcip:jcip-annotations](https://search.maven.org/artifact/com.github.stephenc.jcip/jcip-annotations)
* [org.bouncycastle:bcmail](https://search.maven.org/artifact/org.bouncycastle/bcmail) ([BouncycastleBcmailRule](src/main/java/org/gradlex/javaecosystem/capabilities/rules/BouncycastleBcmailRule.java))
* [org.bouncycastle:bcmail-fips](https://search.maven.org/artifact/org.bouncycastle/bcmail-fips)
* [org.bouncycastle:bcmail-jdk14](https://search.maven.org/artifact/org.bouncycastle/bcmail-jdk14)
Expand Down
2 changes: 2 additions & 0 deletions samples/sample-all-deactivated/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation("c3p0:c3p0:0.9.1.2")
implementation("cglib:cglib-nodep:3.2.12")
implementation("cglib:cglib:3.3.0")
implementation("com.github.stephenc.jcip:jcip-annotations:1.0-1")
implementation("com.google.collections:google-collections:1.0")
implementation("com.google.guava:guava-jdk5:17.0")
implementation("com.google.guava:guava:31.1-jre")
Expand Down Expand Up @@ -88,6 +89,7 @@ dependencies {
implementation("junit:junit:4.12")
implementation("net.java.dev.jna:jna-platform:5.10.0")
implementation("net.java.dev.jna:platform:3.4.0")
implementation("net.jcip:jcip-annotations:1.0")
implementation("org.apache.commons:commons-io:1.3.2")
implementation("org.apache.geronimo.javamail:geronimo-javamail_1.3.1_mail:1.1")
implementation("org.apache.geronimo.javamail:geronimo-javamail_1.3.1_provider:1.1")
Expand Down
2 changes: 2 additions & 0 deletions samples/sample-all-deactivated/build.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ compileClasspath - Compile classpath for source set 'main'.
+--- c3p0:c3p0:0.9.1.2 FAILED
+--- cglib:cglib-nodep:3.2.12 FAILED
+--- cglib:cglib:3.3.0 FAILED
+--- com.github.stephenc.jcip:jcip-annotations:1.0-1 FAILED
+--- com.google.collections:google-collections:1.0 FAILED
+--- com.google.guava:guava-jdk5:17.0 FAILED
+--- com.google.guava:guava:31.1-jre FAILED
Expand Down Expand Up @@ -83,6 +84,7 @@ compileClasspath - Compile classpath for source set 'main'.
+--- junit:junit:4.12 FAILED
+--- net.java.dev.jna:jna-platform:5.10.0 FAILED
+--- net.java.dev.jna:platform:3.4.0 FAILED
+--- net.jcip:jcip-annotations:1.0 FAILED
+--- org.apache.commons:commons-io:1.3.2 FAILED
+--- org.apache.geronimo.javamail:geronimo-javamail_1.3.1_mail:1.1 FAILED
+--- org.apache.geronimo.javamail:geronimo-javamail_1.3.1_provider:1.1 FAILED
Expand Down
2 changes: 2 additions & 0 deletions samples/sample-all/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation("c3p0:c3p0:0.9.1.2")
implementation("cglib:cglib-nodep:3.2.12")
implementation("cglib:cglib:3.3.0")
implementation("com.github.stephenc.jcip:jcip-annotations:1.0-1")
implementation("com.google.collections:google-collections:1.0")
implementation("com.google.guava:guava-jdk5:17.0")
implementation("com.google.guava:guava:31.1-jre")
Expand Down Expand Up @@ -88,6 +89,7 @@ dependencies {
implementation("junit:junit:4.12")
implementation("net.java.dev.jna:jna-platform:5.10.0")
implementation("net.java.dev.jna:platform:3.4.0")
implementation("net.jcip:jcip-annotations:1.0")
implementation("org.apache.commons:commons-io:1.3.2")
implementation("org.apache.geronimo.javamail:geronimo-javamail_1.3.1_mail:1.1")
implementation("org.apache.geronimo.javamail:geronimo-javamail_1.3.1_provider:1.1")
Expand Down
2 changes: 2 additions & 0 deletions samples/sample-all/build.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ compileClasspath - Compile classpath for source set 'main'.
+--- cglib:cglib-nodep:3.2.12 -> cglib:cglib:3.3.0
| \--- org.ow2.asm:asm:7.1 -> 9.2
+--- cglib:cglib:3.3.0 (*)
+--- com.github.stephenc.jcip:jcip-annotations:1.0-1
+--- com.google.collections:google-collections:1.0 -> com.google.guava:guava:31.1-jre
| +--- com.google.guava:failureaccess:1.0.1
| +--- com.google.code.findbugs:jsr305:3.0.2
Expand Down Expand Up @@ -104,6 +105,7 @@ compileClasspath - Compile classpath for source set 'main'.
+--- net.java.dev.jna:jna-platform:5.10.0
| \--- net.java.dev.jna:jna:5.10.0
+--- net.java.dev.jna:platform:3.4.0 -> net.java.dev.jna:jna-platform:5.10.0 (*)
+--- net.jcip:jcip-annotations:1.0 -> com.github.stephenc.jcip:jcip-annotations:1.0-1
+--- org.apache.commons:commons-io:1.3.2 -> commons-io:commons-io:2.11.0
+--- org.apache.geronimo.javamail:geronimo-javamail_1.3.1_mail:1.1 -> org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:1.8.4
+--- org.apache.geronimo.javamail:geronimo-javamail_1.3.1_provider:1.1 -> org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:1.8.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import org.gradlex.javaecosystem.capabilities.rules.JavaxWsRsApiRule;
import org.gradlex.javaecosystem.capabilities.rules.JavaxXmlBindApiRule;
import org.gradlex.javaecosystem.capabilities.rules.JavaxXmlWsApiRule;
import org.gradlex.javaecosystem.capabilities.rules.JcipAnnotationsRule;
import org.gradlex.javaecosystem.capabilities.rules.JnaPlatformRule;
import org.gradlex.javaecosystem.capabilities.rules.JtsCoreRule;
import org.gradlex.javaecosystem.capabilities.rules.JtsRule;
Expand Down Expand Up @@ -200,6 +201,7 @@ private void registerCapabilityRules(ComponentMetadataHandler components, Set<St
registerRule(JavaxXmlBindApiRule.CAPABILITY, JavaxXmlBindApiRule.MODULES, JavaxXmlBindApiRule.class, null, components, allCapabilities);
registerRule(JavaxXmlWsApiRule.CAPABILITY, JavaxXmlWsApiRule.MODULES, JavaxXmlWsApiRule.class, null, components, allCapabilities);

registerRule(JcipAnnotationsRule.CAPABILITY, JcipAnnotationsRule.MODULES, JcipAnnotationsRule.class, null, components, allCapabilities);
registerRule(JnaPlatformRule.CAPABILITY, JnaPlatformRule.MODULES, JnaPlatformRule.class, null, components, allCapabilities);
registerRule(JtsCoreRule.CAPABILITY, JtsCoreRule.MODULES, JtsCoreRule.class, null, components, allCapabilities);
registerRule(JtsRule.CAPABILITY, JtsRule.MODULES, JtsRule.class, null, components, allCapabilities);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2022 the GradleX team.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.gradlex.javaecosystem.capabilities.rules;

import org.gradle.api.NonNullApi;
import org.gradle.api.artifacts.CacheableRule;
import org.gradle.api.artifacts.ComponentMetadataContext;
import org.gradle.api.artifacts.ComponentMetadataRule;

@CacheableRule
@NonNullApi
public abstract class JcipAnnotationsRule implements ComponentMetadataRule {

public static final String CAPABILITY_GROUP = "net.jcip";
public static final String CAPABILITY_NAME = "jcip-annotations";
public static final String CAPABILITY = CAPABILITY_GROUP + ":" + CAPABILITY_NAME;

public static final String[] MODULES = {
"com.github.stephenc.jcip:jcip-annotations"
};

@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
)));
}
}

0 comments on commit 47aee31

Please sign in to comment.