sparkling-debug-tool 2.1.0-rc.20 → 2.1.0-rc.24

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.
@@ -23,7 +23,7 @@ android {
23
23
  isMinifyEnabled = false
24
24
  proguardFiles(
25
25
  getDefaultProguardFile("proguard-android-optimize.txt"),
26
- "proguard-rules.pro"
26
+ "proguard-rules.pro",
27
27
  )
28
28
  }
29
29
  }
@@ -43,16 +43,22 @@ dependencies {
43
43
  implementation(libs.lynx.devtool)
44
44
  }
45
45
 
46
- val publishingGroupId = (findProperty("SPARKLING_PUBLISHING_GROUP_ID") as? String)
47
- ?: System.getenv("SPARKLING_PUBLISHING_GROUP_ID")
48
- ?: "com.tiktok.sparkling"
49
- val publishingVersion = (findProperty("SPARKLING_PUBLISHING_VERSION") as? String)
50
- ?: System.getenv("SPARKLING_PUBLISHING_VERSION")
51
- ?: "2.0.0"
46
+ val publishingGroupId =
47
+ (findProperty("SPARKLING_PUBLISHING_GROUP_ID") as? String)
48
+ ?: System.getenv("SPARKLING_PUBLISHING_GROUP_ID")
49
+ ?: "com.tiktok.sparkling"
50
+ val publishingVersion =
51
+ (findProperty("SPARKLING_PUBLISHING_VERSION") as? String)
52
+ ?: System.getenv("SPARKLING_PUBLISHING_VERSION")
53
+ ?: "2.0.0"
52
54
 
53
55
  val androidSourcesJar by tasks.register<Jar>("androidSourcesJar") {
54
56
  archiveClassifier.set("sources")
55
- from(android.sourceSets.getByName("main").java.srcDirs)
57
+ from(
58
+ android.sourceSets
59
+ .getByName("main")
60
+ .java.srcDirs,
61
+ )
56
62
  }
57
63
 
