Skip to content

Commit

Permalink
Merge pull request #25 from WahdanZ/release/2.0
Browse files Browse the repository at this point in the history
Release/2.0
  • Loading branch information
WahdanZ authored May 2, 2021
2 parents 5a3dff1 + 6fd4bd1 commit a5037af
Show file tree
Hide file tree
Showing 32 changed files with 731 additions and 365 deletions.
12 changes: 10 additions & 2 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Spock Adb Changelog
## [Unreleased]
### Added

- Get Current App BackStack (Activities and nested fragments)
- Add Plugins actions ex GetCurrentFragment,RestartApp,etc
- allow to choose which buttons to show and which not to show
### Changed

### Deprecated
Expand All @@ -12,6 +14,9 @@

### Fixed

- support latest version of AS
- fix get current fragment
- fix If two instances of AS are open, the plugin does not work properly
### Security
## [1.0.9]
### Added
Expand Down
15 changes: 11 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import org.jetbrains.changelog.closure
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()

plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.4.0"
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
id("org.jetbrains.intellij") version "0.4.21"
id("org.jetbrains.intellij") version "0.7.2"
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
id("org.jetbrains.changelog") version "0.4.0"
id("org.jetbrains.changelog") version "1.1.2"
// detekt linter - read more: https://detekt.github.io/detekt/kotlindsl.html
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
// id("org.jlleitschuh.gradle.ktlint") version "9.3.0"
Expand Down Expand Up @@ -48,11 +49,17 @@ intellij {
type = platformType
downloadSources = platformDownloadSources.toBoolean()
updateSinceUntilBuild = true
alternativeIdePath =
"/Users/ahmedwahdan/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app"

// Plugin Dependencies:
// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html
//
setPlugins("android", "java")
val plugins = properties("platformPlugins")
.split(',')
.map(String::trim)
.filter(String::isNotEmpty)
setPlugins(*plugins.toTypedArray())
}


Expand All @@ -79,7 +86,7 @@ tasks {
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription(
closure {
File("./README.md").readText().lines().run {
File(projectDir, "README.md").readText().lines().run {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

Expand Down
21 changes: 12 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
kotlin.code.style=official
androidStudioPath = '/Users/ahmedwahdan/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents'
pluginGroup = com.wahdan
pluginName = SpockAdb
pluginVersion = 1.0.9
pluginSinceBuild = 193
pluginUntilBuild = 202.*
platformType = IC
platformVersion = 2019.3
platformDownloadSources = true
androidStudioPath='/Users/ahmedwahdan/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/201.7199119/Android Studio.app'
pluginGroup=com.wahdan
pluginName=SpockAdb
pluginVersion=2.0.0
pluginSinceBuild=201
pluginUntilBuild=211.*
platformType=Android
platformDownloadSources=true
platformPlugins=com.intellij.gradle,org.jetbrains.kotlin,com.intellij.java,org.jetbrains.android
platformVersion=2021.1
kotlinVersion=1.4.21
pluginVerifierIdeVersions=2020.2.4, 2020.3.2, 2021.1

57 changes: 31 additions & 26 deletions src/main/kotlin/spock/adb/AdbController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@ package spock.adb
import com.android.ddmlib.IDevice
import spock.adb.command.GetApplicationPermission
import spock.adb.command.Network
import spock.adb.premission.PermissionListItem
import spock.adb.premission.ListItem

interface AdbController {
fun refresh()
fun connectedDevices(block: (devices:List<IDevice>) -> Unit,error:(message:String)->Unit)
fun currentBackStack(device: IDevice, success: (message: String) -> Unit, error: (message: String) -> Unit)
fun currentActivity(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun currentFragment(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun forceKillApp(device: IDevice, success:(message:String)->Unit, error:(message:String)->Unit)
fun testProcessDeath(device: IDevice, success:(message:String)->Unit, error:(message:String)->Unit)
fun restartApp(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun restartAppWithDebugger(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun clearAppData(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun clearAppDataAndRestart(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun uninstallApp(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun getApplicationPermissions(device: IDevice,block: (devices:List<PermissionListItem>) -> Unit,error:(message:String)->Unit)
fun grantOrRevokeAllPermissions(device: IDevice, permissionOperation: GetApplicationPermission.PermissionOperation, success: (message: String) -> Unit, error: (message: String) -> Unit)
fun revokePermission(device: IDevice, permissionListItem: PermissionListItem, success:(message:String)->Unit, error:(message:String)->Unit)
fun grantPermission(device: IDevice, permissionListItem: PermissionListItem, success:(message:String)->Unit, error:(message:String)->Unit)
fun connectDeviceOverIp(ip:String, success:(message:String)->Unit, error:(message:String)->Unit)
fun enableDisableDontKeepActivities(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun enableDisableShowTaps(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun enableDisableShowLayoutBounds(device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun setWindowAnimatorScale(scale: String, device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun setTransitionAnimatorScale(scale: String, device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun setAnimatorDurationScale(scale: String, device: IDevice,success:(message:String)->Unit,error:(message:String)->Unit)
fun toggleNetwork(device: IDevice, network: Network, success: (message: String) -> Unit, error: (message: String) -> Unit)
fun inputOnDevice(input: String, device: IDevice, success: (message: String) -> Unit, error: (message: String) -> Unit)
fun refresh()
fun connectedDevices(block: (devices: List<IDevice>) -> Unit)
fun currentBackStack(device: IDevice)
fun currentApplicationBackStack(device: IDevice)
fun currentActivity(device: IDevice)
fun currentFragment(device: IDevice)
fun forceKillApp(device: IDevice)
fun testProcessDeath(device: IDevice)
fun restartApp(device: IDevice)
fun restartAppWithDebugger(device: IDevice)
fun clearAppData(device: IDevice)
fun clearAppDataAndRestart(device: IDevice)
fun uninstallApp(device: IDevice)
fun getApplicationPermissions(device: IDevice, block: (devices: List<ListItem>) -> Unit)
fun grantOrRevokeAllPermissions(
device: IDevice,
permissionOperation: GetApplicationPermission.PermissionOperation,
)

fun revokePermission(device: IDevice, listItem: ListItem)
fun grantPermission(device: IDevice, listItem: ListItem)
fun connectDeviceOverIp(ip: String)
fun enableDisableDontKeepActivities(device: IDevice)
fun enableDisableShowTaps(device: IDevice)
fun enableDisableShowLayoutBounds(device: IDevice)
fun setWindowAnimatorScale(scale: String, device: IDevice)
fun setTransitionAnimatorScale(scale: String, device: IDevice)
fun setAnimatorDurationScale(scale: String, device: IDevice)
fun toggleNetwork(device: IDevice, network: Network)
fun inputOnDevice(input: String, device: IDevice)
}
Loading

0 comments on commit a5037af

Please sign in to comment.