Skip to content

Commit ffe8f10

Browse files
committed
Compatibility with 2024.2.2
1 parent db3f208 commit ffe8f10

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [[Unreleased]]
44

5+
## [1.6.19] - 2024-11-17
6+
- Compatibility with AS Ladybug Feature Drop 2024.2.2
7+
58
## [1.6.18] - 2024-08-18
69
- Compatibility with AS Ladybug
710

@@ -212,6 +215,7 @@
212215
- Command to clear data and restart
213216

214217
[Unreleased]: https://github.com/pbreault/adb-idea/compare/1.6.18...HEAD
218+
[1.6.19]: https://github.com/pbreault/adb-idea/compare/1.6.18...1.6.19
215219
[1.6.18]: https://github.com/pbreault/adb-idea/compare/1.6.17...1.6.18
216220
[1.6.17]: https://github.com/pbreault/adb-idea/compare/1.6.16...1.6.17
217221
[1.6.16]: https://github.com/pbreault/adb-idea/compare/1.6.15...1.6.16

build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ plugins {
66
// Must match the Kotlin version bundled with the IDE
77
// https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
88
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
9-
id("org.jetbrains.kotlin.jvm") version "1.9.24"
9+
id("org.jetbrains.kotlin.jvm") version "2.0.21"
1010

1111
// https://github.com/JetBrains/intellij-platform-gradle-plugin
12-
id("org.jetbrains.intellij.platform") version "2.0.1"
12+
id("org.jetbrains.intellij.platform") version "2.1.0"
1313

1414
// https://github.com/ajoberstar/reckon
1515
id("org.ajoberstar.reckon") version "0.14.0"

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Android Studio Version
22
# Get it from `list-studio-versions.sh`
3-
ideVersion=2024.1.3.1
3+
ideVersion=2024.3.1.2
44

55
# Minimum Intellij PLatform version supported by this plugin
66
# see https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
7-
sinceBuild=241.18034
7+
sinceBuild=242.23339
88

99
# The path to a local Android Studio installation.
1010
# This will enable the `runLocalIde` task.

src/main/kotlin/com/developerphil/adbidea/adb/DeviceResultFetcher.kt

+19-2
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ package com.developerphil.adbidea.adb
33
import com.android.ddmlib.IDevice
44
import com.android.tools.idea.insights.isAndroidApp
55
import com.android.tools.idea.model.AndroidModel
6-
import com.android.tools.idea.projectsystem.getHolderModule
6+
import com.android.tools.idea.projectsystem.gradle.getHolderModule
77
import com.android.tools.idea.util.androidFacet
88
import com.developerphil.adbidea.adb.DeviceResult.DeviceNotFound
99
import com.developerphil.adbidea.adb.DeviceResult.SuccessfulDeviceResult
10+
import com.developerphil.adbidea.compatibility.BackwardCompatibleGetter
1011
import com.developerphil.adbidea.ui.DeviceChooserDialog
1112
import com.developerphil.adbidea.ui.ModuleChooserDialogHelper
1213
import com.developerphil.adbidea.ui.NotificationHelper
1314
import com.intellij.facet.ProjectFacetManager
15+
import com.intellij.openapi.module.Module
16+
import com.intellij.openapi.module.impl.ModuleImpl
1417
import com.intellij.openapi.project.Project
1518
import com.intellij.openapi.ui.DialogWrapper
1619
import org.jetbrains.android.facet.AndroidFacet
20+
import org.joor.Reflect
1721

1822

1923
class DeviceResultFetcher constructor(
@@ -53,7 +57,7 @@ class DeviceResultFetcher constructor(
5357

5458
private fun getFacet(facets: List<AndroidFacet>): AndroidFacet? {
5559
val appFacets = facets
56-
.map { it.module.getHolderModule() }
60+
.map { HolderModuleGetter(it).get() }
5761
.filter { it.isAndroidApp }
5862
.mapNotNull { it.androidFacet }
5963
.distinct()
@@ -65,6 +69,19 @@ class DeviceResultFetcher constructor(
6569
}
6670
}
6771

72+
// Can be removed after 242.23339
73+
class HolderModuleGetter(private val facet: AndroidFacet) : BackwardCompatibleGetter<Module>() {
74+
override fun getCurrentImplementation(): Module {
75+
return facet.module.getHolderModule()
76+
}
77+
78+
override fun getPreviousImplementation(): Module {
79+
return Reflect.onClass("com.android.tools.idea.projectsystem.ModuleSystemUtil")
80+
.call("getHolderModule", facet.module).get<ModuleImpl>()
81+
}
82+
}
83+
84+
6885
private fun showDeviceChooserDialog(facet: AndroidFacet, packageName: String): DeviceResult {
6986
val chooser = DeviceChooserDialog(facet)
7087
chooser.show()

0 commit comments

Comments
 (0)