sparkling-method 2.1.0-rc.2 → 2.1.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/SparklingMethod.podspec +11 -11
- package/package.json +6 -1
- package/android/build.gradle.kts +0 -245
- package/android/gradle.properties +0 -1
- package/android/proguard-rules.pro +0 -21
- package/android/src/androidTest/java/com/tiktok/sparkling/sparkling/methods/ExampleInstrumentedTest.kt +0 -27
- package/android/src/main/AndroidManifest.xml +0 -5
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/BridgeContext.kt +0 -74
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/DefaultBridgeClientImp.kt +0 -47
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/DefaultBridgeLifeClientImp.kt +0 -233
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/InnerBridge.kt +0 -134
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/entity/BridgeCall.kt +0 -79
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/entity/BridgeResult.kt +0 -68
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/handler/BridgeDispatcher.kt +0 -198
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/handler/BridgeFactoryManager.kt +0 -16
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/handler/BridgeThreadDispatcher.kt +0 -56
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/errors/JSBErrorReportModel.kt +0 -144
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/interceptor/BridgeMockInterceptor.kt +0 -30
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lifecycle/fe/FeCallMonitorModel.kt +0 -66
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxBridgeDelegateModule.kt +0 -31
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxBridgeProtol.kt +0 -69
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxRuntimeBridgeDelegateModule.kt +0 -31
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxViewImpl.kt +0 -29
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/lynx/RealLynxBridgeDelegate.kt +0 -147
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/monitor/BridgeSDKMonitor.kt +0 -239
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/monitor/IBridgeMonitor.kt +0 -17
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/impl/monitor/MonitorEntity.kt +0 -22
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeCallback.kt +0 -14
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeClient.kt +0 -19
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeHandler.kt +0 -23
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeLifeClient.kt +0 -45
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeMethodCallback.kt +0 -10
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/interfaces/IBridgeProtocol.kt +0 -22
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/utils/BridgeConstants.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/utils/BridgeConverter.kt +0 -147
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/utils/LogUtils.kt +0 -37
- package/android/src/main/java/com/tiktok/sparkling/method/protocol/utils/MonitorUtils.kt +0 -41
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/BridgeLocalPool.kt +0 -70
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/BridgeSettings.kt +0 -19
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/BusinessCallHandler.kt +0 -100
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/CancelCallbackConfig.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/DefaultCallHandler.kt +0 -106
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/IBridgeMethod.kt +0 -118
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/PiperDataExt.kt +0 -71
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/SparklingBridge.kt +0 -374
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/Utils.kt +0 -89
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/interfaces/IBridgeNotFound.kt +0 -11
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/processor/LynxDataProcessorForMap.kt +0 -204
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/processor/LynxPlatformDataProcessor.kt +0 -239
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/processor/WebPlatformDataProcessor.kt +0 -307
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/processor/WebProcessorForMap.kt +0 -227
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/BridgeMethodCallbackHelper.kt +0 -29
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/BridgeProtocolConstants.kt +0 -12
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/DataConvertUtils.kt +0 -684
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/IConvertUtils.kt +0 -44
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/LogHelper.kt +0 -30
- package/android/src/main/java/com/tiktok/sparkling/method/registry/api/util/ThreadPool.kt +0 -73
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/BridgeCollections.kt +0 -194
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/BridgePlatformType.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IBridgeContext.kt +0 -137
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLBridgeMethod.kt +0 -100
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLMethodProvider.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLMethodRegistry.kt +0 -132
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLMethodRegistryCache.kt +0 -150
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLMethodRegistryCacheManager.kt +0 -34
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IDLProxyClient.kt +0 -28
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/IRegister.kt +0 -21
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/LocalBridge.kt +0 -70
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/ReadableMapImpl.kt +0 -227
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/RegistryCache.kt +0 -77
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/SparklingBridgeManager.kt +0 -50
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodIntEnum.kt +0 -15
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodName.kt +0 -14
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodParamField.kt +0 -42
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodParamModel.kt +0 -10
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodResultModel.kt +0 -10
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/annotation/IDLMethodStringEnum.kt +0 -15
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/base/AbsSparklingIDLMethod.kt +0 -276
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/exception/IDLMethodException.kt +0 -10
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/exception/IllegalInputParamException.kt +0 -12
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/exception/IllegalOperationException.kt +0 -12
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/exception/IllegalOutputParamException.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/interfaces/IContainerIDProvider.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/interfaces/INameSpaceProvider.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/interfaces/IPlatformDataProcessor.kt +0 -19
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/interfaces/IReleasable.kt +0 -13
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/context/BridgeCallThreadTypeConfig.kt +0 -44
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/context/ContextProviderFactory.kt +0 -133
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/idl/CompletionBlock.kt +0 -26
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/idl/IDLDynamic.kt +0 -97
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/idl/IDLMethodBaseModel.kt +0 -37
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/idl/IDLMethodBaseParamModel.kt +0 -62
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/model/idl/IDLMethodBaseResultModel.kt +0 -18
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/BridgeKTX.kt +0 -37
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/IAssignDir.kt +0 -25
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/IDLMethodHelper.kt +0 -44
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/IDLMethodResultModelArguments.kt +0 -264
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/IDLMethodResultModelHelper.kt +0 -194
- package/android/src/main/java/com/tiktok/sparkling/method/registry/core/utils/JsonUtils.kt +0 -200
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/BridgeBaseRuntime.kt +0 -11
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/CommonDependsProvider.kt +0 -14
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/common/IHostNetworkDepend.kt +0 -19
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/common/IHostPermissionDepend.kt +0 -34
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/common/IHostThreadPoolExecutorDepend.kt +0 -12
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/network/AbsStreamConnection.kt +0 -36
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/network/AbsStringConnection.kt +0 -30
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/network/HttpRequest.kt +0 -134
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/network/NetworkRequestImpl.kt +0 -28
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/network/RequestJsonFormatOptionConstants.kt +0 -10
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/utils/BridgeAPIRequestUtils.kt +0 -365
- package/android/src/main/java/com/tiktok/sparkling/method/runtime/depend/utils/HttpUrlBuilder.kt +0 -97
- package/android/src/main/res/drawable/ic_launcher_background.xml +0 -170
- package/android/src/main/res/drawable/ic_launcher_foreground.xml +0 -30
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -6
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -6
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/values/colors.xml +0 -10
- package/android/src/main/res/values/strings.xml +0 -3
- package/android/src/test/java/com/tiktok/sparkling/method/TestApplication.kt +0 -19
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/BridgeContextTest.kt +0 -89
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/DefaultBridgeClientImpTest.kt +0 -78
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/DefaultBridgeLifeClientImpTest.kt +0 -97
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/InnerBridgeTest.kt +0 -105
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/entity/BridgeCallTest.kt +0 -61
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/entity/BridgeResultTest.kt +0 -74
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/handler/BridgeDispatcherTest.kt +0 -96
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/handler/BridgeFactoryManagerTest.kt +0 -21
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/handler/BridgeThreadDispatcherTest.kt +0 -34
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/errors/JSBErrorReportModelTest.kt +0 -60
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/interceptor/BridgeMockInterceptorTest.kt +0 -51
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/lifecycle/fe/FeCallMonitorModelTest.kt +0 -65
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxBridgeDelegateModuleTest.kt +0 -57
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxBridgeProtocolTest.kt +0 -10
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/lynx/LynxRuntimeBridgeDelegateModuleTest.kt +0 -37
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/lynx/RealLynxBridgeDelegateTest.kt +0 -10
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/monitor/BridgeSDKMonitorTest.kt +0 -10
- package/android/src/test/java/com/tiktok/sparkling/method/protocol/impl/monitor/MonitorEntityTest.kt +0 -43
- package/android/src/test/java/com/tiktok/sparkling/method/registry/api/SparklingBridgeTest.kt +0 -444
- package/android/src/test/java/com/tiktok/sparkling/method/registry/api/util/DataConvertUtilsTest.kt +0 -236
- package/android/src/test/java/com/tiktok/sparkling/method/registry/core/IDLMethodRegistryTest.kt +0 -331
- package/android/src/test/java/com/tiktok/sparkling/method/registry/core/LocalBridgeTest.kt +0 -299
- package/android/src/test/java/com/tiktok/sparkling/method/registry/core/SparklingBridgeManagerTest.kt +0 -213
- package/android/src/test/java/com/tiktok/sparkling/method/registry/core/base/AbsSparklingIDLMethodTest.kt +0 -307
- package/android/src/test/java/com/tiktok/sparkling/method/registry/core/exception/IDLMethodExceptionTest.kt +0 -311
- package/android/src/test/java/com/tiktok/sparkling/method/runtime/depend/BridgeBaseRuntimeTest.kt +0 -54
- package/android/src/test/resources/robolectric.properties +0 -5
- package/src/index.ts +0 -240
- package/src/types.ts +0 -44
- package/src/typing.d.ts +0 -44
- package/tsconfig.json +0 -15
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
require 'json'
|
|
2
2
|
|
|
3
3
|
Pod::Spec.new do |s|
|
|
4
|
-
source_root = 'packages/sparkling-method/ios'
|
|
5
|
-
source_globs = ->(patterns) { patterns.flat_map { |pattern| [pattern, "#{source_root}/#{pattern}"] } }
|
|
6
4
|
s.name = 'SparklingMethod'
|
|
7
|
-
s.version = "2.1.0-rc.
|
|
5
|
+
s.version = "2.1.0-rc.20"
|
|
8
6
|
s.summary = "iOS SDK for Sparkling Method"
|
|
9
7
|
s.description = "Core iOS method runtime for Sparkling, with Lynx integration, dependency injection support, and debug helpers."
|
|
10
8
|
s.license = "Apache 2.0"
|
|
@@ -24,44 +22,46 @@ Pod::Spec.new do |s|
|
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
s.subspec 'Core' do |core|
|
|
27
|
-
core.source_files =
|
|
25
|
+
core.source_files = [
|
|
28
26
|
'Sources/Core/Definitions/*.{h,m,swift}',
|
|
29
27
|
'Sources/Core/Pipe/*.{h,m,swift}',
|
|
30
28
|
'Sources/Core/Models/*.{h,m,swift}',
|
|
31
29
|
'Sources/Core/Protocols/*.{h,m,swift}',
|
|
32
30
|
'Sources/Core/Utils/*.{h,m,swift}',
|
|
33
31
|
'Sources/Core/DI/**/*.{h,m,swift}',
|
|
34
|
-
]
|
|
32
|
+
]
|
|
35
33
|
core.dependency 'Mantle', '~> 2.2.0'
|
|
36
34
|
end
|
|
37
35
|
|
|
38
36
|
s.subspec 'Lynx' do |lynx|
|
|
39
|
-
lynx.source_files =
|
|
37
|
+
lynx.source_files = [
|
|
40
38
|
'Sources/Lynx/Pipe/*.{h,m,swift}',
|
|
41
39
|
'Sources/Lynx/Engine/*.{h,m,swift}',
|
|
42
40
|
'Sources/Lynx/Definitions/*.{h,m,swift}',
|
|
43
41
|
'Sources/Lynx/Module/*.{h,m,swift}',
|
|
44
42
|
'Sources/Lynx/Models/*.{h,m,swift}',
|
|
45
|
-
]
|
|
43
|
+
]
|
|
46
44
|
|
|
47
45
|
lynx.dependency 'SparklingMethod/Core'
|
|
48
46
|
lynx.dependency 'Lynx/Framework', '3.6.0'
|
|
47
|
+
lynx.dependency 'LynxBase/Framework', '3.6.0'
|
|
48
|
+
lynx.dependency 'LynxServiceAPI', '3.6.0'
|
|
49
49
|
lynx.dependency 'PrimJS/quickjs', '>=2.12.0'
|
|
50
50
|
lynx.dependency 'PrimJS/napi', '>=2.12.0'
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
s.subspec 'DIProvider' do |di|
|
|
54
|
-
di.source_files =
|
|
54
|
+
di.source_files = [
|
|
55
55
|
'Sources/DIProvider/**/*.{h,m,swift}',
|
|
56
|
-
]
|
|
56
|
+
]
|
|
57
57
|
|
|
58
58
|
di.dependency 'SparklingMethod/Core'
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
s.subspec 'Debug' do |de|
|
|
62
|
-
de.source_files =
|
|
62
|
+
de.source_files = [
|
|
63
63
|
'Sources/Debug/**/*.{h,m,swift}',
|
|
64
|
-
]
|
|
64
|
+
]
|
|
65
65
|
|
|
66
66
|
de.dependency 'SparklingMethod/Core'
|
|
67
67
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sparkling-method",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.20",
|
|
4
4
|
"homepage": "https://tiktok.github.io/sparkling/",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
},
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"ios",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
12
17
|
"devDependencies": {
|
|
13
18
|
"@lynx-js/types": "3.6.0",
|
|
14
19
|
"typescript": "^5.8.3"
|
package/android/build.gradle.kts
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import org.gradle.api.publish.PublishingExtension
|
|
2
|
-
import org.gradle.api.publish.maven.MavenPublication
|
|
3
|
-
import org.gradle.api.tasks.bundling.Jar
|
|
4
|
-
|
|
5
|
-
plugins {
|
|
6
|
-
alias(libs.plugins.android.library)
|
|
7
|
-
alias(libs.plugins.kotlin.android)
|
|
8
|
-
id("maven-publish")
|
|
9
|
-
id("signing")
|
|
10
|
-
jacoco
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
android {
|
|
14
|
-
namespace = "com.tiktok.sparkling.method"
|
|
15
|
-
compileSdk = 34
|
|
16
|
-
|
|
17
|
-
defaultConfig {
|
|
18
|
-
minSdk = 21
|
|
19
|
-
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
buildTypes {
|
|
23
|
-
debug {
|
|
24
|
-
enableUnitTestCoverage = true
|
|
25
|
-
}
|
|
26
|
-
release {
|
|
27
|
-
isMinifyEnabled = false
|
|
28
|
-
proguardFiles(
|
|
29
|
-
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
30
|
-
"proguard-rules.pro"
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
compileOptions {
|
|
35
|
-
sourceCompatibility = JavaVersion.VERSION_11
|
|
36
|
-
targetCompatibility = JavaVersion.VERSION_11
|
|
37
|
-
}
|
|
38
|
-
kotlinOptions {
|
|
39
|
-
jvmTarget = "11"
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
testOptions {
|
|
43
|
-
unitTests {
|
|
44
|
-
isIncludeAndroidResources = true
|
|
45
|
-
all {
|
|
46
|
-
it.jvmArgs("-Xmx2048m", "-XX:MaxMetaspaceSize=512m")
|
|
47
|
-
it.systemProperty("robolectric.logging.enabled", "true")
|
|
48
|
-
it.systemProperty(
|
|
49
|
-
"user.home",
|
|
50
|
-
buildDir.resolve("robolectric-home").absolutePath
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
dependencies {
|
|
58
|
-
|
|
59
|
-
implementation(libs.androidx.core.ktx)
|
|
60
|
-
implementation(libs.androidx.appcompat)
|
|
61
|
-
testImplementation(libs.junit)
|
|
62
|
-
androidTestImplementation(libs.androidx.junit)
|
|
63
|
-
androidTestImplementation(libs.androidx.espresso.core)
|
|
64
|
-
|
|
65
|
-
// Testing dependencies
|
|
66
|
-
testImplementation("io.mockk:mockk:1.13.8")
|
|
67
|
-
testImplementation("org.robolectric:robolectric:4.10.3")
|
|
68
|
-
testImplementation("org.bouncycastle:bcprov-jdk18on:1.75")
|
|
69
|
-
testImplementation("androidx.test:core:1.5.0")
|
|
70
|
-
testImplementation("androidx.test.ext:junit:1.1.5")
|
|
71
|
-
testImplementation("org.mockito:mockito-core:5.2.0")
|
|
72
|
-
testImplementation("org.mockito:mockito-inline:5.2.0")
|
|
73
|
-
testImplementation("androidx.test:runner:1.5.2")
|
|
74
|
-
testImplementation("androidx.test:rules:1.5.0")
|
|
75
|
-
// Removed PowerMock due to compatibility issues with Robolectric and Java 11
|
|
76
|
-
|
|
77
|
-
api(libs.lynx)
|
|
78
|
-
api("com.google.code.gson:gson:2.8.9")
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
tasks.withType<Test>().configureEach {
|
|
82
|
-
doFirst {
|
|
83
|
-
buildDir.resolve("robolectric-home").mkdirs()
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
tasks.register<JacocoReport>("jacocoTestReport") {
|
|
88
|
-
dependsOn(tasks.named("testDebugUnitTest"))
|
|
89
|
-
|
|
90
|
-
reports {
|
|
91
|
-
xml.required.set(true)
|
|
92
|
-
html.required.set(true)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
val fileFilter = listOf(
|
|
96
|
-
"**/R.class",
|
|
97
|
-
"**/R$*.class",
|
|
98
|
-
"**/BuildConfig.*",
|
|
99
|
-
"**/Manifest*.*",
|
|
100
|
-
"**/*Test*.*",
|
|
101
|
-
"android/**/*.*"
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
val mainSrc = "${project.projectDir}/src/main/java"
|
|
105
|
-
sourceDirectories.setFrom(files(mainSrc))
|
|
106
|
-
|
|
107
|
-
val debugJavaTree = layout.buildDirectory.dir("intermediates/javac/debug").map { dir ->
|
|
108
|
-
dir.asFileTree.matching {
|
|
109
|
-
exclude(fileFilter)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
val debugKotlinTree = layout.buildDirectory.dir("tmp/kotlin-classes/debug").map { dir ->
|
|
113
|
-
dir.asFileTree.matching {
|
|
114
|
-
exclude(fileFilter)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
classDirectories.setFrom(debugJavaTree, debugKotlinTree)
|
|
118
|
-
|
|
119
|
-
val unitTestCoverageExec = layout.buildDirectory.file("outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec")
|
|
120
|
-
val jacocoExec = layout.buildDirectory.file("jacoco/testDebugUnitTest.exec")
|
|
121
|
-
executionData.setFrom(files(unitTestCoverageExec, jacocoExec))
|
|
122
|
-
|
|
123
|
-
onlyIf {
|
|
124
|
-
executionData.files.any { it.exists() }
|
|
125
|
-
}
|
|
126
|
-
outputs.upToDateWhen { false }
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
val publishingGroupId = (findProperty("SPARKLING_PUBLISHING_GROUP_ID") as? String)
|
|
130
|
-
?: System.getenv("SPARKLING_PUBLISHING_GROUP_ID")
|
|
131
|
-
?: "com.tiktok.sparkling"
|
|
132
|
-
val publishingVersion = (findProperty("SPARKLING_PUBLISHING_VERSION") as? String)
|
|
133
|
-
?: System.getenv("SPARKLING_PUBLISHING_VERSION")
|
|
134
|
-
?: "2.0.0"
|
|
135
|
-
|
|
136
|
-
val androidSourcesJar by tasks.register<Jar>("androidSourcesJar") {
|
|
137
|
-
archiveClassifier.set("sources")
|
|
138
|
-
from(android.sourceSets.getByName("main").java.srcDirs)
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
val emptyJavadocJar by tasks.register<Jar>("javadocJar") {
|
|
142
|
-
archiveClassifier.set("javadoc")
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
afterEvaluate {
|
|
146
|
-
extensions.configure<PublishingExtension>("publishing") {
|
|
147
|
-
publications {
|
|
148
|
-
create<MavenPublication>("release") {
|
|
149
|
-
groupId = publishingGroupId
|
|
150
|
-
artifactId = "sparkling-method"
|
|
151
|
-
version = publishingVersion
|
|
152
|
-
|
|
153
|
-
from(components["release"])
|
|
154
|
-
artifact(androidSourcesJar)
|
|
155
|
-
artifact(emptyJavadocJar)
|
|
156
|
-
|
|
157
|
-
pom {
|
|
158
|
-
name.set("sparkling-method")
|
|
159
|
-
description.set("Sparkling method Android SDK module")
|
|
160
|
-
url.set("https://github.com/tiktok/sparkling")
|
|
161
|
-
|
|
162
|
-
licenses {
|
|
163
|
-
license {
|
|
164
|
-
name.set("Apache-2.0")
|
|
165
|
-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
developers {
|
|
170
|
-
developer {
|
|
171
|
-
id.set("tiktok")
|
|
172
|
-
name.set("TikTok")
|
|
173
|
-
email.set("opensource@tiktok.com")
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
scm {
|
|
178
|
-
connection.set("scm:git:git://github.com/tiktok/sparkling.git")
|
|
179
|
-
developerConnection.set("scm:git:ssh://github.com:tiktok/sparkling.git")
|
|
180
|
-
url.set("https://github.com/tiktok/sparkling")
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
repositories {
|
|
187
|
-
maven {
|
|
188
|
-
name = "MavenCentral"
|
|
189
|
-
// Central Portal staging API (replaces legacy s01.oss.sonatype.org shut down June 2025)
|
|
190
|
-
val repoUrl = (findProperty("mavenCentralRepoUrl") as? String)
|
|
191
|
-
?: System.getenv("MAVEN_CENTRAL_REPO_URL")
|
|
192
|
-
?: "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
|
|
193
|
-
url = uri(repoUrl)
|
|
194
|
-
credentials {
|
|
195
|
-
username = (findProperty("mavenCentralUsername") as? String)
|
|
196
|
-
?: System.getenv("MAVEN_CENTRAL_USERNAME")
|
|
197
|
-
?: ""
|
|
198
|
-
password = (findProperty("mavenCentralPassword") as? String)
|
|
199
|
-
?: System.getenv("MAVEN_CENTRAL_PASSWORD")
|
|
200
|
-
?: ""
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Signing configuration
|
|
208
|
-
signing {
|
|
209
|
-
val signingKeyId = (findProperty("signing.keyId") as? String)
|
|
210
|
-
?: System.getenv("SIGNING_KEY_ID")
|
|
211
|
-
val signingPassword = (findProperty("signing.password") as? String)
|
|
212
|
-
?: System.getenv("SIGNING_PASSWORD")
|
|
213
|
-
val signingSecretKeyRingFile = (findProperty("signing.secretKeyRingFile") as? String)
|
|
214
|
-
?: System.getenv("SIGNING_SECRET_KEY_RING_FILE")
|
|
215
|
-
val signingKey = System.getenv("SIGNING_KEY")
|
|
216
|
-
|
|
217
|
-
if (!signingKeyId.isNullOrBlank() && !signingPassword.isNullOrBlank()) {
|
|
218
|
-
if (!signingKey.isNullOrBlank()) {
|
|
219
|
-
// Use in-memory key (for CI/CD)
|
|
220
|
-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
|
|
221
|
-
print("Using in-memory GPG key for signing")
|
|
222
|
-
} else if (!signingSecretKeyRingFile.isNullOrBlank() && file(signingSecretKeyRingFile).exists()) {
|
|
223
|
-
// Use key ring file (for local development)
|
|
224
|
-
useInMemoryPgpKeys(signingKeyId, file(signingSecretKeyRingFile).readText(), signingPassword)
|
|
225
|
-
print("Using GPG key ring file for signing: $signingSecretKeyRingFile")
|
|
226
|
-
} else {
|
|
227
|
-
print("Warning: Signing key ID and password provided but no key content available")
|
|
228
|
-
}
|
|
229
|
-
} else {
|
|
230
|
-
print("Warning: GPG signing not configured. Set SIGNING_KEY_ID and SIGNING_PASSWORD environment variables.")
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Sign publications after they are configured
|
|
235
|
-
afterEvaluate {
|
|
236
|
-
signing {
|
|
237
|
-
val hasSigningConfig = !(System.getenv("SIGNING_KEY_ID").isNullOrBlank() ||
|
|
238
|
-
System.getenv("SIGNING_PASSWORD").isNullOrBlank())
|
|
239
|
-
if (hasSigningConfig) {
|
|
240
|
-
sign(extensions.getByType<PublishingExtension>().publications["release"])
|
|
241
|
-
} else {
|
|
242
|
-
print("Skipping signing for publication 'release' - no signing configuration")
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
SPARKLING_PUBLISHING_VERSION=2.0.0-rc.5
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Add project specific ProGuard rules here.
|
|
2
|
-
# You can control the set of applied configuration files using the
|
|
3
|
-
# proguardFiles setting in build.gradle.
|
|
4
|
-
#
|
|
5
|
-
# For more details, see
|
|
6
|
-
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
|
-
|
|
8
|
-
# If your project uses WebView with JS, uncomment the following
|
|
9
|
-
# and specify the fully qualified class name to the JavaScript interface
|
|
10
|
-
# class:
|
|
11
|
-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
12
|
-
# public *;
|
|
13
|
-
#}
|
|
14
|
-
|
|
15
|
-
# Uncomment this to preserve the line number information for
|
|
16
|
-
# debugging stack traces.
|
|
17
|
-
#-keepattributes SourceFile,LineNumberTable
|
|
18
|
-
|
|
19
|
-
# If you keep the line number information, uncomment this to
|
|
20
|
-
# hide the original source file name.
|
|
21
|
-
#-renamesourcefileattribute SourceFile
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2022 TikTok Pte. Ltd.
|
|
2
|
-
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
-
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
package com.tiktok.sparkling.sparkling.methods
|
|
5
|
-
|
|
6
|
-
import androidx.test.platform.app.InstrumentationRegistry
|
|
7
|
-
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
8
|
-
|
|
9
|
-
import org.junit.Test
|
|
10
|
-
import org.junit.runner.RunWith
|
|
11
|
-
|
|
12
|
-
import org.junit.Assert.*
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Instrumented test, which will execute on an Android device.
|
|
16
|
-
*
|
|
17
|
-
* See [testing documentation](http://d.android.com/tools/testing).
|
|
18
|
-
*/
|
|
19
|
-
@RunWith(AndroidJUnit4::class)
|
|
20
|
-
class ExampleInstrumentedTest {
|
|
21
|
-
@Test
|
|
22
|
-
fun useAppContext() {
|
|
23
|
-
// Context of the app under test.
|
|
24
|
-
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
|
25
|
-
assertEquals("com.tiktok.sparkling.methods", appContext.packageName)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2022 TikTok Pte. Ltd.
|
|
2
|
-
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
-
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
package com.tiktok.sparkling.method.protocol
|
|
7
|
-
|
|
8
|
-
import com.tiktok.sparkling.method.registry.core.BridgePlatformType
|
|
9
|
-
import com.tiktok.sparkling.method.registry.api.BusinessCallHandler
|
|
10
|
-
import com.tiktok.sparkling.method.registry.api.DefaultCallHandler
|
|
11
|
-
import com.tiktok.sparkling.method.registry.api.SparklingBridge
|
|
12
|
-
import com.lynx.tasm.LynxBackgroundRuntime
|
|
13
|
-
import com.lynx.tasm.LynxView
|
|
14
|
-
import com.tiktok.sparkling.method.protocol.entity.BridgeCall
|
|
15
|
-
import com.tiktok.sparkling.method.protocol.handler.BridgeDispatcher
|
|
16
|
-
import com.tiktok.sparkling.method.protocol.impl.errors.JSBErrorReportModel
|
|
17
|
-
import com.tiktok.sparkling.method.protocol.impl.interceptor.BridgeMockInterceptor
|
|
18
|
-
import com.tiktok.sparkling.method.protocol.impl.monitor.IBridgeMonitor
|
|
19
|
-
import com.tiktok.sparkling.method.protocol.interfaces.IBridgeLifeClient
|
|
20
|
-
import com.tiktok.sparkling.method.protocol.interfaces.IBridgeProtocol
|
|
21
|
-
|
|
22
|
-
class BridgeContext {
|
|
23
|
-
companion object {
|
|
24
|
-
fun getPlatformByBridgeContext(bridgeContext: BridgeContext): BridgePlatformType {
|
|
25
|
-
return if (bridgeContext.platform == BridgePlatformType.LYNX) {
|
|
26
|
-
BridgePlatformType.LYNX
|
|
27
|
-
} else if (bridgeContext.platform == BridgePlatformType.WEB) {
|
|
28
|
-
BridgePlatformType.WEB
|
|
29
|
-
} else {
|
|
30
|
-
BridgePlatformType.ALL
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var sparklingBridge: SparklingBridge? = null
|
|
36
|
-
var dispatcher: BridgeDispatcher? = null
|
|
37
|
-
var bridgeClient = DefaultBridgeClientImp(this)
|
|
38
|
-
val bridgeLifeClientImp = DefaultBridgeLifeClientImp(this)
|
|
39
|
-
var lynxView : LynxView? = null
|
|
40
|
-
var lynxBackgroundRuntime : LynxBackgroundRuntime? = null
|
|
41
|
-
var containerId : String? = ""
|
|
42
|
-
var protocols : MutableList<IBridgeProtocol> = mutableListOf()
|
|
43
|
-
var monitor : MutableSet<IBridgeMonitor> = mutableSetOf()
|
|
44
|
-
val defaultCallHandler: DefaultCallHandler = DefaultCallHandler()
|
|
45
|
-
var businessCallHandler: BusinessCallHandler? = null
|
|
46
|
-
var jsbMockInterceptor : BridgeMockInterceptor? = null // for JSB Mock
|
|
47
|
-
var platform: BridgePlatformType = BridgePlatformType.ALL
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* force on context error, only record view level message in jsbExtension
|
|
52
|
-
*/
|
|
53
|
-
val errorReportModel: JSBErrorReportModel = JSBErrorReportModel()
|
|
54
|
-
|
|
55
|
-
fun registerProtocol(protocol: IBridgeProtocol){
|
|
56
|
-
protocols.add(protocol)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
fun getNamespace() = businessCallHandler?.nameSpace
|
|
60
|
-
|
|
61
|
-
fun shouldHandleWithBusinessHandler(call: BridgeCall): Boolean {
|
|
62
|
-
return if (businessCallHandler != null && (call.nameSpace == getNamespace() || call.nameSpace.isEmpty())) {
|
|
63
|
-
businessCallHandler?.getBridge(this, call.bridgeName) != null
|
|
64
|
-
} else false
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
fun registerIBridgeLifeClient(bridgeLifeClient: IBridgeLifeClient) {
|
|
68
|
-
bridgeLifeClientImp.registerIBridgeLifeClient(bridgeLifeClient)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
fun getCurrentUrl() : String? {
|
|
72
|
-
return this.lynxView?.templateUrl ?: this.lynxBackgroundRuntime?.lastScriptUrl
|
|
73
|
-
}
|
|
74
|
-
}
|
package/android/src/main/java/com/tiktok/sparkling/method/protocol/DefaultBridgeClientImp.kt
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2022 TikTok Pte. Ltd.
|
|
2
|
-
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
|
-
// LICENSE file in the root directory of this source tree.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
package com.tiktok.sparkling.method.protocol
|
|
7
|
-
|
|
8
|
-
import com.tiktok.sparkling.method.protocol.entity.BridgeCall
|
|
9
|
-
import com.tiktok.sparkling.method.protocol.entity.BridgeResult
|
|
10
|
-
import com.tiktok.sparkling.method.protocol.interfaces.IBridgeClient
|
|
11
|
-
import com.tiktok.sparkling.method.protocol.interfaces.IBridgeHandler
|
|
12
|
-
import com.tiktok.sparkling.method.protocol.interfaces.IBridgeProtocol
|
|
13
|
-
import com.tiktok.sparkling.method.protocol.utils.LogUtils
|
|
14
|
-
import org.json.JSONObject
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* default implementation
|
|
18
|
-
*/
|
|
19
|
-
class DefaultBridgeClientImp(val bridgeContext: BridgeContext): IBridgeClient {
|
|
20
|
-
private val TAG = "DefaultBridgeClientImp"
|
|
21
|
-
|
|
22
|
-
override fun shouldInterceptRequest(call: BridgeCall): BridgeResult? {
|
|
23
|
-
// TODO: implement by injection
|
|
24
|
-
return null
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
override fun onBridgeInvoked(protocol: IBridgeProtocol, detail: JSONObject) {
|
|
28
|
-
// FIXME pending
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
override fun onBridgeDispatched(call: BridgeCall) {
|
|
32
|
-
LogUtils.e(TAG, "onBridgeCallback: bridgeName: ${call.bridgeName}")
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
override fun onBridgeResultReceived(name: String, handler: IBridgeHandler, detail: JSONObject) {
|
|
36
|
-
LogUtils.e(TAG, "onBridgeCallback: bridgeName: $name")
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
override fun onBridgeCallback() {
|
|
40
|
-
LogUtils.e(TAG, "onBridgeCallback")
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override fun onBridgeRejected() {
|
|
44
|
-
LogUtils.e(TAG, "onBridgeRejected")
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|