Skip to content

Commit

Permalink
publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
krizzu committed Jan 11, 2024
1 parent 8c05bab commit c12ec5f
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 14 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Krzysztof Borowy
Copyright (c) 2023 Krzysztof Borowy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Multiplatform sqlite storage for React Native AsyncStorage

## Usage

```groovy
implementation("io.github.react-native-async-storage:sqlite-storage:VERSION")
```

## Testing

Gradle tasks to run tests:
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test-turbine = { module = "app.cash.turbine:turbine", version = "0.12.1" }
gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradlePlugin-testLogger = { module = "com.adarshr:gradle-test-logger-plugin", version = "3.2.0" }
gradlePlugin-spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" }
gradlePlugin-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.27.0" }

[bundles]
common-test = [
Expand Down
20 changes: 11 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
{
"name": "@react-native-async-storage/sqlite-storage-native",
"version": "0.0.0",
"name": "Async Storage Sqlite",
"private": true,
"version": "0.0.1",
"description": "Multiplatform sqlite storage for React Native AsyncStorage",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.ts",
"types": "lib/typescript/index.d.ts",
"repository": {
"url": "https://github.com/react-native-async-storage/sqlite-storage.git",
"owner": "react-native-async-storage",
"name": "sqlite-storage"
},
"author": "Krzysztof Borowy <contact@kborowy.com>",
"homepage": "https://github.com/react-native-async-storage/sqlite-storage",
"license": "MIT",
"main": "lib/commonjs/index.js",
"module": "lib/module/index.js",
"react-native": "src/index.ts",
"types": "lib/typescript/index.d.ts",
"files": [
"src",
"lib",
"nativeLib",
"AsyncStorageSqlite.podspec"
],
"author": "Krzysztof Borowy <contact@kborowy.com>",
"license": "MIT",
"homepage": "https://github.com/react-native-async-storage/sqlite-storage",

"packageManager": "yarn@4.0.2",
"scripts": {
"build": "yarn build:js && yarn build:native",
Expand Down
4 changes: 2 additions & 2 deletions samples/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ dependencies {
implementation("com.google.android.material:material:1.4.0")
implementation("androidx.appcompat:appcompat:1.3.1")
implementation("androidx.constraintlayout:constraintlayout:2.1.0")
implementation ("androidx.activity:activity-compose:1.4.0")
implementation("androidx.activity:activity-compose:1.4.0")
implementation("androidx.compose.ui:ui:1.5.4")
implementation("androidx.compose.foundation:foundation:1.5.4")
implementation ("androidx.compose.material:material:1.5.4")
implementation("androidx.compose.material:material:1.5.4")
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencyResolutionManagement {
}
}

rootProject.name = "SqliteStorage"
rootProject.name = "AsyncStorageSqlite"
include(":sqlite-storage")
include(":sample-android")
project(":sample-android").projectDir = File(rootDir, "samples/android")
Expand Down
1 change: 1 addition & 0 deletions sqlite-storage-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ dependencies {
implementation(libs.gradlePlugin.testLogger)
implementation(libs.gradlePlugin.kotlin)
implementation(libs.gradlePlugin.spotless)
implementation(libs.gradlePlugin.publish)
implementation(libs.gson)
}
42 changes: 42 additions & 0 deletions sqlite-storage-plugin/src/main/kotlin/ConfigurePublish.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.asyncstorage.sqlite.plugin

import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.asyncstorage.sqlite.plugin.extensions.PackageInfoExtension
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure


// todo: configure task for easier publishing
// todo: setup GH actions for publishing (secrets): https://vanniktech.github.io/gradle-maven-publish-plugin/central/#secrets
fun Project.configurePublish(info: PackageInfoExtension) {
(project as ExtensionAware).extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()

coordinates(
groupId = "io.github.react-native-async-storage",
artifactId = "sqlite-storage",
version = info.version
)
pom {
name.set(info.name)
description.set(info.description)
inceptionYear.set("2023")
url.set(info.repoUrl)
licenses {
license {
name.set("MIT")
url.set("https://github.com/react-native-async-storage/sqlite-storage/blob/main/LICENSE.md")
}
}
developers {
developer {
name.set("Krzysztof Borowy")
url.set("https://github.com/krizzu")
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.gradle.api.Project
import java.io.File

data class PackageJsonContent(
var name: String,
var version: String,
val description: String,
val homepage: String,
Expand All @@ -24,9 +25,11 @@ data class PackageJsonContent(
* package.json in root.
*/
abstract class PackageInfoExtension(private val pckJson: PackageJsonContent) {
val group = "org.asyncstorage"
val group = "org.asyncstorage.sqlitestorage"
val version: String
get() = pckJson.version
val name: String
get() = pckJson.name
val description: String
get() = pckJson.description
val homepage: String
Expand Down

0 comments on commit c12ec5f

Please sign in to comment.