Skip to content

Commit 5fb0636

Browse files
committed
Format code
1 parent cb21dad commit 5fb0636

File tree

79 files changed

+914
-1987
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+914
-1987
lines changed

src/main/java/org/gradlex/jvm/dependency/conflict/detection/JvmDependencyConflictDetectionPlugin.java

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
/*
2-
* Copyright the GradleX team.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
1+
// SPDX-License-Identifier: Apache-2.0
172
package org.gradlex.jvm.dependency.conflict.detection;
183

194
import org.gradle.api.Plugin;
@@ -35,7 +20,8 @@ public class JvmDependencyConflictDetectionPlugin implements Plugin<ExtensionAwa
3520
@Override
3621
public void apply(ExtensionAware projectOrSettings) {
3722
if (GradleVersion.current().compareTo(MINIMUM_SUPPORTED_VERSION) < 0) {
38-
throw new IllegalStateException("Plugin requires at least Gradle " + MINIMUM_SUPPORTED_VERSION.getVersion());
23+
throw new IllegalStateException(
24+
"Plugin requires at least Gradle " + MINIMUM_SUPPORTED_VERSION.getVersion());
3925
}
4026

4127
ComponentMetadataHandler components;
@@ -45,9 +31,12 @@ public void apply(ExtensionAware projectOrSettings) {
4531
components = ((Project) projectOrSettings).getDependencies().getComponents();
4632
} else if (projectOrSettings instanceof Settings) {
4733
//noinspection UnstableApiUsage
48-
components = ((Settings) projectOrSettings).getDependencyResolutionManagement().getComponents();
34+
components = ((Settings) projectOrSettings)
35+
.getDependencyResolutionManagement()
36+
.getComponents();
4937
} else {
50-
throw new IllegalStateException("Cannot apply plugin to: " + projectOrSettings.getClass().getName());
38+
throw new IllegalStateException(
39+
"Cannot apply plugin to: " + projectOrSettings.getClass().getName());
5140
}
5241
registerRules(components);
5342
}
Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
/*
2-
* Copyright the GradleX team.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
1+
// SPDX-License-Identifier: Apache-2.0
172
@NullMarked
183
package org.gradlex.jvm.dependency.conflict.detection;
194

20-
import org.jspecify.annotations.NullMarked;
5+
import org.jspecify.annotations.NullMarked;

src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/AlignmentDefinition.java

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
1-
/*
2-
* Copyright the GradleX team.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
1+
// SPDX-License-Identifier: Apache-2.0
172
package org.gradlex.jvm.dependency.conflict.detection.rules;
183

4+
import java.util.Arrays;
5+
import java.util.List;
196
import org.gradlex.jvm.dependency.conflict.detection.rules.asm.AsmAlignmentRule;
207
import org.gradlex.jvm.dependency.conflict.detection.rules.jetty.JettyAlignmentRule;
218
import org.gradlex.jvm.dependency.conflict.detection.rules.logging.Log4J2Alignment;
229
import org.gradlex.jvm.dependency.conflict.detection.rules.logging.Slf4J2Alignment;
2310
import org.gradlex.jvm.dependency.conflict.detection.rules.logging.Slf4JAlignment;
2411

25-
import java.util.Arrays;
26-
import java.util.List;
27-
2812
public enum AlignmentDefinition {
29-
ASM("org.ow2.asm:asm-bom", AsmAlignmentRule.class,
13+
ASM(
14+
"org.ow2.asm:asm-bom",
15+
AsmAlignmentRule.class,
3016
"org.ow2.asm:asm",
3117
"org.ow2.asm:asm-tree",
3218
"org.ow2.asm:asm-analysis",
3319
"org.ow2.asm:asm-util",
34-
"org.ow2.asm:asm-commons"
35-
),
36-
JERSEY("org.glassfish.jersey:jersey-bom", AlignmentDefinitionRule.class,
20+
"org.ow2.asm:asm-commons"),
21+
JERSEY(
22+
"org.glassfish.jersey:jersey-bom",
23+
AlignmentDefinitionRule.class,
3724
"org.glassfish.jersey.core:jersey-common",
3825
"org.glassfish.jersey.core:jersey-client",
3926
"org.glassfish.jersey.core:jersey-server",
@@ -111,9 +98,10 @@ public enum AlignmentDefinition {
11198
"org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty",
11299
"org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-jetty-http2",
113100
"org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-netty",
114-
"org.glassfish.jersey.test-framework:jersey-test-framework-util"
115-
),
116-
JETTY("org.eclipse.jetty:jetty-bom", JettyAlignmentRule.class,
101+
"org.glassfish.jersey.test-framework:jersey-test-framework-util"),
102+
JETTY(
103+
"org.eclipse.jetty:jetty-bom",
104+
JettyAlignmentRule.class,
117105
"org.eclipse.jetty:jetty-alpn-client",
118106
"org.eclipse.jetty:jetty-alpn-conscrypt-client",
119107
"org.eclipse.jetty:jetty-alpn-conscrypt-server",
@@ -169,9 +157,10 @@ public enum AlignmentDefinition {
169157
"org.eclipse.jetty.websocket:jetty-websocket-jetty-api",
170158
"org.eclipse.jetty.websocket:jetty-websocket-jetty-client",
171159
"org.eclipse.jetty.websocket:jetty-websocket-jetty-common",
172-
"org.eclipse.jetty.websocket:jetty-websocket-jetty-server"
173-
),
174-
LOG4J2("org.apache.logging.log4j:log4j-bom", Log4J2Alignment.class,
160+
"org.eclipse.jetty.websocket:jetty-websocket-jetty-server"),
161+
LOG4J2(
162+
"org.apache.logging.log4j:log4j-bom",
163+
Log4J2Alignment.class,
175164
"org.apache.logging.log4j:log4j-api",
176165
"org.apache.logging.log4j:log4j-core",
177166
"org.apache.logging.log4j:log4j-1.2-api",
@@ -181,9 +170,9 @@ public enum AlignmentDefinition {
181170
"org.apache.logging.log4j:log4j-jmx-gui",
182171
"org.apache.logging.log4j:log4j-slf4j-impl",
183172
"org.apache.logging.log4j:log4j-web",
184-
"org.apache.logging.log4j:log4j-nosql"
185-
),
186-
SSHD(AlignmentDefinitionRule.class,
173+
"org.apache.logging.log4j:log4j-nosql"),
174+
SSHD(
175+
AlignmentDefinitionRule.class,
187176
"org.apache.sshd:sshd-cli",
188177
"org.apache.sshd:sshd-common",
189178
"org.apache.sshd:sshd-contrib",
@@ -198,9 +187,10 @@ public enum AlignmentDefinition {
198187
"org.apache.sshd:sshd-putty",
199188
"org.apache.sshd:sshd-scp",
200189
"org.apache.sshd:sshd-sftp",
201-
"org.apache.sshd:sshd-spring-sftp"
202-
),
203-
SLF4J2("org.slf4j:slf4j-bom", Slf4J2Alignment.class,
190+
"org.apache.sshd:sshd-spring-sftp"),
191+
SLF4J2(
192+
"org.slf4j:slf4j-bom",
193+
Slf4J2Alignment.class,
204194
"org.slf4j:slf4j-api",
205195
"org.slf4j:slf4j-simple",
206196
"org.slf4j:slf4j-nop",
@@ -212,9 +202,9 @@ public enum AlignmentDefinition {
212202
"org.slf4j:jcl-over-slf4j",
213203
"org.slf4j:log4j-over-slf4j",
214204
"org.slf4j:jul-to-slf4j",
215-
"org.slf4j:osgi-over-slf4j"
216-
),
217-
SLF4J(Slf4JAlignment.class,
205+
"org.slf4j:osgi-over-slf4j"),
206+
SLF4J(
207+
Slf4JAlignment.class,
218208
// Ignored modules:
219209
// org.slf4j:slf4j-archetype
220210
// org.slf4j:slf4j-converter
@@ -240,8 +230,7 @@ public enum AlignmentDefinition {
240230
"org.slf4j:slf4j-migrator",
241231
"org.slf4j:slf4j-nop",
242232
"org.slf4j:slf4j-reload4j",
243-
"org.slf4j:slf4j-simple"
244-
);
233+
"org.slf4j:slf4j-simple");
245234

246235
private final String bom;
247236
private final List<String> modules;

src/main/java/org/gradlex/jvm/dependency/conflict/detection/rules/AlignmentDefinitionRule.java

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
/*
2-
* Copyright the GradleX team.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
1+
// SPDX-License-Identifier: Apache-2.0
172
package org.gradlex.jvm.dependency.conflict.detection.rules;
183

4+
import javax.inject.Inject;
195
import org.gradle.api.artifacts.CacheableRule;
206
import org.gradle.api.artifacts.ComponentMetadataContext;
217
import org.gradle.api.artifacts.ComponentMetadataDetails;
@@ -24,8 +10,6 @@
2410
import org.gradle.api.attributes.Category;
2511
import org.gradle.api.model.ObjectFactory;
2612

27-
import javax.inject.Inject;
28-
2913
@CacheableRule
3014
public abstract class AlignmentDefinitionRule implements ComponentMetadataRule {
3115

@@ -53,8 +37,10 @@ public final void execute(ComponentMetadataContext context) {
5337

5438
void applyWithBom(ComponentMetadataDetails details) {
5539
String version = details.getId().getVersion();
56-
details.allVariants(v -> v.withDependencies(dependencies -> dependencies.add(definition.getBom() + ":" + version,
57-
d -> d.attributes(a -> a.attribute(Category.CATEGORY_ATTRIBUTE, getObjects().named(Category.class, Category.REGULAR_PLATFORM))))));
40+
details.allVariants(v -> v.withDependencies(dependencies -> dependencies.add(
41+
definition.getBom() + ":" + version,
42+
d -> d.attributes(a -> a.attribute(
43+
Category.CATEGORY_ATTRIBUTE, getObjects().named(Category.class, Category.REGULAR_PLATFORM))))));
5844
}
5945

6046
void applyWithoutBom(ComponentMetadataDetails details) {

0 commit comments

Comments
 (0)