Skip to content

Commit 543b4b2

Browse files
authored
Merge branch 'master' into feat/4851-sync-status-is-not-compatible-with-the-status-schema
2 parents ecbc036 + 86cbf38 commit 543b4b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+231
-155
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
- label: ":android::react: RN .80 + Android: Demo app"
1+
- label: ":android::react: RN .82 + Android: Demo app"
22
command:
33
- "nvm install"
44
- "./scripts/demo-projects.android.sh"
55
env:
6-
REACT_NATIVE_VERSION: 0.80.2
6+
REACT_NATIVE_VERSION: 0.82.0
77
RCT_NEW_ARCH_ENABLED: 1
88
REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN
99
DETOX_DISABLE_POD_INSTALL: true
1010
DETOX_DISABLE_POSTINSTALL: true
1111
artifact_paths:
1212
- "/Users/builder/uibuilder/work/coverage/**/*.lcov"
1313
- "/Users/builder/uibuilder/work/artifacts*.tar.gz"
14+

.buildkite/jobs/pipeline.android_rn_80.yml renamed to .buildkite/jobs/pipeline.android_rn_81.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
- label: ":android::detox: RN .80 + Android: Tests app"
1+
- label: ":android::detox: RN .81 + Android: Tests app"
22
command:
33
- "nvm install"
44
- "./scripts/ci.android.sh"
55
env:
6-
REACT_NATIVE_VERSION: 0.80.2
6+
REACT_NATIVE_VERSION: 0.81.4
77
RCT_NEW_ARCH_ENABLED: 1
88
DETOX_DISABLE_POD_INSTALL: true
99
DETOX_DISABLE_POSTINSTALL: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- label: ":android::detox: RN .82 + Android: Tests app"
2+
command:
3+
- "nvm install"
4+
- "./scripts/ci.android.sh"
5+
env:
6+
REACT_NATIVE_VERSION: 0.82.0
7+
RCT_NEW_ARCH_ENABLED: 1
8+
DETOX_DISABLE_POD_INSTALL: true
9+
DETOX_DISABLE_POSTINSTALL: true
10+
artifact_paths:
11+
- "/Users/builder/uibuilder/work/coverage/**/*.lcov"
12+
- "/Users/builder/uibuilder/work/**/allure-report-*.html"
13+
- "/Users/builder/uibuilder/work/artifacts*.tar.gz"
14+
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
- label: ":ios::react: RN .80 + iOS: Demo app"
1+
- label: ":ios::react: RN .82 + iOS: Demo app"
22
command:
33
- "nvm install"
44
- "./scripts/demo-projects.ios.sh"
55
env:
6-
REACT_NATIVE_VERSION: 0.80.2
6+
REACT_NATIVE_VERSION: 0.82.0
77
RCT_NEW_ARCH_ENABLED: 1
88
REACT_NATIVE_COMPAT_TEST: true # Only set 'true' in jobs with the latest supported RN
99
artifact_paths:
1010
- "/Users/builder/uibuilder/work/coverage/**/*.lcov"
1111
- "/Users/builder/uibuilder/work/artifacts*.tar.gz"
12+

.buildkite/jobs/pipeline.ios_rn_80.yml renamed to .buildkite/jobs/pipeline.ios_rn_81.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
- label: ":ios::detox: RN .80 + iOS: Tests app"
1+
- label: ":ios::detox: RN .81 + iOS: Tests app"
22
command:
33
- "nvm install"
44
- "./scripts/ci.ios.sh"
55
env:
6-
REACT_NATIVE_VERSION: 0.80.2
6+
REACT_NATIVE_VERSION: 0.81.4
77
RCT_NEW_ARCH_ENABLED: 1
88
artifact_paths:
99
- "/Users/builder/uibuilder/work/coverage/**/*.lcov"
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
- label: ":ios::react: RN .77 + iOS: Demo app"
1+
- label: ":ios::detox: RN .82 + iOS: Tests app"
22
command:
33
- "nvm install"
4-
- "./scripts/demo-projects.ios.sh"
4+
- "./scripts/ci.ios.sh"
55
env:
6-
REACT_NATIVE_VERSION: 0.77.2
6+
REACT_NATIVE_VERSION: 0.82.0
77
RCT_NEW_ARCH_ENABLED: 1
88
artifact_paths:
99
- "/Users/builder/uibuilder/work/coverage/**/*.lcov"
10+
- "/Users/builder/uibuilder/work/**/allure-report-*.html"
1011
- "/Users/builder/uibuilder/work/artifacts*.tar.gz"
12+

.buildkite/pipeline_common.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
echo "steps:"
44