58
64
  val emptyJavadocJar by tasks.register<Jar>("javadocJar") {
@@ -103,9 +109,10 @@ afterEvaluate {
103
109
  repositories {
104
110
  maven {
105
111
  name = "MavenCentral"
106
- val repoUrl = (findProperty("mavenCentralRepoUrl") as? String)
107
- ?: System.getenv("MAVEN_CENTRAL_REPO_URL")
108
- ?: "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
112
+ val repoUrl =
113
+ (findProperty("mavenCentralRepoUrl") as? String)
114
+ ?: System.getenv("MAVEN_CENTRAL_REPO_URL")
115
+ ?: "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
109
116
  url = uri(repoUrl)
110
117
  credentials {
111
118
  username = (findProperty("mavenCentralUsername") as? String)
@@ -121,12 +128,15 @@ afterEvaluate {
121
128
  }
122
129
 
123
130
  signing {
124
- val signingKeyId = (findProperty("signing.keyId") as? String)
125
- ?: System.getenv("SIGNING_KEY_ID")
126
- val signingPassword = (findProperty("signing.password") as? String)
127
- ?: System.getenv("SIGNING_PASSWORD")
128
- val signingSecretKeyRingFile = (findProperty("signing.secretKeyRingFile") as? String)
129
- ?: System.getenv("SIGNING_SECRET_KEY_RING_FILE")
131
+ val signingKeyId =
132
+ (findProperty("signing.keyId") as? String)
133
+ ?: System.getenv("SIGNING_KEY_ID")
134
+ val signingPassword =
135
+ (findProperty("signing.password") as? String)
136
+ ?: System.getenv("SIGNING_PASSWORD")
137
+ val signingSecretKeyRingFile =
138
+ (findProperty("signing.secretKeyRingFile") as? String)
139
+ ?: System.getenv("SIGNING_SECRET_KEY_RING_FILE")
130
140
  val signingKey = System.getenv("SIGNING_KEY")
131
141
 
132
142
  if (!signingKeyId.isNullOrBlank() && !signingPassword.isNullOrBlank()) {
@@ -146,8 +156,11 @@ signing {
146
156
 
147
157
  afterEvaluate {
148
158
  signing {
149
- val hasSigningConfig = !(System.getenv("SIGNING_KEY_ID").isNullOrBlank() ||
150
- System.getenv("SIGNING_PASSWORD").isNullOrBlank())
159
+ val hasSigningConfig =
160
+ !(
161
+ System.getenv("SIGNING_KEY_ID").isNullOrBlank() ||
162
+ System.getenv("SIGNING_PASSWORD").isNullOrBlank()
163
+ )
151
164
  if (hasSigningConfig) {
152
165
  sign(extensions.getByType<PublishingExtension>().publications["release"])
153
166
  } else {
@@ -26,7 +26,7 @@ object SparklingDebugTool {
26
26
  // service picks them up during initialization.
27
27
  LynxDevToolService.INSTANCE.setLynxDebugPresetValue(true)
28
28
  LynxDevToolService.INSTANCE.setLogBoxPresetValue(true)
29
- LynxDevToolService.INSTANCE.setLoadJsBridge(true)
29
+ LynxDevToolService.INSTANCE.setLoadQJSBridge(true)
30
30
 
31
31
  LynxServiceCenter.inst().registerService(LynxDevToolService.INSTANCE)
32
32
  LynxEnv.inst().enableLynxDebug(true)
@@ -36,16 +36,23 @@ object SparklingDebugTool {
36
36
  }
37
37
 
38
38
  @JvmStatic
39
- fun getDevUrl(context: Context, fallback: String): String {
40
- val stored = context.applicationContext
41
- .getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
42
- .getString(KEY_DEV_URL, null)
43
- ?.trim()
39
+ fun getDevUrl(
40
+ context: Context,
41
+ fallback: String,
42
+ ): String {
43
+ val stored =
44
+ context.applicationContext
45
+ .getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
46
+ .getString(KEY_DEV_URL, null)
47
+ ?.trim()
44
48
  return if (stored.isNullOrEmpty()) fallback else stored
45
49
  }
46
50
 
47
51
  @JvmStatic
48
- fun setDevUrl(context: Context, url: String) {
52
+ fun setDevUrl(
53
+ context: Context,
54
+ url: String,
55
+ ) {
49
56
  context.applicationContext
50
57
  .getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
51
58
  .edit()
@@ -64,25 +71,32 @@ object SparklingDebugTool {
64
71
  return
65
72
  }
66
73
 
67
- val input = EditText(activity).apply {
68
- setText(initialUrl ?: "")
69
- hint = "http://10.0.2.2:5969/main.lynx.bundle"
70
- inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_URI
71
- setSelection(text.length)
72
- }
74
+ val input =
75
+ EditText(activity).apply {
76
+ setText(initialUrl ?: "")
77
+ hint = "http://10.0.2.2:5969/main.lynx.bundle"
78
+ inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_URI
79
+ setSelection(text.length)
80
+ }
73
81
 
74
- val dialog = AlertDialog.Builder(activity)
75
- .setTitle("Set Sparkling Dev URL")
76
- .setMessage("Update the main Lynx bundle URL for debug mode.")
77
- .setView(input)
78
- .setNegativeButton("Cancel", null)
79
- .setPositiveButton("Save", null)
80
- .create()
82
+ val dialog =
83
+ AlertDialog
84
+ .Builder(activity)
85
+ .setTitle("Set Sparkling Dev URL")
86
+ .setMessage("Update the main Lynx bundle URL for debug mode.")
87
+ .setView(input)
88
+ .setNegativeButton("Cancel", null)
89
+ .setPositiveButton("Save", null)
90
+ .create()
81
91
 
82
92
  dialog.setOnShowListener {
83
93
  val saveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE)
84
94
  saveButton.setOnClickListener {
85
- val value = input.text?.toString()?.trim().orEmpty()
95
+ val value =
96
+ input.text
97
+ ?.toString()
98
+ ?.trim()
99
+ .orEmpty()
86
100
  if (value.isEmpty()) {
87
101
  Toast.makeText(activity, "Dev URL cannot be empty", Toast.LENGTH_SHORT).show()
88
102
  return@setOnClickListener
@@ -2,10 +2,10 @@
2
2
  // Licensed under the Apache License Version 2.0 that can be found in the
3
3
  // LICENSE file in the root directory of this source tree.
4
4
 
5
+ import DebugRouter
5
6
  import Foundation
6
7
  import Lynx
7
8
  import UIKit
8
- import DebugRouter
9
9
 
10
10
  @objcMembers
11
11
  public class SparklingDebugTool: NSObject {
@@ -14,9 +14,10 @@ public class SparklingDebugTool: NSObject {
14
14
  public static func setup() {
15
15
  // Preset values must be set BEFORE LynxEnv flags so the DevTool
16
16
  // service picks them up during initialization.
17
-
18
- if let devtool = LynxServices.getInstanceWith(LynxServiceDevToolProtocol.self)
19
- as? LynxServiceDevToolProtocol {
17
+
18
+ if let devtool = LynxServices.getInstanceWith(LynxServiceDevToolProtocol.self)
19
+ as? LynxServiceDevToolProtocol
20
+ {
20
21
  devtool.logBoxPresetValue = true
21
22
  devtool.lynxDebugPresetValue = true
22
23
  }
@@ -64,14 +65,17 @@ public class SparklingDebugTool: NSObject {
64
65
  }
65
66
 
66
67
  alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
67
- alert.addAction(UIAlertAction(title: "Save", style: .default, handler: { _ in
68
- let value = alert.textFields?.first?.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
69
- guard !value.isEmpty else {
70
- return
71
- }
72
- setDevURL(value)
73
- onSaved?(value)
74
- }))
68
+ alert.addAction(
69
+ UIAlertAction(
70
+ title: "Save", style: .default,
71
+ handler: { _ in
72
+ let value = alert.textFields?.first?.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
73
+ guard !value.isEmpty else {
74
+ return
75
+ }
76
+ setDevURL(value)
77
+ onSaved?(value)
78
+ }))
75
79
 
76
80
  viewController.present(alert, animated: true)
77
81
  }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'Sparkling-DebugTool'
3
- s.version = "2.1.0-rc.20"
3
+ s.version = "2.1.0-rc.24"
4
4
  s.summary = "Sparkling debug tool SDK"
5
5
  s.description = "Sparkling debug tool SDK"
6
6
  s.license = { :type => 'Apache-2.0' }
@@ -15,8 +15,8 @@ Pod::Spec.new do |s|
15
15
  'Sources/**/*.{h,m,swift}'
16
16
  ]
17
17
 
18
- s.dependency 'Lynx', '~> 3.6.0'
19
- s.dependency 'LynxService/Devtool', '~> 3.6.0'
20
- s.dependency 'LynxDevtool/Framework', '~> 3.6.0'
18
+ s.dependency 'Lynx'
19
+ s.dependency 'LynxService/Devtool'
20
+ s.dependency 'LynxDevtool/Framework'
21
21
  s.dependency 'DebugRouter'
22
22
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkling-debug-tool",
3
- "version": "2.1.0-rc.20",
3
+ "version": "2.1.0-rc.24",
4
4
  "description": "Sparkling debug tool SDK",
5
5
  "homepage": "https://tiktok.github.io/sparkling/",
6
6
  "repository": {