Skip to content

Commit

Permalink
Fix ios target compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-tiurin committed Jun 21, 2024
1 parent be9e769 commit b0096a0
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 43 deletions.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ object Versions {
const val androidToolsBuildGradle = "8.3.1"
const val androidMavenGradlePlugin = "2.1"
const val publishPlugin = "0.13.0"
const val dokkaPlugin = "1.4.30"
const val dokkaPlugin = "1.9.20"

const val recyclerView = "1.2.1"
const val espresso = "3.4.0"
Expand Down
15 changes: 14 additions & 1 deletion ultron-allure/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ tasks {
add("archives", sourcesJar)
add("archives", javadocJar)
}
}
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
// Configure Dokka source sets here
}
}
afterEvaluate {
tasks.findByName("generateMetadataFileForMavenPublication")?.let { generateMetadataTask ->
tasks.findByName("androidSourcesJar")?.let { androidSourcesJarTask ->
generateMetadataTask.dependsOn(androidSourcesJarTask)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@ import com.atiurin.ultron.core.common.OperationResultAnalyzer
import com.atiurin.ultron.core.common.UltronDefaultOperationResultAnalyzer
import com.atiurin.ultron.core.espresso.EspressoOperationResult
import com.atiurin.ultron.core.espresso.UltronEspressoOperation
import com.atiurin.ultron.core.espresso.UltronEspressoOperationLifecycle
import com.atiurin.ultron.core.espresso.assertion.EspressoAssertionType
import com.atiurin.ultron.core.espressoweb.UltronWebLifecycle
import com.atiurin.ultron.core.espressoweb.operation.WebInteractionOperation
import com.atiurin.ultron.core.espressoweb.operation.WebOperationResult
import com.atiurin.ultron.core.uiautomator.UiAutomatorOperation
import com.atiurin.ultron.core.uiautomator.UiAutomatorOperationResult
import com.atiurin.ultron.core.uiautomator.UltronUiAutomatorLifecycle
import com.atiurin.ultron.core.uiautomator.uiobject.UiAutomatorUiSelectorOperation
import com.atiurin.ultron.exceptions.UltronAssertionException
import com.atiurin.ultron.exceptions.UltronException
Expand All @@ -43,8 +40,6 @@ import com.atiurin.ultron.log.UltronLog
import com.atiurin.ultron.log.getFileLogger
import com.atiurin.ultron.testlifecycle.setupteardown.ConditionExecutorWrapper
import com.atiurin.ultron.testlifecycle.setupteardown.ConditionsExecutor
import com.atiurin.ultron.testlifecycle.setupteardown.DefaultConditionExecutorWrapper
import com.atiurin.ultron.testlifecycle.setupteardown.DefaultConditionsExecutor
import junit.framework.AssertionFailedError
import org.hamcrest.CoreMatchers.allOf
import org.hamcrest.Matcher
Expand Down Expand Up @@ -293,12 +288,20 @@ object UltronConfig {
replaceWith = ReplaceWith("UltronAndroidCommonConfig.Conditions.conditionExecutorWrapper")
)
var conditionExecutorWrapper: ConditionExecutorWrapper = UltronAndroidCommonConfig.Conditions.conditionExecutorWrapper
set(value) {
field = value
UltronAndroidCommonConfig.Conditions.conditionExecutorWrapper = value
}

@Deprecated(
message = "ConditionsExecutor moved to UltronAndroidCommonConfig.",
replaceWith = ReplaceWith("UltronAndroidCommonConfig.Conditions.conditionsExecutor")
)
var conditionsExecutor: ConditionsExecutor = UltronAndroidCommonConfig.Conditions.conditionsExecutor
var conditionsExecutor: ConditionsExecutor = UltronAndroidCommonConfig.Conditions.conditionsExecutor
set(value) {
field = value
UltronAndroidCommonConfig.Conditions.conditionsExecutor = value
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ package com.atiurin.ultron.core.config

data class UltronConfigParams(
var accelerateUiAutomator: Boolean = true,
@Deprecated("Use global setting UltronCommonConfig.logToFile", ReplaceWith("UltronCommonConfig.logToFile"))
var logToFile: Boolean = UltronCommonConfig.logToFile,
var operationTimeoutMs: Long = UltronCommonConfig.operationTimeoutMs
)
){
@Deprecated("Use global setting UltronCommonConfig.logToFile", ReplaceWith("UltronCommonConfig.logToFile"))
var logToFile: Boolean = UltronCommonConfig.logToFile
set(value) {
field = value
UltronCommonConfig.logToFile = value
}
}
22 changes: 11 additions & 11 deletions ultron-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ kotlin {
jvm()
@OptIn(ExperimentalWasmDsl::class)
wasmJs()
js(IR) {}
// js(IR) {}
androidTarget {
compilations.all {
kotlinOptions {
Expand Down Expand Up @@ -51,16 +51,16 @@ kotlin {
implementation(kotlin("stdlib-jdk8"))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin("stdlib-js"))
}
}
val wasmJsMain by getting {
dependencies {
implementation(kotlin("stdlib"))
}
}
// val jsMain by getting {
// dependencies {
// implementation(kotlin("stdlib-js"))
// }
// }
// val wasmJsMain by getting {
// dependencies {
// implementation(kotlin("stdlib"))
// }
// }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ interface OperationExecutor<Op : Operation, OpRes : OperationResult<Op>> {
}
}
val operationExceptions = exceptions.map { getWrapperException(it) }
.distinctBy { it.simpleClassName() + it.message }
.distinctBy { "${it.simpleClassName()} + ${it.message}" }
descriptor.describeResult(description, isSuccess, execTime, operationExceptions)
descriptor.decreaseLevel()
descriptor.append(description, "------ End of operation '${operation.name}' ------")
Expand Down Expand Up @@ -126,7 +126,7 @@ interface OperationExecutor<Op : Operation, OpRes : OperationResult<Op>> {
UltronAssertionBlockException(
"""
|Exception in assertion block '${operation.assertion.name}' of operation '${operation.name}'.
|${"exception: ${originalException::class.qualifiedName}".prefixTab()}
|${"exception: ${originalException::class.simpleName}".prefixTab()}
|${"message: ${originalException.message}".prefixTabForAllLines()}
""".trimMargin()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ class ResultDescriptor {
if (exceptions.size > 1) {
"""
|Errors were caught:
|${exceptions.map { "- '${it.javaClass.simpleName}', message: '${it.message}' cause: '${it.cause}'\n" }}
|Last error is ${exceptions.last()::class.java.canonicalName}
|${exceptions.map { "- '${it::class.simpleName}', message: '${it.message}' cause: '${it.cause}'\n" }}
|Last error is ${exceptions.last()::class.simpleName}
|message: ${exceptions.last().message}
""".trimMargin()
} else {
"""
|exception: ${exceptions.last()::class.java.canonicalName}
|exception: ${exceptions.last()::class.simpleName}
|message: ${exceptions.last().message}
""".trimMargin()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.atiurin.ultron.extensions

fun Any?.simpleClassName() = this?.let { it::class.simpleName }
fun Any?.simpleClassName() = this?.let { it::class }
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.atiurin.ultron.utils
import kotlin.native.concurrent.ThreadLocal

import platform.Foundation.NSThread

actual fun sleep(timeMs: Long) {
val thread = NSThread.currentThread()
@ThreadLocal val date = platform.Foundation.NSDate()
val futureTime = date.timeIntervalSinceReferenceDate + milliseconds / 1000.0
while (date.timeIntervalSinceReferenceDate < futureTime) {
val date = platform.Foundation.NSDate()
val futureTime = date.timeIntervalSinceReferenceDate + timeMs / 1000.0
while (platform.Foundation.NSDate().timeIntervalSinceReferenceDate < futureTime) {
// Busy wait until the desired time elapses
}
}
22 changes: 11 additions & 11 deletions ultron-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
kotlin {
jvm()
wasmJs()
js(IR) {}
// js(IR) {}
androidTarget {
compilations.all {
kotlinOptions {
Expand Down Expand Up @@ -50,16 +50,16 @@ kotlin {
implementation(kotlin("stdlib-jdk8"))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin("stdlib-js"))
}
}
val wasmJsMain by getting {
dependencies {
implementation(kotlin("stdlib"))
}
}
// val jsMain by getting {
// dependencies {
// implementation(kotlin("stdlib-js"))
// }
// }
// val wasmJsMain by getting {
// dependencies {
// implementation(kotlin("stdlib"))
// }
// }
}
}
android {
Expand Down

0 comments on commit b0096a0

Please sign in to comment.