5-
cat .buildkite/jobs/pipeline.android_demo_app_rn_80.yml
5+
cat .buildkite/jobs/pipeline.android_demo_app_rn_82.yml
66
cat .buildkite/jobs/pipeline.android_rn_77.yml
7-
cat .buildkite/jobs/pipeline.android_rn_80.yml
8-
cat .buildkite/jobs/pipeline.ios_demo_app_rn_80.yml
7+
cat .buildkite/jobs/pipeline.android_rn_81.yml
8+
cat .buildkite/jobs/pipeline.android_rn_82.yml
9+
cat .buildkite/jobs/pipeline.ios_demo_app_rn_82.yml
910
cat .buildkite/jobs/pipeline.ios_rn_77.yml
10-
cat .buildkite/jobs/pipeline.ios_rn_80.yml
11+
cat .buildkite/jobs/pipeline.ios_rn_81.yml
12+
cat .buildkite/jobs/pipeline.ios_rn_82.yml
1113
cat .buildkite/pipeline.post_processing.yml

detox/android/detox/proguard-rules-app.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
-keep class kotlin.LazyKt { *; }
4444

4545
-keep class androidx.concurrent.futures.** { *; }
46+
-keep class androidx.tracing.** { *; }
4647

4748
-dontwarn androidx.appcompat.**
4849
-dontwarn javax.lang.model.element.**
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@file:Suppress("UNCHECKED_CAST")
2+
3+
package com.wix.detox.common
4+
5+
import kotlin.reflect.full.memberFunctions
6+
import kotlin.reflect.full.memberProperties
7+
import kotlin.reflect.jvm.isAccessible
8+
9+
object KotlinReflectUtils {
10+
11+
12+
/**
13+
* This function should be used only on kotlin properties that have custom getters.
14+
* In Release builds, such properties are compiled away into getter methods.
15+
* In Debug builds, such properties exist as fields.
16+
*/
17+
fun <T> getPropertyValueWithCustomGetter(instance: Any, propertyName: String): T? {
18+
// In Release builds, properties are compiled away into getter methods.
19+
val method = instance::class.memberFunctions.find { it.name == propertyName }
20+
if (method != null) {
21+
method.isAccessible = true
22+
return method.call(instance) as T?
23+
}
24+
25+
// In debug builds, properties exist as fields.
26+
val property = instance::class.memberProperties.first { it.name == propertyName }
27+
property.isAccessible = true
28+
return (property as? kotlin.reflect.KProperty1<Any, *>)?.get(instance) as T?
29+
}
30+
31+
}

detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/animations/AnimatedModuleIdlingResource.kt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import com.facebook.react.animated.NativeAnimatedNodesManager
99
import com.facebook.react.bridge.ReactContext
1010
import com.wix.detox.common.DetoxErrors
1111
import com.wix.detox.common.DetoxLog.Companion.LOG_TAG
12+
import com.wix.detox.common.KotlinReflectUtils
1213
import com.wix.detox.reactnative.ReactNativeInfo
1314
import com.wix.detox.reactnative.idlingresources.DetoxIdlingResource
14-
import kotlin.reflect.KProperty1
15-
import kotlin.reflect.full.memberFunctions
1615
import kotlin.reflect.full.memberProperties
1716
import kotlin.reflect.jvm.isAccessible
1817

@@ -109,21 +108,10 @@ private class AnimatedModuleFacade(private val animatedModule: NativeAnimatedMod
109108

110109
class OperationsQueueReflected(private val operationsQueue: Any) {
111110
fun isEmpty(): Boolean {
112-
// Try method first (works in release builds)
113-
val isEmptyMethod = operationsQueue::class.memberFunctions.find { it.name == "isEmpty" }
114-
if (isEmptyMethod != null) {
115-
isEmptyMethod.isAccessible = true
116-
return isEmptyMethod.call(operationsQueue) as Boolean
111+
KotlinReflectUtils.getPropertyValueWithCustomGetter<Boolean>(operationsQueue, "isEmpty")?.let {
112+
return it
117113
}
118-
119-
// Fallback to property (works in debug builds for RN 0.80+)
120-
val isEmptyProperty = operationsQueue::class.memberProperties.find { it.name == "isEmpty" }
121-
if (isEmptyProperty != null) {
122-
isEmptyProperty.isAccessible = true
123-
@Suppress("UNCHECKED_CAST")
124-
return (isEmptyProperty as KProperty1<Any, *>).get(operationsQueue) as Boolean
125-
}
126-
114+
127115
throw DetoxErrors.DetoxIllegalStateException("isEmpty method/property cannot be reached")
128116
}
129117
}

0 commit comments

Comments
 (0)