Skip to content

Commit

Permalink
build: Migrate publication to gradle-maven-publish-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed May 9, 2024
1 parent 59888d5 commit 024c20a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 35 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [Unreleased]

*No changes*
### Housekeeping

- Publication migrated to [com.vanniktech:gradle-maven-publish-plugin](https://github.com/vanniktech/gradle-maven-publish-plugin)

## [1.1.1-beta02] - 2024.05.07

Expand Down
29 changes: 0 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
import com.redmadrobot.build.dsl.developer
import com.redmadrobot.build.dsl.mit
import com.redmadrobot.build.dsl.setGitHubProject

plugins {
com.redmadrobot.`publish-config`
com.redmadrobot.`android-config`
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}

nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
}

val datastoreVersion = libs.versions.datastore.get()
Expand All @@ -26,18 +11,4 @@ allprojects {
redmadrobot {
// Min SDK should be aligned with min SDK in androidx.security:security-crypto
android.minSdk = 23

publishing {
signArtifacts = true

pom {
setGitHubProject("osipxd/encrypted-datastore")
licenses {
mit()
}
developers {
developer(id = "osipxd", name = "Osip Fatkullin", email = "[email protected]")
}
}
}
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies {
implementation(libs.infrastructure.android)
implementation(libs.infrastructure.kotlin)
implementation(libs.infrastructure.publish)
implementation(libs.mavenPublishPlugin)

implementation(libs.kotlinx.binaryCompatibilityValidator)
}
Expand Down
29 changes: 24 additions & 5 deletions buildSrc/src/main/kotlin/convention.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
import com.redmadrobot.build.dsl.ossrh
import com.redmadrobot.build.dsl.developer
import com.redmadrobot.build.dsl.mit
import com.redmadrobot.build.dsl.setGitHubProject
import com.vanniktech.maven.publish.SonatypeHost
import org.gradle.api.plugins.internal.JavaPluginHelper
import org.gradle.internal.component.external.model.TestFixturesSupport
import org.gradle.jvm.component.internal.DefaultJvmSoftwareComponent

plugins {
id("com.redmadrobot.publish")
com.vanniktech.maven.publish
signing
}

publishing {
repositories {
ossrh { credentials(PasswordCredentials::class) }
signing {
useGpgCmd()
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()

coordinates(artifactId = project.name)

pom {
setGitHubProject("osipxd/encrypted-datastore")
licenses {
mit()
}
developers {
developer(id = "osipxd", name = "Osip Fatkullin", email = "[email protected]")
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
kotlin = "1.9.23"
datastore = "1.1.1"
infrastructure = "0.18.1"
mavenPublishPlugin = "0.28.0"
junit = "5.10.2"

# Sample
Expand Down Expand Up @@ -32,6 +33,7 @@ tink = "com.google.crypto.tink:tink-android:1.13.0"
infrastructure-android = { module = "com.redmadrobot.build:infrastructure-android", version.ref = "infrastructure" }
infrastructure-kotlin = { module = "com.redmadrobot.build:infrastructure-kotlin", version.ref = "infrastructure" }
infrastructure-publish = { module = "com.redmadrobot.build:infrastructure-publish", version.ref = "infrastructure" }
mavenPublishPlugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "mavenPublishPlugin" }

junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
Expand Down

0 comments on commit 024c20a

Please sign in to comment.