sparkling-method 2.0.0-rc.2 → 2.0.0-rc.6

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.
@@ -6,6 +6,7 @@ plugins {
6
6
  alias(libs.plugins.android.library)
7
7
  alias(libs.plugins.kotlin.android)
8
8
  id("maven-publish")
9
+ id("signing")
9
10
  jacoco
10
11
  }
11
12
 
@@ -44,6 +45,10 @@ android {
44
45
  all {
45
46
  it.jvmArgs("-Xmx2048m", "-XX:MaxMetaspaceSize=512m")
46
47
  it.systemProperty("robolectric.logging.enabled", "true")
48
+ it.systemProperty(
49
+ "user.home",
50
+ buildDir.resolve("robolectric-home").absolutePath
51
+ )
47
52
  }
48
53
  }
49
54
  }
@@ -73,6 +78,12 @@ dependencies {
73
78
  api("com.google.code.gson:gson:2.8.9")
74
79
  }
75
80
 
81
+ tasks.withType<Test>().configureEach {
82
+ doFirst {
83
+ buildDir.resolve("robolectric-home").mkdirs()
84
+ }
85
+ }
86
+
76
87
  tasks.register<JacocoReport>("jacocoTestReport") {
77
88
  dependsOn(tasks.named("testDebugUnitTest"))
78
89
 
@@ -120,7 +131,7 @@ val publishingGroupId = (findProperty("SPARKLING_PUBLISHING_GROUP_ID") as? Strin
120
131
  ?: "com.tiktok.sparkling"
121
132
  val publishingVersion = (findProperty("SPARKLING_PUBLISHING_VERSION") as? String)
122
133
  ?: System.getenv("SPARKLING_PUBLISHING_VERSION")
123
- ?: "1.0.0"
134
+ ?: "2.0.0"
124
135
 
125
136
  val androidSourcesJar by tasks.register<Jar>("androidSourcesJar") {
126
137
  archiveClassifier.set("sources")
@@ -146,8 +157,89 @@ afterEvaluate {
146
157
  pom {
147
158
  name.set("sparkling-method")
148
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
+ ?: ""
149
201
  }
150
202
  }
151
203
  }
152
204
  }
153
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 +1 @@
1
- SPARKLING_PUBLISHING_VERSION=2.0.0
1
+ SPARKLING_PUBLISHING_VERSION=2.0.0-rc.5
@@ -5,9 +5,6 @@
5
5
 
6
6
  package com.tiktok.sparkling.method.registry.core.annotation
7
7
 
8
- /**
9
- * Desc:
10
- */
11
8
  @Target(AnnotationTarget.FIELD)
12
9
  @Retention(AnnotationRetention.RUNTIME)
13
10
  annotation class IDLMethodName(
@@ -5,9 +5,6 @@
5
5
 
6
6
  package com.tiktok.sparkling.method.registry.core.annotation
7
7
 
8
- /**
9
- * Desc:
10
- */
11
8
  @Target(AnnotationTarget.CLASS)
12
9
  @Retention(AnnotationRetention.RUNTIME)
13
10
  annotation class IDLMethodParamModel()
@@ -5,9 +5,6 @@
5
5
 
6
6
  package com.tiktok.sparkling.method.registry.core.annotation
7
7
 
8
- /**
9
- * Desc:
10
- */
11
8
  @Target(AnnotationTarget.CLASS)
12
9
  @Retention(AnnotationRetention.RUNTIME)
13
10
  annotation class IDLMethodResultModel()
@@ -1,13 +1,16 @@
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}"] } }
4
6
  s.name = 'SparklingMethod'
5
- s.version = "2.0.0"
7
+ s.version = "2.0.0-rc.6"
6
8
  s.summary = "iOS SDK for Sparkling Method"
7
- s.description = "iOS SDK for Sparkling Method"
9
+ s.description = "Core iOS method runtime for Sparkling, with Lynx integration, dependency injection support, and debug helpers."
8
10
  s.license = "Apache 2.0"
9
11
  s.author = "zhangyujie"
10
12
  s.homepage = 'https://github.com/tiktok/sparkling.git'
13
+ s.readme = 'packages/sparkling-method/README.md'
11
14
  s.platforms = {
12
15
  :ios => '12.0'
13
16
  }
@@ -21,44 +24,44 @@ Pod::Spec.new do |s|
21
24
  }
22
25
 
23
26
  s.subspec 'Core' do |core|
24
- core.source_files = [
27
+ core.source_files = source_globs.call([
25
28
  'Sources/Core/Definitions/*.{h,m,swift}',
26
29
  'Sources/Core/Pipe/*.{h,m,swift}',
27
30
  'Sources/Core/Models/*.{h,m,swift}',
28
31
  'Sources/Core/Protocols/*.{h,m,swift}',
29
32
  'Sources/Core/Utils/*.{h,m,swift}',
30
33
  'Sources/Core/DI/**/*.{h,m,swift}',
31
- ]
34
+ ])
32
35
  core.dependency 'Mantle', '~> 2.2.0'
33
36
  end
34
37
 
35
38
  s.subspec 'Lynx' do |lynx|
36
- lynx.source_files = [
39
+ lynx.source_files = source_globs.call([
37
40
  'Sources/Lynx/Pipe/*.{h,m,swift}',
38
41
  'Sources/Lynx/Engine/*.{h,m,swift}',
39
42
  'Sources/Lynx/Definitions/*.{h,m,swift}',
40
43
  'Sources/Lynx/Module/*.{h,m,swift}',
41
44
  'Sources/Lynx/Models/*.{h,m,swift}',
42
- ]
45
+ ])
43
46
 
44
47
  lynx.dependency 'SparklingMethod/Core'
45
- lynx.dependency 'Lynx/Framework', '>=3.4.2'
48
+ lynx.dependency 'Lynx/Framework', '3.6.0'
46
49
  lynx.dependency 'PrimJS/quickjs', '>=2.12.0'
47
50
  lynx.dependency 'PrimJS/napi', '>=2.12.0'
48
51
  end
49
52
 
50
53
  s.subspec 'DIProvider' do |di|
51
- di.source_files = [
54
+ di.source_files = source_globs.call([
52
55
  'Sources/DIProvider/**/*.{h,m,swift}',
53
- ]
56
+ ])
54
57
 
55
58
  di.dependency 'SparklingMethod/Core'
56
59
  end
57
60
 
58
61
  s.subspec 'Debug' do |de|
59
- de.source_files = [
62
+ de.source_files = source_globs.call([
60
63
  'Sources/Debug/**/*.{h,m,swift}',
61
- ]
64
+ ])
62
65
 
63
66
  de.dependency 'SparklingMethod/Core'
64
67
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparkling-method",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.6",
4
4
  "homepage": "",
5
5
  "repository": {
6
6
  "type": "git",