Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ Running from command line
./gradlew runIde
```

Override running IDE
--------------------

* Create `local.properties` file in root directory of the project with content:
```
# Uncomment when you want to use local IDE instead install specified IDE by ideOverride
#localIdePath=C:\\Users\\[USER]\\AppData\\Local\\Programs\\IntelliJ IDEA Ultimate

# Allowed types
# IU - Intellij Idea Ultimate
# IC - Intellij Idea Community
# IA - Android Studio
ideOverride=IU
```
* Select which IDE you want to use or uncomment `localIdePath` and specify the path to IDE.

Create new menu item
====================

Expand All @@ -31,4 +47,4 @@ Create new menu item
* Add new entry in `QuickListAction.kt` like this
```kotlin
addAction("com.developerphil.adbidea.action.NewAction", group)
```
```
38 changes: 29 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
id("org.jetbrains.kotlin.jvm") version "2.1.0"

// https://github.com/JetBrains/intellij-platform-gradle-plugin
id("org.jetbrains.intellij.platform") version "2.4.0"
id("org.jetbrains.intellij.platform") version "2.6.0"

// https://github.com/ajoberstar/reckon
id("org.ajoberstar.reckon") version "0.14.0"
Expand Down Expand Up @@ -78,14 +78,35 @@ localIdePath?.let {

dependencies {
intellijPlatform {
bundledPlugin("org.jetbrains.android")
instrumentationTools()
if (project.hasProperty("localIdeOverride")) {
local(property("localIdeOverride").toString())
} else {
androidStudio(property("ideVersion").toString())
val version = property("ideVersion").toString()
val ide = property("ideOverride").toString()
val pluginVersion = property("sinceBuild").toString()

when {
localIdePath?.isNotBlank() == true -> {
// We don't recognize if it's local Android Studio or Idea.
// In case that's Android Studio, it's required to replace the line with:
// bundledPlugin("org.jetbrains.android")
plugin("org.jetbrains.android:$pluginVersion")
local(localPath = localIdePath.toString())
}

ide == "IC" -> {
plugin("org.jetbrains.android:$pluginVersion")
intellijIdeaCommunity(version)
}

ide == "IU" -> {
plugin("org.jetbrains.android:$pluginVersion")
intellijIdeaUltimate(version)
}

else -> {
// Only for Android studio itself: https://github.com/JetBrains/intellij-platform-gradle-plugin/issues/1843#issuecomment-2658420485
bundledPlugin("org.jetbrains.android")
androidStudio(version)
}
}

}

implementation("org.jooq:joor:0.9.15")
Expand All @@ -107,4 +128,3 @@ fun recentChanges(outputType: Changelog.OutputType): String {

return s
}

2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ideVersion=2025.1.1.2

# Minimum Intellij PLatform version supported by this plugin
# see https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
# Versions used by IntelliJ IDEA IDEs
# https://plugins.jetbrains.com/plugin/22989-android/versions
sinceBuild=251.23774.16

# The path to a local Android Studio installation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.developerphil.adbidea.adb

import com.android.ddmlib.IDevice
import com.android.tools.idea.insights.isAndroidApp
import com.android.tools.idea.model.AndroidModel
import com.android.tools.idea.projectsystem.gradle.getHolderModule
import com.android.tools.idea.projectsystem.getHolderModule
import com.android.tools.idea.util.androidFacet
import com.developerphil.adbidea.adb.DeviceResult.DeviceNotFound
import com.developerphil.adbidea.adb.DeviceResult.SuccessfulDeviceResult
Expand Down Expand Up @@ -58,7 +57,6 @@ class DeviceResultFetcher(
private fun getFacet(facets: List<AndroidFacet>): AndroidFacet? {
val appFacets = facets
.map { HolderModuleGetter(it).get() }
.filter { it.isAndroidApp }
.mapNotNull { it.androidFacet }
.distinct()

Expand Down Expand Up @@ -115,4 +113,4 @@ sealed class DeviceResult {

data object Cancelled : DeviceResult()
data object DeviceNotFound : DeviceResult()
}
}
1 change: 0 additions & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
]]></description>

<depends>com.intellij.modules.platform</depends>
<depends>com.intellij.modules.androidstudio</depends>
<depends>org.jetbrains.android</depends>

<actions>
Expand Down