Skip to content

Commit

Permalink
Introduce intellijPlatformClasspath configuration to allow retrievi…
Browse files Browse the repository at this point in the history
…ng the processed IntelliJ Platform and plugins dependencies.
  • Loading branch information
hsz committed Oct 8, 2024
1 parent 7c2322f commit c7036aa
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [next]

### Added

- Introduce `intellijPlatformClasspath` configuration to allow retrieving the processed IntelliJ Platform and plugins dependencies.

### Fixed

- Fixed issue #1778 by removing a hash of the absolute artifact path appended to the end of the version string. That hash made artifact version different on different PCs and also breaks Gradle dependency locking.
Expand Down
1 change: 1 addition & 0 deletions api/IntelliJPlatformGradlePlugin.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public final class org/jetbrains/intellij/platform/gradle/Constants$Configuratio
public static final field INSTANCE Lorg/jetbrains/intellij/platform/gradle/Constants$Configurations;
public static final field INTELLIJ_PLATFORM_BUNDLED_MODULES Ljava/lang/String;
public static final field INTELLIJ_PLATFORM_BUNDLED_PLUGINS Ljava/lang/String;
public static final field INTELLIJ_PLATFORM_CLASSPATH Ljava/lang/String;
public static final field INTELLIJ_PLATFORM_COMPOSED_JAR Ljava/lang/String;
public static final field INTELLIJ_PLATFORM_DEPENDENCIES Ljava/lang/String;
public static final field INTELLIJ_PLATFORM_DEPENDENCY Ljava/lang/String;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ object Constants {
const val INTELLIJ_PLATFORM_PLUGIN = "intellijPlatformPlugin"
const val INTELLIJ_PLATFORM_BUNDLED_PLUGINS = "intellijPlatformBundledPlugins"
const val INTELLIJ_PLATFORM_BUNDLED_MODULES = "intellijPlatformBundledModules"
const val INTELLIJ_PLATFORM_CLASSPATH = "intellijPlatformClasspath"
const val INTELLIJ_PLATFORM_DEPENDENCIES = "intellijPlatformDependencies"
const val INTELLIJ_PLATFORM_JAVA_COMPILER = "intellijPlatformJavaCompiler"
const val INTELLIJ_PLATFORM_TEST_DEPENDENCIES = "intellijPlatformTestDependencies"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ abstract class CollectorTransformer : TransformAction<CollectorTransformer.Param
dependencies: DependencyHandler,
compileClasspathConfiguration: Configuration,
testCompileClasspathConfiguration: Configuration,
intellijPlatformClasspath: Configuration,
intellijPlatformTestClasspath: Configuration,
intellijPlatformConfiguration: Configuration,
) {
Expand All @@ -119,7 +120,7 @@ abstract class CollectorTransformer : TransformAction<CollectorTransformer.Param
.attributes.attribute(Attributes.collected, false)
}

listOf(compileClasspathConfiguration, testCompileClasspathConfiguration, intellijPlatformTestClasspath).forEach {
listOf(compileClasspathConfiguration, testCompileClasspathConfiguration, intellijPlatformClasspath, intellijPlatformTestClasspath).forEach {
it.attributes.attribute(Attributes.collected, true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,15 @@ abstract class ExtractorTransformer @Inject constructor(
dependencies: DependencyHandler,
compileClasspathConfiguration: Configuration,
testCompileClasspathConfiguration: Configuration,
intellijPlatformClasspath: Configuration,
intellijPlatformTestClasspath: Configuration,
) {
Attributes.ArtifactType.Archives.forEach {
dependencies.artifactTypes.maybeCreate(it.toString())
.attributes.attribute(Attributes.extracted, false)
}

listOf(compileClasspathConfiguration, testCompileClasspathConfiguration, intellijPlatformTestClasspath).forEach {
listOf(compileClasspathConfiguration, testCompileClasspathConfiguration, intellijPlatformClasspath, intellijPlatformTestClasspath).forEach {
it.attributes.attribute(Attributes.extracted, true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ abstract class IntelliJPlatformBasePlugin : Plugin<Project> {
name = Configurations.INTELLIJ_PLATFORM_TEST_DEPENDENCIES,
description = "IntelliJ Platform Test Dependencies"
)
create(
name = Configurations.INTELLIJ_PLATFORM_CLASSPATH,
description = "IntelliJ Platform Classpath resolvable configuration"
)
create(
name = Configurations.INTELLIJ_PLATFORM_TEST_CLASSPATH,
description = "IntelliJ Platform Test Classpath resolvable configuration"
Expand All @@ -253,6 +257,10 @@ abstract class IntelliJPlatformBasePlugin : Plugin<Project> {
intellijPlatformDependenciesConfiguration,
intellijPlatformTestDependenciesConfiguration,
)
this@configurations[Configurations.INTELLIJ_PLATFORM_CLASSPATH].extendsFrom(
intellijPlatformConfiguration,
intellijPlatformDependenciesConfiguration,
)
this@configurations[Configurations.INTELLIJ_PLATFORM_TEST_CLASSPATH].extendsFrom(
intellijPlatformConfiguration,
intellijPlatformDependenciesConfiguration,
Expand Down Expand Up @@ -283,12 +291,14 @@ abstract class IntelliJPlatformBasePlugin : Plugin<Project> {
dependencies = this,
compileClasspathConfiguration = project.configurations[Configurations.External.COMPILE_CLASSPATH],
testCompileClasspathConfiguration = project.configurations[Configurations.External.TEST_COMPILE_CLASSPATH],
intellijPlatformClasspath = project.configurations[Configurations.INTELLIJ_PLATFORM_CLASSPATH],
intellijPlatformTestClasspath = project.configurations[Configurations.INTELLIJ_PLATFORM_TEST_CLASSPATH],
)
CollectorTransformer.register(
dependencies = this,
compileClasspathConfiguration = project.configurations[Configurations.External.COMPILE_CLASSPATH],
testCompileClasspathConfiguration = project.configurations[Configurations.External.TEST_COMPILE_CLASSPATH],
intellijPlatformClasspath = project.configurations[Configurations.INTELLIJ_PLATFORM_CLASSPATH],
intellijPlatformTestClasspath = project.configurations[Configurations.INTELLIJ_PLATFORM_TEST_CLASSPATH],
intellijPlatformConfiguration = project.configurations[Configurations.INTELLIJ_PLATFORM_DEPENDENCY],
)
Expand Down

0 comments on commit c7036aa

Please sign in to comment.