In the latest IntelliJ Platform Gradle Plugin 2.6.1-SNAPSHOT, I’ve introduced a new mechanism for resolving the IntelliJ Platform artifacts and extracting them into the custom location.
This feature allows you to keep extracted IDEs in a specific place and not rely on the Gradle transformer. The transformer has a known issue of re-extracting the already-present archive if the Gradle build file’s classpath changes, resulting in multiple extracted IDE copies being present in the Gradle cache.
To utilize this incubating feature, replace the main IntelliJ Platform dependency definition (such as create(type, version)) with:
val intelliJPlatformResolver = project.intelliJPlatformResolver()
dependencies {
intellijPlatform {
local(
intelliJPlatformResolver.resolve(
type = providers.gradleProperty("platformType"),
version = providers.gradleProperty("platformVersion"),
)
)
}
}
By default, IDEs are extracted in the PROJECT_DIR/.intellijPlatform/ides/ directory. Each IDE directory name is set to $type-$version. Both cache directory and name composition can be adjusted with i.e.:
val intelliJPlatformResolver = intelliJPlatformResolver {
cacheDirectory = layout.dir(provider { File("/home/me/ides") })
name = { it: RequestedIntelliJPlatform ->
val today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))
"${it.type}-${it.version}-$today"
}
}