Skip to content

Commit

Permalink
Compatibility with AS Ladybug
Browse files Browse the repository at this point in the history
  • Loading branch information
pbreault committed Aug 19, 2024
1 parent 5e69331 commit db3f208
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 33 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [[Unreleased]]

## [1.6.18] - 2024-08-18
- Compatibility with AS Ladybug

## [1.6.17] - 2024-07-22
- Fix regression in 1.6.16 that broke device selection in Android Studio Koala

Expand Down Expand Up @@ -208,7 +211,8 @@
- Command to clear data
- Command to clear data and restart

[Unreleased]: https://github.com/pbreault/adb-idea/compare/1.6.17...HEAD
[Unreleased]: https://github.com/pbreault/adb-idea/compare/1.6.18...HEAD
[1.6.18]: https://github.com/pbreault/adb-idea/compare/1.6.17...1.6.18
[1.6.17]: https://github.com/pbreault/adb-idea/compare/1.6.16...1.6.17
[1.6.16]: https://github.com/pbreault/adb-idea/compare/1.6.15...1.6.16
[1.6.15]: https://github.com/pbreault/adb-idea/compare/1.6.14...1.6.15
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ plugins {
// Must match the Kotlin version bundled with the IDE
// https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
id("org.jetbrains.kotlin.jvm") version "1.8.0"
id("org.jetbrains.kotlin.jvm") version "1.9.24"

// https://github.com/JetBrains/intellij-platform-gradle-plugin
id("org.jetbrains.intellij.platform") version "2.0.0-rc1"
id("org.jetbrains.intellij.platform") version "2.0.1"

// https://github.com/ajoberstar/reckon
id("org.ajoberstar.reckon") version "0.14.0"
Expand All @@ -35,6 +35,7 @@ intellijPlatform {
group = "com.developerphil.intellij.plugin.adbidea"
changeNotes.set(provider { recentChanges(HTML) })
ideaVersion.sinceBuild.set(project.property("sinceBuild").toString())
ideaVersion.untilBuild.set(provider { null })
}
buildSearchableOptions.set(false)
instrumentCode = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.developerphil.adbidea.action

import com.developerphil.adbidea.adb.AdbFacade
import com.developerphil.adbidea.adb.AdbUtil
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project

class ClearDataAndRestartWithDebuggerAction : AdbAction() {
override fun actionPerformed(e: AnActionEvent, project: Project) = AdbFacade.clearDataAndRestartWithDebugger(project)

override fun update(e: AnActionEvent) {
e.presentation.isEnabled = AdbUtil.isDebuggingAvailable
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ class QuickListAction : QuickSwitchSchemeAction(), DumbAware {
addAction("com.developerphil.adbidea.action.ClearDataAction", group)
addAction("com.developerphil.adbidea.action.ClearDataAndRestartAction", group)
addAction("com.developerphil.adbidea.action.RevokePermissionsAction", group)
if (AdbUtil.isDebuggingAvailable) {
group.addSeparator()
addAction("com.developerphil.adbidea.action.StartWithDebuggerAction", group)
addAction("com.developerphil.adbidea.action.RestartWithDebuggerAction", group)
}
group.addSeparator()
addAction("com.developerphil.adbidea.action.StartWithDebuggerAction", group)
addAction("com.developerphil.adbidea.action.RestartWithDebuggerAction", group)
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package com.developerphil.adbidea.action

import com.developerphil.adbidea.adb.AdbFacade
import com.developerphil.adbidea.adb.AdbUtil
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project

class RestartWithDebuggerAction : AdbAction() {
override fun actionPerformed(e: AnActionEvent, project: Project) = AdbFacade.restartDefaultActivityWithDebugger(project)

override fun update(e: AnActionEvent) {
e.presentation.isEnabled = AdbUtil.isDebuggingAvailable
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
package com.developerphil.adbidea.action

import com.developerphil.adbidea.adb.AdbFacade
import com.developerphil.adbidea.adb.AdbUtil
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project

class StartWithDebuggerAction : AdbAction() {
override fun actionPerformed(e: AnActionEvent, project: Project) = AdbFacade.startDefaultActivityWithDebugger(project)

override fun update(e: AnActionEvent) {
e.presentation.isEnabled = AdbUtil.isDebuggingAvailable
}
}
11 changes: 0 additions & 11 deletions src/main/kotlin/com/developerphil/adbidea/adb/AdbUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ object AdbUtil {
return receiver.adbOutputLines.isNotEmpty()
}

// The android debugger class is not available in Intellij 2016.1.
// Nobody should use that version but it's still the minimum "supported" version since android studio 2.2
// shares the same base version.
val isDebuggingAvailable: Boolean
get() = try {
Reflect.on("com.android.tools.idea.execution.common.debug.AndroidDebugger").get<Any>()
true
} catch (e: Exception) {
false
}

fun isGradleSyncInProgress(project: Project): Boolean {
return try {
GradleSyncState.getInstance(project).isSyncInProgress
Expand Down

0 comments on commit db3f208

Please sign in to comment.