File tree Expand file tree Collapse file tree 4 files changed +70
-2
lines changed
plugins/edc-build/src/main/java/org/eclipse/edc/plugins/edcbuild Expand file tree Collapse file tree 4 files changed +70
-2
lines changed Original file line number Diff line number Diff line change 3030import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .mavenPublication ;
3131import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .mavenPublishing ;
3232import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .nexusPublishing ;
33+ import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .printClasspath ;
3334import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .repositories ;
3435import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .rootBuildScript ;
3536import static org .eclipse .edc .plugins .edcbuild .conventions .Conventions .signing ;
@@ -74,7 +75,8 @@ public void apply(Project target) {
7475 allDependencies (),
7576 tests (),
7677 jar (),
77- swagger ()
78+ swagger (),
79+ printClasspath ()
7880 ).forEach (c -> c .apply (project ));
7981 });
8082
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ public static EdcConvention checkstyle() {
2323 return new CheckstyleConvention ();
2424 }
2525
26-
2726 public static EdcConvention mavenPublishing () {
2827 return new MavenPublishingConvention ();
2928 }
@@ -87,4 +86,8 @@ public static EdcConvention openApiMerger() {
8786 public static EdcConvention mavenPublication () {
8887 return new MavenPublicationConvention ();
8988 }
89+
90+ public static EdcConvention printClasspath () {
91+ return new PrintClasspathConvention ();
92+ }
9093}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3+ *
4+ * This program and the accompanying materials are made available under the
5+ * terms of the Apache License, Version 2.0 which is available at
6+ * https://www.apache.org/licenses/LICENSE-2.0
7+ *
8+ * SPDX-License-Identifier: Apache-2.0
9+ *
10+ * Contributors:
11+ * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
12+ *
13+ */
14+
15+ package org .eclipse .edc .plugins .edcbuild .conventions ;
16+
17+ import org .eclipse .edc .plugins .edcbuild .tasks .PrintClasspathTask ;
18+ import org .gradle .api .Project ;
19+
20+ public class PrintClasspathConvention implements EdcConvention {
21+ @ Override
22+ public void apply (Project target ) {
23+ target .getTasks ().register ("printClasspath" , PrintClasspathTask .class )
24+ .configure (t -> t .dependsOn ("compileJava" ));
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
3+ *
4+ * This program and the accompanying materials are made available under the
5+ * terms of the Apache License, Version 2.0 which is available at
6+ * https://www.apache.org/licenses/LICENSE-2.0
7+ *
8+ * SPDX-License-Identifier: Apache-2.0
9+ *
10+ * Contributors:
11+ * Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
12+ *
13+ */
14+
15+ package org .eclipse .edc .plugins .edcbuild .tasks ;
16+
17+ import org .gradle .api .DefaultTask ;
18+ import org .gradle .api .plugins .JavaPluginExtension ;
19+ import org .gradle .api .tasks .TaskAction ;
20+
21+ import static org .eclipse .edc .plugins .edcbuild .conventions .ConventionFunctions .requireExtension ;
22+
23+
24+ public class PrintClasspathTask extends DefaultTask {
25+
26+ @ TaskAction
27+ public void printClasspath () {
28+ var classpath = requireExtension (getProject (), JavaPluginExtension .class )
29+ .getSourceSets ()
30+ .getByName ("main" )
31+ .getRuntimeClasspath ()
32+ .getAsPath ();
33+
34+ System .out .println (classpath );
35+ }
36+
37+ }
You can’t perform that action at this time.
0 commit comments