Skip to content
Open
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
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish
on:
release:
types: [released, prereleased]
jobs:
publish:
name: Release build and publish
runs-on: macOS-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: Publish to MavenCentral
run: ./gradlew publishToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ out/
.settings
.springBeans
.sts4-cache
.kotlin
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repositories {
Then add as a module dependency:
```kotlin
dependencies {
implementation("com.github.iamcalledrob:smooth-rounded-corner-shape:1.0.4")
implementation("io.github.iamcalledrob:smooth-rounded-corner-shape:1.0.5")
}
```

Expand All @@ -57,5 +57,4 @@ Path.smoothRoundedRectangle(smoothing = 0.6f, size = Size(100f, 50f), topLeft =


## Notes
Currently only builds desktop (jvm) and android targets, since androidx.graphics.shapes only supports those targets.
Feel free to make a PR for other platforms if they become supported.
All multiplatform targets are supported.
58 changes: 25 additions & 33 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
kotlin("multiplatform") version "1.9.23"
id("org.jetbrains.compose") version "1.6.11"
id("com.android.library") version "8.2.0"
kotlin("multiplatform") version "2.2.10"
id("org.jetbrains.kotlin.plugin.compose") version "2.2.10"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why the plugin is needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id("org.jetbrains.compose") version "1.8.2"
id("com.android.library") version "8.11.1"

id("signing")
id("com.vanniktech.maven.publish") version "0.29.0"
id("com.vanniktech.maven.publish") version "0.34.0"
}

group = "io.github.iamcalledrob"
version = "1.0.4"
version = "1.0.5"

repositories {
mavenCentral()
Expand All @@ -24,51 +24,52 @@ kotlin {

jvm()
androidTarget()
iosArm64()
iosX64()
iosSimulatorArm64()

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
binaries.executable()
}

applyDefaultHierarchyTemplate()

sourceSets {
commonMain {
dependencies {
implementation("androidx.graphics:graphics-shapes:1.0.1")
implementation("androidx.graphics:graphics-shapes:1.1.0-beta01")
implementation(compose.foundation)
}
}

// Leaving some hope that androidx.graphics:graphics-shape may eventually support
// non-desktop multiplatform targets too.
val nonAndroidMain by creating {
dependsOn(commonMain.get())
}

jvmMain.get().dependsOn(nonAndroidMain)
iosMain.get().dependsOn(nonAndroidMain)
wasmJsMain.get().dependsOn(nonAndroidMain)
}
}

android {
namespace = "io.github.iamcalledrob.smoothRoundedCornerShape"
compileSdk = 34
compileSdk = 36
}



// --- Signing + Publishing ---
//
// Make sure the following are accessible via gradle.properties.
// If they are missing or invalid, expect cryptic and misleading errors.
// Ideally in ~/.gradle/gradle.properties so it's not checked in to source control:
// - signing.gnupg.keyId,
// - signing.gnupg.password
// - signing.gnupg.secretKeyRingFile
// - mavenCentralUsername
// - mavenCentralPassword

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not apply anymore now that the publishing happens via CI/CD

val githubAccount = "iamcalledrob"
val githubRepository = "smooth-rounded-corner-shape"
val githubUrl = "https://github.com/$githubAccount/$githubRepository"
val email = "[email protected]"
val projectDescription = "SmoothRoundedCornerShape"

mavenPublishing {
publishToMavenCentral()

signAllPublications()

coordinates(groupId = group.toString(), artifactId = githubRepository, version = version.toString())

configure(
Expand Down Expand Up @@ -101,13 +102,4 @@ mavenPublishing {
developerConnection.set("scm:git:ssh://[email protected]/$githubAccount/$githubRepository.git")
}
}

publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
}

signing {
println("Signing...")
useGpgCmd()
sign(publishing.publications)
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Sep 05 13:18:42 BST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.github.iamcalledrob.smoothRoundedCornerShape

val SmoothCircleShape = SmoothRoundedCornerShape(percent = 50)