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

Commit 6771b16

Browse files
committed
publishing
1 parent 10adcd0 commit 6771b16

File tree

10 files changed

+70
-15
lines changed

10 files changed

+70
-15
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Krzysztof Borowy
3+
Copyright (c) 2023 Krzysztof Borowy
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

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

33
Multiplatform sqlite storage for React Native AsyncStorage
44

5+
## Usage
6+
7+
```groovy
8+
implementation("io.github.react-native-async-storage:sqlite-storage:VERSION")
9+
```
10+
511
## Testing
612

713
Gradle tasks to run tests:

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ test-turbine = { module = "app.cash.turbine:turbine", version = "0.12.1" }
2828
gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
2929
gradlePlugin-testLogger = { module = "com.adarshr:gradle-test-logger-plugin", version = "3.2.0" }
3030
gradlePlugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
31+
gradlePlugin-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.27.0" }
3132

3233
[bundles]
3334
common-test = [

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
{
2-
"name": "@react-native-async-storage/sqlite-storage-native",
3-
"version": "0.0.0",
2+
"name": "Async Storage Sqlite",
3+
"private": true,
4+
"version": "0.0.1",
45
"description": "Multiplatform sqlite storage for React Native AsyncStorage",
5-
"main": "lib/commonjs/index.js",
6-
"module": "lib/module/index.js",
7-
"react-native": "src/index.ts",
8-
"types": "lib/typescript/index.d.ts",
96
"repository": {
107
"url": "https://github.com/react-native-async-storage/sqlite-storage.git",
118
"owner": "react-native-async-storage",
129
"name": "sqlite-storage"
1310
},
11+
"author": "Krzysztof Borowy <contact@kborowy.com>",
12+
"homepage": "https://github.com/react-native-async-storage/sqlite-storage",
13+
"license": "MIT",
14+
"main": "lib/commonjs/index.js",
15+
"module": "lib/module/index.js",
16+
"react-native": "src/index.ts",
17+
"types": "lib/typescript/index.d.ts",
1418
"files": [
1519
"src",
1620
"lib",
1721
"nativeLib",
1822
"AsyncStorageSqlite.podspec"
1923
],
20-
"author": "Krzysztof Borowy <contact@kborowy.com>",
21-
"license": "MIT",
22-
"homepage": "https://github.com/react-native-async-storage/sqlite-storage",
24+
2325
"packageManager": "yarn@4.0.2",
2426
"scripts": {
2527
"build": "yarn build:js && yarn build:native",

samples/android/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ dependencies {
3636
implementation("com.google.android.material:material:1.4.0")
3737
implementation("androidx.appcompat:appcompat:1.3.1")
3838
implementation("androidx.constraintlayout:constraintlayout:2.1.0")
39-
implementation ("androidx.activity:activity-compose:1.4.0")
39+
implementation("androidx.activity:activity-compose:1.4.0")
4040
implementation("androidx.compose.ui:ui:1.5.4")
4141
implementation("androidx.compose.foundation:foundation:1.5.4")
42-
implementation ("androidx.compose.material:material:1.5.4")
42+
implementation("androidx.compose.material:material:1.5.4")
4343
}

samples/android/src/main/java/com/asyncstorage/sqlite/android/example/MainActivity.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import androidx.activity.compose.setContent
55
import androidx.appcompat.app.AppCompatActivity
66
import com.asyncstorage.sqlite.android.example.ui.MainScreen
77
import org.asyncstorage.sqlitestorage.SqliteStorage
8+
import org.asyncstorage.sqlitestorage.SqliteStorageFactory
89

910
class MainActivity : AppCompatActivity() {
1011
lateinit var db: SqliteStorage
1112

1213
override fun onCreate(savedInstanceState: Bundle?) {
1314
super.onCreate(savedInstanceState)
14-
db = StorageFactory(this).create("my_db")
15+
db = SqliteStorageFactory(this).create("my_db")
1516
setContent {
1617
MainScreen(db)
1718
}

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencyResolutionManagement {
1414
}
1515
}
1616

17-
rootProject.name = "SqliteStorage"
17+
rootProject.name = "AsyncStorageSqlite"
1818
include(":sqlite-storage")
1919
include(":sample-android")
2020
project(":sample-android").projectDir = File(rootDir, "samples/android")

sqlite-storage-plugin/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ dependencies {
3535
implementation(libs.gradlePlugin.testLogger)
3636
implementation(libs.gradlePlugin.kotlin)
3737
implementation(libs.gradlePlugin.spotless)
38+
implementation(libs.gradlePlugin.publish)
3839
implementation(libs.gson)
3940
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.asyncstorage.sqlite.plugin
2+
3+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
4+
import com.vanniktech.maven.publish.SonatypeHost
5+
import org.asyncstorage.sqlite.plugin.extensions.PackageInfoExtension
6+
import org.gradle.api.Project
7+
import org.gradle.api.plugins.ExtensionAware
8+
import org.gradle.kotlin.dsl.configure
9+
10+
11+
// todo: configure task for easier publishing
12+
fun Project.configurePublish(info: PackageInfoExtension) {
13+
(project as ExtensionAware).extensions.configure<MavenPublishBaseExtension> {
14+
publishToMavenCentral(SonatypeHost.S01)
15+
signAllPublications()
16+
17+
coordinates(
18+
groupId = "io.github.react-native-async-storage",
19+
artifactId = "sqlite-storage",
20+
version = info.version
21+
)
22+
pom {
23+
name.set(info.name)
24+
description.set(info.description)
25+
inceptionYear.set("2023")
26+
url.set(info.repoUrl)
27+
licenses {
28+
license {
29+
name.set("MIT")
30+
url.set("https://github.com/react-native-async-storage/sqlite-storage/blob/main/LICENSE.md")
31+
}
32+
}
33+
developers {
34+
developer {
35+
name.set("Krzysztof Borowy")
36+
url.set("https://github.com/krizzu")
37+
}
38+
}
39+
}
40+
}
41+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import org.gradle.api.Project
55
import java.io.File
66

77
data class PackageJsonContent(
8+
var name: String,
89
var version: String,
910
val description: String,
1011
val homepage: String,
@@ -24,9 +25,11 @@ data class PackageJsonContent(
2425
* package.json in root.
2526
*/
2627
abstract class PackageInfoExtension(private val pckJson: PackageJsonContent) {
27-
val group = "org.asyncstorage"
28+
val group = "org.asyncstorage.sqlitestorage"
2829
val version: String
2930
get() = pckJson.version
31+
val name: String
32+
get() = pckJson.name
3033
val description: String
3134
get() = pckJson.description
3235
val homepage: String

0 commit comments

Comments
 (0)