Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.

Commit 1336687

Browse files
committed
linting
1 parent 16f7e80 commit 1336687

File tree

7 files changed

+32
-45
lines changed

7 files changed

+32
-45
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
]
4141
},
4242
"devDependencies": {
43-
"react": "18.2.0",
4443
"react-native": "0.72.7",
4544
"react-native-builder-bob": "0.23.2",
4645
"typescript": "5.3.2"
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
package org.asyncstorage.sqlite.plugin
22

33
import org.asyncstorage.sqlite.plugin.extensions.BundleExtension
4-
import org.asyncstorage.sqlite.plugin.tasks.SqliteStorageAndroidBundleTask
5-
import org.asyncstorage.sqlite.plugin.tasks.SqliteStorageIosBundleTask
4+
import org.asyncstorage.sqlite.plugin.tasks.AndroidBundleTask
5+
import org.asyncstorage.sqlite.plugin.tasks.IosBundleTask
66
import org.gradle.api.Project
77
import org.gradle.api.tasks.TaskProvider
88
import org.gradle.kotlin.dsl.register
99

10-
1110
private const val BUNDLE_TASK_NAME = "bundleSqliteStorage"
1211

1312
fun Project.configureBundle(bundleConfig: BundleExtension) {
1413
val androidBundle = configureAndroidBundle(bundleConfig)
1514
val iosBundle = configureIosBundle(bundleConfig)
1615

17-
1816
tasks.register(BUNDLE_TASK_NAME) {
1917
group = PLUGIN_GROUP
2018
description = "Builds final binaries for supported platforms"
@@ -23,13 +21,13 @@ fun Project.configureBundle(bundleConfig: BundleExtension) {
2321
}
2422
}
2523

26-
27-
private fun Project.configureIosBundle(bundleConfig: BundleExtension): TaskProvider<SqliteStorageIosBundleTask> {
28-
val iosBundleTask = tasks.register<SqliteStorageIosBundleTask>("${BUNDLE_TASK_NAME}Ios") {
29-
outputDir.set(bundleConfig.outputDir)
30-
outputFrameworkName.set(bundleConfig.binaryName)
31-
sourceFramework.set(project.layout.buildDirectory.dir("XCFrameworks/release/SqliteStorage.xcframework"))
32-
}
24+
private fun Project.configureIosBundle(bundleConfig: BundleExtension): TaskProvider<IosBundleTask> {
25+
val iosBundleTask =
26+
tasks.register<IosBundleTask>("${BUNDLE_TASK_NAME}Ios") {
27+
outputDir.set(bundleConfig.outputDir)
28+
outputFrameworkName.set(bundleConfig.binaryName)
29+
sourceFramework.set(project.layout.buildDirectory.dir("XCFrameworks/release/SqliteStorage.xcframework"))
30+
}
3331

3432
afterEvaluate {
3533
iosBundleTask.configure {
@@ -40,10 +38,9 @@ private fun Project.configureIosBundle(bundleConfig: BundleExtension): TaskProvi
4038
return iosBundleTask
4139
}
4240

43-
44-
private fun Project.configureAndroidBundle(bundleConfig: BundleExtension): TaskProvider<SqliteStorageAndroidBundleTask> {
41+
private fun Project.configureAndroidBundle(bundleConfig: BundleExtension): TaskProvider<AndroidBundleTask> {
4542
val androidBundleTask =
46-
tasks.register<SqliteStorageAndroidBundleTask>("${BUNDLE_TASK_NAME}Android") {
43+
tasks.register<AndroidBundleTask>("${BUNDLE_TASK_NAME}Android") {
4744
outputDir.set(bundleConfig.outputDir)
4845
outputAarName.set(bundleConfig.binaryName)
4946
sourceAar.set(project.layout.buildDirectory.file("outputs/aar/sqlite-storage-release.aar"))
@@ -56,5 +53,3 @@ private fun Project.configureAndroidBundle(bundleConfig: BundleExtension): TaskP
5653

5754
return androidBundleTask
5855
}
59-
60-

sqlite-storage-plugin/src/main/kotlin/extensions/BundleExtension.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import org.gradle.api.file.DirectoryProperty
55
import org.gradle.api.provider.Property
66
import javax.inject.Inject
77

8-
abstract class BundleExtension(@Inject private val project: Project) {
8+
abstract class BundleExtension(
9+
@Inject private val project: Project,
10+
) {
911
val outputDir: DirectoryProperty = project.objects.directoryProperty()
10-
11-
1212
val binaryName: Property<String> = project.objects.property(String::class.java)
1313
}

sqlite-storage-plugin/src/main/kotlin/extensions/PackageInfoExtension.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ abstract class PackageInfoExtension(private val pckJson: PackageJsonContent) {
2727
val group = "org.asyncstorage"
2828
val version: String
2929
get() = pckJson.version
30-
3130
val description: String
3231
get() = pckJson.description
3332
val homepage: String

sqlite-storage-plugin/src/main/kotlin/tasks/AndroidBundleTask.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.gradle.api.tasks.InputFile
1010
import org.gradle.api.tasks.OutputDirectory
1111
import org.gradle.api.tasks.TaskAction
1212

13-
internal abstract class SqliteStorageAndroidBundleTask : DefaultTask() {
13+
internal abstract class AndroidBundleTask : DefaultTask() {
1414
override fun getGroup() = PLUGIN_GROUP
1515

1616
override fun getDescription() = "Creates release AAR and moves it to output dir"
@@ -30,13 +30,14 @@ internal abstract class SqliteStorageAndroidBundleTask : DefaultTask() {
3030
if (!aar.exists()) {
3131
throw IllegalStateException("AAR file not built")
3232
}
33-
val finalAarName = outputAarName.get().let { currentName ->
34-
if (currentName.endsWith(".aar")) {
35-
currentName
36-
} else {
37-
"${currentName}.aar"
33+
val finalAarName =
34+
outputAarName.get().let { currentName ->
35+
if (currentName.endsWith(".aar")) {
36+
currentName
37+
} else {
38+
"$currentName.aar"
39+
}
3840
}
39-
}
4041

4142
aar.copyTo(target = outputDir.file(finalAarName).get().asFile, overwrite = true)
4243
}

sqlite-storage-plugin/src/main/kotlin/tasks/IosBundleTask.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.gradle.api.tasks.InputDirectory
99
import org.gradle.api.tasks.OutputDirectory
1010
import org.gradle.api.tasks.TaskAction
1111

12-
internal abstract class SqliteStorageIosBundleTask : DefaultTask() {
12+
internal abstract class IosBundleTask : DefaultTask() {
1313
override fun getGroup() = PLUGIN_GROUP
1414

1515
override fun getDescription() = "Creates release XCFramework and moves it to output dir"
@@ -29,15 +29,18 @@ internal abstract class SqliteStorageIosBundleTask : DefaultTask() {
2929
if (!framework.exists()) {
3030
throw IllegalStateException("XCFramework not found at ${framework.absolutePath}")
3131
}
32-
val finalName: String = outputFrameworkName.get().let { name ->
33-
if (name.endsWith(".xcframework")) name
34-
else "${name}.xcframework"
35-
}
36-
32+
val finalName: String =
33+
outputFrameworkName.get().let { name ->
34+
if (name.endsWith(".xcframework")) {
35+
name
36+
} else {
37+
"$name.xcframework"
38+
}
39+
}
3740

3841
framework.copyRecursively(
3942
target = outputDir.file(finalName).get().asFile,
40-
overwrite = true
43+
overwrite = true,
4144
)
4245
}
4346
}

yarn.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,6 @@ __metadata:
18631863
version: 0.0.0-use.local
18641864
resolution: "@react-native-async-storage/sqlite-storage@workspace:."
18651865
dependencies:
1866-
react: "npm:18.2.0"
18671866
react-native: "npm:0.72.7"
18681867
react-native-builder-bob: "npm:0.23.2"
18691868
typescript: "npm:5.3.2"
@@ -5672,15 +5671,6 @@ __metadata:
56725671
languageName: node
56735672
linkType: hard
56745673

5675-
"react@npm:18.2.0":
5676-
version: 18.2.0
5677-
resolution: "react@npm:18.2.0"
5678-
dependencies:
5679-
loose-envify: "npm:^1.1.0"
5680-
checksum: b562d9b569b0cb315e44b48099f7712283d93df36b19a39a67c254c6686479d3980b7f013dc931f4a5a3ae7645eae6386b4aa5eea933baa54ecd0f9acb0902b8
5681-
languageName: node
5682-
linkType: hard
5683-
56845674
"readable-stream@npm:^3.4.0":
56855675
version: 3.6.2
56865676
resolution: "readable-stream@npm:3.6.2"

0 commit comments

Comments
 (0)