Skip to content

Commit 66d5e7b

Browse files
committed
Format code
1 parent e69a246 commit 66d5e7b

17 files changed

+337
-506
lines changed

src/main/java/org/gradlex/javamodule/packaging/JavaModulePackagingExtension.java

Lines changed: 128 additions & 91 deletions
Large diffs are not rendered by default.

src/main/java/org/gradlex/javamodule/packaging/JavaModulePackagingPlugin.java

Lines changed: 8 additions & 22 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.javamodule.packaging;
183

4+
import javax.inject.Inject;
195
import org.gradle.api.Plugin;
206
import org.gradle.api.Project;
217
import org.gradle.api.file.SourceDirectorySet;
@@ -25,13 +11,11 @@
2511
import org.gradle.util.GradleVersion;
2612
import org.gradlex.javamodule.packaging.internal.HostIdentification;
2713

28-
import javax.inject.Inject;
29-
3014
@SuppressWarnings("unused")
3115
public abstract class JavaModulePackagingPlugin implements Plugin<Project> {
3216

3317
@Inject
34-
abstract protected JavaToolchainService getJavaToolchains();
18+
protected abstract JavaToolchainService getJavaToolchains();
3519

3620
@Override
3721
public void apply(Project project) {
@@ -43,11 +27,13 @@ public void apply(Project project) {
4327
SourceSetContainer sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
4428
SourceDirectorySet mainResources = sourceSets.getByName("main").getResources();
4529

46-
JavaModulePackagingExtension javaModulePackaging = project.getExtensions().create("javaModulePackaging", JavaModulePackagingExtension.class);
30+
JavaModulePackagingExtension javaModulePackaging =
31+
project.getExtensions().create("javaModulePackaging", JavaModulePackagingExtension.class);
4732
javaModulePackaging.getApplicationName().convention(project.getName());
4833
javaModulePackaging.getApplicationVersion().convention(project.provider(() -> (String) project.getVersion()));
49-
javaModulePackaging.getJpackageResources().convention(project.provider(() ->
50-
project.getLayout().getProjectDirectory().dir(mainResources.getSrcDirs().iterator().next().getParent() + "/resourcesPackage")));
34+
javaModulePackaging.getJpackageResources().convention(project.provider(() -> project.getLayout()
35+
.getProjectDirectory()
36+
.dir(mainResources.getSrcDirs().iterator().next().getParent() + "/resourcesPackage")));
5137
javaModulePackaging.getVerbose().convention(false);
5238
javaModulePackaging.primaryTarget(HostIdentification.hostTarget(project.getObjects()));
5339
}

src/main/java/org/gradlex/javamodule/packaging/internal/HostIdentification.java

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
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.javamodule.packaging.internal;
183

4+
import java.util.Locale;
195
import org.gradle.api.model.ObjectFactory;
206
import org.gradle.nativeplatform.MachineArchitecture;
217
import org.gradle.nativeplatform.OperatingSystemFamily;
228
import org.gradlex.javamodule.packaging.model.Target;
239

24-
import java.util.Locale;
25-
2610
public class HostIdentification {
2711

2812
public static void validateHostSystem(String arch, String os) {
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.javamodule.packaging.internal;
194

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

src/main/java/org/gradlex/javamodule/packaging/model/Target.java

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,28 @@
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.javamodule.packaging.model;
183

4+
import javax.inject.Inject;
195
import org.gradle.api.file.ConfigurableFileCollection;
206
import org.gradle.api.provider.ListProperty;
217
import org.gradle.api.provider.Property;
228

23-
import javax.inject.Inject;
24-
25-
abstract public class Target {
9+
public abstract class Target {
2610

2711
private final String name;
2812

29-
abstract public Property<String> getOperatingSystem();
30-
abstract public Property<String> getArchitecture();
13+
public abstract Property<String> getOperatingSystem();
14+
15+
public abstract Property<String> getArchitecture();
16+
17+
public abstract ListProperty<String> getPackageTypes();
18+
19+
public abstract ListProperty<String> getOptions();
3120

32-
abstract public ListProperty<String> getPackageTypes();
33-
abstract public ListProperty<String> getOptions();
34-
abstract public ListProperty<String> getAppImageOptions();
21+
public abstract ListProperty<String> getAppImageOptions();
3522

36-
abstract public ConfigurableFileCollection getTargetResources();
23+
public abstract ConfigurableFileCollection getTargetResources();
3724

38-
abstract public Property<Boolean> getSingleStepPackaging();
25+
public abstract Property<Boolean> getSingleStepPackaging();
3926

4027
@Inject
4128
public Target(String name) {
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.javamodule.packaging.model;
194

20-
import org.jspecify.annotations.NullMarked;
5+
import org.jspecify.annotations.NullMarked;
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.javamodule.packaging;
194

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

0 commit comments

Comments
 (0)