From 0ebf24fc509969bcdea32603af02a4512a8cc130 Mon Sep 17 00:00:00 2001 From: AlexanderBartash Date: Thu, 17 Oct 2024 21:43:18 +0300 Subject: [PATCH] Created a metadata rule to replace composed-jar attribute by jar. --- build.gradle | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/build.gradle b/build.gradle index a4bb960db..d57085bc2 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,13 @@ buildscript { ext.ideaVersion = ideaVersion ext.kotlinVersion = kotlinVersion ext.java_version = "17" + + // Should be in buildSrc ideally + //dependencies { + // classpath(gradleApi()) { + // because("Creates a dependency on the API of the current version of Gradle, so that we can create Gradle plugins.") + // } + //} } plugins { @@ -33,7 +40,34 @@ tasks.withType(Test) { environment 'GRADLE_RELEASE_REPOSITORY','https://services.gradle.org/distributions' } +// Should be in buildSrc ideally +//@CacheableRule +//abstract class ComposedJarRule implements ComponentMetadataRule { +// @Inject abstract ObjectFactory getObjects() +// +// void execute(ComponentMetadataContext context) { +// context.details.withVariant("intellijPlatformComposedJar") { +// attributes { +// attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR)) +// } +// } +// } +//} + dependencies { + //components { + // withModule("com.redhat.devtools.intellij:intellij-common", ComposedJarRule) + //} + components { + withModule("com.redhat.devtools.intellij:intellij-common") { + withVariant("intellijPlatformComposedJar") { + attributes { + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.JAR)) + } + } + } + } + implementation( "com.redhat.devtools.intellij:intellij-common:${intellijCommonVersion}", "io.fabric8:kubernetes-client:${kubernetesClientVersion}",