Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 1.6.0 (unreleased)
## 1.6.0

* Remove internal SQLDelight and SQLiter dependencies.
* Add `rawConnection` getter to `ConnectionContext`, which is a `SQLiteConnection` instance from
Expand Down
3 changes: 0 additions & 3 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.powersync.plugins.sonatype.setupGithubRepository
import com.powersync.plugins.utils.powersyncTargets

plugins {
Expand Down Expand Up @@ -50,8 +49,6 @@ android {
}
}

setupGithubRepository()

dokka {
moduleName.set("PowerSync Compose")
}
3 changes: 0 additions & 3 deletions connectors/supabase/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.powersync.plugins.sonatype.setupGithubRepository
import com.powersync.plugins.utils.powersyncTargets
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

Expand Down Expand Up @@ -52,8 +51,6 @@ android {
}
}

setupGithubRepository()

dokka {
moduleName.set("PowerSync Supabase Connector")
}
2 changes: 0 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.powersync.plugins.sonatype.setupGithubRepository
import com.powersync.plugins.utils.powersyncTargets
import de.undercouch.gradle.tasks.download.Download
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
Expand Down Expand Up @@ -294,7 +293,6 @@ tasks.withType<KotlinTest> {
showStackTraces = true
}
}
setupGithubRepository()

dokka {
moduleName.set("PowerSync Core")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ development=true
RELEASE_SIGNING_ENABLED=true
# Library config
GROUP=com.powersync
LIBRARY_VERSION=1.5.1
LIBRARY_VERSION=1.6.0
GITHUB_REPO=https://github.com/powersync-ja/powersync-kotlin.git
# POM
POM_URL=https://github.com/powersync-ja/powersync-kotlin/
Expand Down
3 changes: 0 additions & 3 deletions integrations/room/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import com.powersync.plugins.sonatype.setupGithubRepository
import com.powersync.plugins.utils.powersyncTargets
import org.jmailen.gradle.kotlinter.tasks.FormatTask
import org.jmailen.gradle.kotlinter.tasks.LintTask
Expand Down Expand Up @@ -96,8 +95,6 @@ android {
}
}

setupGithubRepository()

dokka {
moduleName.set("PowerSync Room Integration")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,8 @@ package com.powersync.plugins.sonatype

import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import java.net.URI

internal inline val Project.gradlePublishing: PublishingExtension
get() = extensions.getByType(PublishingExtension::class.java)

internal fun Project.findOptionalProperty(propertyName: String) = findProperty(propertyName)?.toString()


/** Sets up repository for publishing to Github Packages to GITHUB_REPO property
* username and password (a personal Github access token) should be specified as
* `GITHUB_PUBLISH_USER` and `GITHUB_PUBLISH_TOKEN` gradle properties
*/
@Suppress("unused")
public fun Project.setupGithubRepository() {
gradlePublishing.apply {
val githubRepo = githubRepoOrNull ?: return

val githubPublishToken =
githubPublishTokenOrNull ?: return
val githubPublishUser = project.githubPublishUser ?: "cirunner"

repositories.maven {
it.name = "githubPackages"
it.url = URI.create("https://maven.pkg.github.com/$githubRepo")
it.credentials { cred ->
cred.username = githubPublishUser
cred.password = githubPublishToken
}
}
}
}

internal val Project.githubPublishUser: String?
get() = project.findOptionalProperty("GITHUB_PUBLISH_USER")

internal val Project.githubPublishTokenOrNull: String?
get() = project.findOptionalProperty("GITHUB_PUBLISH_TOKEN")

internal val Project.githubRepoOrNull: String?
get() {
val repo = findOptionalProperty("GITHUB_REPO") ?: return null
val repoWithoutGitSuffix = repo.removeSuffix(".git")
val regex = Regex("((.*)[/:])?(?<owner>[^:/]+)/(?<repo>[^/]+)")
val matchResult = regex.matchEntire(repoWithoutGitSuffix)
if (matchResult != null) {
return (matchResult.groups["owner"]!!.value + "/" + matchResult.groups["repo"]!!.value)
} else {
throw IllegalArgumentException("Incorrect Github repository path, should be \"Owner/Repo\"")
}
}
3 changes: 0 additions & 3 deletions static-sqlite-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import com.powersync.compile.CreateSqliteCInterop
import com.powersync.compile.CreateStaticLibrary
import com.powersync.compile.UnzipSqlite
import java.io.File
import com.powersync.plugins.sonatype.setupGithubRepository
import com.powersync.plugins.utils.powersyncTargets
import de.undercouch.gradle.tasks.download.Download
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
Expand Down Expand Up @@ -103,5 +102,3 @@ kotlin {
}
}
}

setupGithubRepository()
Loading