Skip to content

Commit

Permalink
publishing config (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
sargunv committed Nov 23, 2024
1 parent 24cb3fb commit 12092b3
Show file tree
Hide file tree
Showing 110 changed files with 47 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In your Gradle version catalog, add:
```toml
[libraries]
# ...
maplibre-compose = { module = "dev.sargunv.maplibre:maplibre-compose", version = "0.1.0" }
maplibre-compose = { module = "dev.sargunv:maplibre-compose", version = "0.1.0" }
```

In your Gradle build script, add:
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin.cocoapods) apply false
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
alias(libs.plugins.maven.publish) apply false
}

subprojects {
Expand All @@ -17,6 +18,7 @@ subprojects {
}

spotless {
kotlinGradle { ktfmt().googleStyle() }
format("swift") {
target("iosApp/iosApp/**/*.swift")
nativeCmd("swiftFormat", "/usr/bin/env", listOf("swift", "format"))
Expand All @@ -32,8 +34,4 @@ tasks.register("installGitHooks") {
}
}

tasks.named("clean") {
doLast {
delete("${rootProject.projectDir}/.git/hooks/pre-commit")
}
}
tasks.named("clean") { doLast { delete("${rootProject.projectDir}/.git/hooks/pre-commit") } }
2 changes: 1 addition & 1 deletion demo-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ kotlin {
implementation(compose.material3)
implementation(compose.runtime)
implementation(compose.ui)
implementation(project(":maplibre-compose"))
implementation(project(":lib:maplibre-compose"))
}

androidMain.dependencies { implementation(libs.androidx.activity.compose) }
Expand Down
18 changes: 12 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#Kotlin
kotlin.code.style=official
kotlin.daemon.jvmargs=-Xmx2048M

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8

#Android
android.nonTransitiveRClass=true
android.useAndroidX=true
android.useAndroidX=true
SONATYPE_AUTOMATIC_RELEASE=true
POM_URL="https://github.com/sargunv/maplibre-compose/"
POM_LICENSE_NAME="BSD-3-Clause"
POM_LICENSE_URL="https://opensource.org/license/bsd-3-clause"
POM_LICENSE_DIST=repo
POM_SCM_URL="https://github.com/sargunv/maplibre-compose"
POM_SCM_CONNECTION=scm:git:git://github.com/sargunv/maplibre-compose.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/sargunv/maplibre-compose.git
POM_DEVELOPER_ID=sargunv
POM_DEVELOPER_NAME=Sargun Vohra
POM_DEVELOPER_URL=https://github.com/sargunv/
21 changes: 8 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,27 @@ agp = "8.5.2"
android-compileSdk = "34"
android-minSdk = "24"
android-targetSdk = "34"
androidx-activity-compose = "1.9.3"
compose = "1.7.1"
compose-androidx = "1.7.5"
dokka = "1.9.20"
kermit = "2.0.4"
kotlin = "2.0.21"
maplibre-android = "11.6.1"
maplibre-android-plugins = "3.0.2"
maplibre-ios = "6.8.1"
spatialk-geojson = "0.3.0"
spotless = "7.0.0.BETA4"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity-compose" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version = "1.9.3" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "compose-androidx" }
kermit = { group = "co.touchlab", name = "kermit", version.ref = "kermit" }
maplibre-android = { module = "org.maplibre.gl:android-sdk", version.ref = "maplibre-android" }
kermit = { group = "co.touchlab", name = "kermit", version = "2.0.4" }
maplibre-android = { module = "org.maplibre.gl:android-sdk", version = "11.6.1" }
maplibre-android-plugin-annotation = { module = "org.maplibre.gl:android-plugin-annotation-v9", version.ref = "maplibre-android-plugins" }
spatialk-geojson = { group = "io.github.dellisd.spatialk", name = "geojson", version.ref = "spatialk-geojson" }
spatialk-geojson = { group = "io.github.dellisd.spatialk", name = "geojson", version = "0.3.0" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version = "1.9.20" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
spotless = { id = "com.diffplug.spotless", version = "7.0.0.BETA4" }
1 change: 1 addition & 0 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subprojects { group = "dev.sargunv" }
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@file:OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalComposeLibrary::class)

import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.compose.ExperimentalComposeLibrary
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
Expand All @@ -13,6 +14,7 @@ plugins {
alias(libs.plugins.compose.compiler)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
alias(libs.plugins.maven.publish)
}

version = "0.1.0-SNAPSHOT"
Expand Down Expand Up @@ -40,6 +42,7 @@ kotlin {
androidTarget {
compilerOptions { jvmTarget.set(JvmTarget.JVM_11) }
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
publishLibraryVariants("release")
}
iosArm64()
iosSimulatorArm64()
Expand Down Expand Up @@ -99,4 +102,19 @@ spotless {
}
}

// tasks.get("test").dependsOn("connectedAndroidTest", "iosSimulatorArm64Test")
mavenPublishing {
coordinates(
groupId = "${project.group}",
artifactId = project.name,
version = "${project.version}",
)

pom {
name = "MapLibre Compose"
description = "Add interactive vector tile maps to your Compose app"
url = "https://github.com/sargunv/maplibre-compose"
}

publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()
}
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("UnstableApiUsage")

rootProject.name = "root"
rootProject.name = "maplibre-compose"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

Expand Down Expand Up @@ -31,4 +31,4 @@ dependencyResolutionManagement {
}
}

include(":maplibre-compose", ":demo-app", ":")
include(":lib:maplibre-compose", ":lib", ":demo-app", ":")

0 comments on commit 12092b3

Please sign in to comment.