Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add adbserver plugin and setup publication (with CI fix) #631

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ee5755d
remove now stable feature VERSION_CATALOGS definition
Nov 11, 2022
863ba3f
move samples as separate project
Nov 11, 2022
9b6cd4a
rename alure && compose modules with gradle module naming convention
Nov 11, 2022
29fe1cf
fix .cirrus to run tests form samples
Nov 11, 2022
d4e627a
add empty kaspresso plugin && add it to samples
Nov 11, 2022
537f89f
fix cirrus gradlew paths resolution
Nov 11, 2022
3be8743
setup empty start/stop adb server tasks
Nov 11, 2022
c4def6c
update desktop to run async
Nov 14, 2022
2c22a44
add working directory support for adb server
Nov 14, 2022
af29ff2
move test artifacts to sample directory
Nov 14, 2022
5ea1b01
remove manual start adb server from cirrus
Nov 14, 2022
1a02316
add specify adb server path option for desktop server
Nov 14, 2022
6a0c52d
fix detekt
Nov 14, 2022
1467593
add gradle logger
Nov 14, 2022
8ed449d
add documentation to Desktop.kt && fix pattern compile at every getAt…
Nov 15, 2022
2a86a0c
add adb path resolution && logging
Nov 15, 2022
069fe7e
setup gradle plugin portal publishing
mfglushchenko Dec 4, 2023
b1e120e
merge master
mfglushchenko Dec 18, 2023
46f361a
fix build error
mfglushchenko Dec 18, 2023
599cd25
fix detekt
mfglushchenko Dec 18, 2023
30f6c17
move allure support files back where they should be
mfglushchenko Dec 18, 2023
53799fd
fix build
mfglushchenko Dec 18, 2023
e420b9d
temporarily remove unknown props for api 30 tests
mfglushchenko Dec 19, 2023
cfe131b
try fix api 30 tests
mfglushchenko Dec 20, 2023
bfe72f7
fix gradle sync for samples
mfglushchenko Dec 20, 2023
b8f0944
more test fixes
mfglushchenko Dec 20, 2023
d2049d1
update cirrus config file
mfglushchenko Feb 6, 2024
edd2301
merge master
mfglushchenko Feb 6, 2024
4098f3a
fix errors
mfglushchenko Feb 6, 2024
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
Prev Previous commit
Next Next commit
add documentation to Desktop.kt && fix pattern compile at every getAt…
…tachedDevicesByAdb function call
  • Loading branch information
Vladislav Sumin committed Nov 15, 2022
commit 8ed449dc5267bc5825faa2bbe2a2698fd485e181
Original file line number Diff line number Diff line change
@@ -17,23 +17,37 @@ class Desktop(

companion object {
private const val PAUSE_MS = 500L
private val DEVICE_PATTERN = Pattern.compile("^([a-zA-Z0-9\\-:.]+)(\\s+)(device)")
}

private val devices: MutableCollection<DeviceMirror> = mutableListOf()
private var isRunning = AtomicBoolean(false)

/**
* Start Desktop server.
* Blocking current thread while server working
* @throws IllegalStateException - if server already running
*/
fun startDevicesObservingSync() {
if (!isRunning.compareAndSet(false, true)) error("Desktop already running")
startDevicesObservingInternal()
}

/**
* Start Desktop server asynchronously
* @throws IllegalStateException - if server already running
*/
fun startDevicesObservingAsync() {
if (!isRunning.compareAndSet(false, true)) error("Desktop already running")
thread {
startDevicesObservingInternal()
}
}

/**
* Stop Desktop server
* @throws IllegalStateException - if server already stopped
*/
fun stopDevicesObserving() {
if (!isRunning.compareAndSet(true, false)) error("Desktop already stopped")
}
@@ -76,15 +90,14 @@ class Desktop(
}

private fun getAttachedDevicesByAdb(): List<String> {
val pattern = Pattern.compile("^([a-zA-Z0-9\\-:.]+)(\\s+)(device)")
val commandResult = adbCommandPerformer.perform("devices")
if (commandResult.status != ExecutorResultStatus.SUCCESS) {
return emptyList()
}
val adbDevicesCommandResult: String = commandResult.description
return adbDevicesCommandResult.lines()
.asSequence()
.map { pattern.matcher(it) }
.map { DEVICE_PATTERN.matcher(it) }
.filter { matcher -> matcher.find() }
.map { matcher -> matcher.group(1) }
.filter { foundEmulator -> presetEmulators.isEmpty() || presetEmulators.contains(foundEmulator) }