aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikunj Arora <nikunj.arora@qt.io>2024-12-19 15:33:56 +0200
committerOlli Vuolteenaho <olli.vuolteenaho@qt.io>2025-01-09 12:42:22 +0000
commit361712309ea86a84dc153da53e5476be6ef82116 (patch)
treedf1154e2565906d6eb97ef7ec3f3f641ba9c9588
parent6e7ff8aadc509053b7492d31c95c7c904a3c0255 (diff)
Upgrade the IntelliJ Platform Gradle plugin to 2.x
For IntelliJ versions 2024.2+ (LadyBug and above), we need to upgrade the IntelliJ Platform Gradle plugin to 2.x and since this is a breaking change, we will need to make the necessary fixes in rest of the code. Also bump the supported version numbers here, because the issues are related. Task-number: QTTA-241 Task-number: QTTA-110 Change-Id: I0e7e64c93d21944caa97c990a7d7087f6f500ade Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r--.gitignore1
-rw-r--r--README.md2
-rw-r--r--build.gradle.kts72
-rw-r--r--gradle.properties9
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--src/main/resources/META-INF/plugin.xml9
6 files changed, 48 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index cc043fe..f1efd06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ build/
### IntelliJ IDEA ###
.idea/
+.intellijPlatform/
*.iws
*.iml
*.ipr
diff --git a/README.md b/README.md
index a553618..44f00b8 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ This plugin supports the integration of Qt/QML projects into Android Studio proj
### Dependencies
-The plugin requires IntelliJ 2023.1 or newer i.e. Android Studio Hedgehog 2023.1.1 Canary 1 or later.
+The plugin requires IntelliJ 2024.1.2 or newer i.e. Android Studio Koala Feature Drop or later.
### How to build
diff --git a/build.gradle.kts b/build.gradle.kts
index 57e2b70..b61fa0c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -3,53 +3,59 @@ import java.util.Properties
plugins {
id("java")
- id("org.jetbrains.kotlin.jvm") version "1.8.21"
- id("org.jetbrains.intellij") version "1.13.3"
+ id("org.jetbrains.kotlin.jvm") version "2.1.0"
+ id("org.jetbrains.intellij.platform") version "2.2.1"
}
-val localProperties = Properties().apply {
- load(FileInputStream(File(rootProject.rootDir, "local.properties")))
-}
-
-group = "org.qtproject.qt"
-version = "3.0.0"
-
repositories {
mavenCentral()
+ intellijPlatform {
+ defaultRepositories()
+ }
}
-// Configure Gradle IntelliJ Plugin
-// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
-intellij {
- localPath.set(localProperties.getProperty("android-studio.dir"))
- type.set("AI") // Target IDE Platform
+dependencies {
+ intellijPlatform {
+ androidStudio("2024.1.2.13") // recommendation is to build with the lowest supported version
+ plugin("org.jetbrains.android:243.22562.218")
+ plugin("com.redhat.devtools.lsp4ij:0.9.0")
+ bundledPlugin("org.jetbrains.plugins.gradle")
+ pluginVerifier()
+ }
+}
- plugins.set(listOf(
- "android",
- "com.redhat.devtools.lsp4ij:0.7.0"
- ))
+java {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
}
-tasks {
- // Set the JVM compatibility versions
- withType<JavaCompile> {
- sourceCompatibility = "17"
- targetCompatibility = "17"
+intellijPlatform {
+ pluginConfiguration {
+ group = providers.gradleProperty("pluginGroup")
+ version = providers.gradleProperty("pluginVersion")
+
+ name = providers.gradleProperty("pluginName")
+
+ ideaVersion {
+ sinceBuild = providers.gradleProperty("pluginSinceBuild")
+ untilBuild = providers.gradleProperty("pluginUntilBuild")
+ }
}
- // Note: keep in sync with plugin.xml
- patchPluginXml {
- sinceBuild.set("231")
- untilBuild.set("241.*")
+ signing {
+ certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
+ privateKey = providers.environmentVariable("PRIVATE_KEY")
+ password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}
- signPlugin {
- certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
- privateKey.set(System.getenv("PRIVATE_KEY"))
- password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
+ publishing {
+ token = providers.environmentVariable("PUBLISH_TOKEN")
}
- publishPlugin {
- token.set(System.getenv("PUBLISH_TOKEN"))
+ pluginVerification {
+ ides {
+ recommended()
+ }
+ externalPrefixes = listOf("com.android.tools.idea.gradle", "org.jetbrains.plugins.gradle")
}
}
diff --git a/gradle.properties b/gradle.properties
index 2bca45c..39456d4 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,6 @@
-kotlin.stdlib.default.dependency=false
-# TODO temporary workaround for Kotlin 1.8.20+ (https://jb.gg/intellij-platform-kotlin-oom)
-kotlin.incremental.useClasspathSnapshot=false
+pluginGroup = "org.qtproject.qt"
+pluginVersion = 4.0
+
+pluginName = "Qt Tools for Android Studio"
+
+pluginSinceBuild = 241.19072.14
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index fae0804..81aa1c0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml
index 97d2b41..3340f43 100644
--- a/src/main/resources/META-INF/plugin.xml
+++ b/src/main/resources/META-INF/plugin.xml
@@ -2,14 +2,6 @@
<idea-plugin>
<!-- Unique identifier of the plugin. It should be FQN. It cannot be changed between the plugin versions. -->
<id>org.qtproject.qt.androidstudiotools</id>
-
- <!-- Public plugin name should be written in Title Case.
- Guidelines: https://plugins.jetbrains.com/docs/marketplace/plugin-overview-page.html#plugin-name -->
- <name>Qt Tools for Android Studio</name>
- <!-- Note: keep in sync with build.gradle.kts version -->
- <version>3.0.0</version>
- <!-- Note: keep in sync with build.gradle.kts sinceBuild -->
- <idea-version since-build="231" until-build="241.*"/>
<!-- A displayed Vendor name or Organization ID displayed on the Plugins Page. -->
<vendor url="https://qt.io" email="qt.android@qt.io">Qt Group</vendor>
@@ -87,7 +79,6 @@
<!-- Product and plugin compatibility requirements.
Read more: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
<depends>com.intellij.modules.platform</depends>
- <depends>org.jetbrains.android</depends>
<depends>com.intellij.modules.androidstudio</depends>
<depends>com.redhat.devtools.lsp4ij</depends>