Skip to content

Commit

Permalink
Migrate to nexus plugin plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Jul 16, 2024
1 parent f53c453 commit e989c19
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 145 deletions.
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.nexusPlugin)
alias(libs.plugins.nexus.plugin)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
alias(libs.plugins.kotlinBinaryCompatibilityValidator)
}

apply(from ="${rootDir}/scripts/publish-root.gradle")

apiValidation {
ignoredProjects.addAll(listOf("app"))
}
Expand Down
21 changes: 15 additions & 6 deletions cloudy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@ plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
id(libs.plugins.nexus.plugin.get().pluginId)
}

rootProject.extra.apply {
set("PUBLISH_GROUP_ID", Configuration.artifactGroup)
set("PUBLISH_ARTIFACT_ID", "cloudy")
set("PUBLISH_VERSION", rootProject.extra.get("rootVersionName"))
}
apply(from = "${rootDir}/scripts/publish-module.gradle.kts")

mavenPublishing {
val artifactId = "cloudy"
coordinates(
Configuration.artifactGroup,
artifactId,
rootProject.extra.get("libVersion").toString()
)

apply(from ="${rootDir}/scripts/publish-module.gradle")
pom {
name.set(artifactId)
description.set("Jetpack Compose blur effect library, which falls back onto a CPU-based implementation to support older API levels.")
}
}

android {
compileSdk = Configuration.compileSdk
Expand Down
28 changes: 27 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,30 @@ android.defaults.buildfeatures.shaders=false
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
# https://developer.android.com/studio/releases/gradle-plugin#4.1-nontransitive-r-class
android.nonTransitiveRClass=true
android.nonTransitiveRClass=true

## Maven Central Publication ##
systemProp.org.gradle.internal.publish.checksums.insecure=true

# Increase timeout when pushing to Sonatype (otherwise we get timeouts)
systemProp.org.gradle.internal.http.socketTimeout=120000

GROUP=com.github.skydoves

POM_URL=https://github.com/skydoves/cloudy/
POM_SCM_URL=https://github.com/skydoves/cloudy/
POM_SCM_CONNECTION=scm:git:git://github.com/skydoves/cloudy.git
POM_SCM_DEV_CONNECTION=scm:git:git://github.com/skydoves/cloudy.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=skydoves
POM_DEVELOPER_NAME=Jaewoong Eum
POM_DEVELOPER_URL=https://github.com/cloudy/
POM_DEVELOPER_EMAIL=[email protected]

SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true
SONATYPE_AUTOMATIC_RELEASE=true
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dokka = "1.9.20"
javaRelease = "11"
jvmTarget = "11"
material = "1.12.0"
mavenPublish = "1.3.0"
nexusPlugin = "0.29.0"
binaryCompatibility = "0.14.0"
androidxActivity = "1.9.0"
androidxComposeBom = "2024.06.00"
Expand All @@ -25,7 +25,7 @@ android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
nexusPlugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "mavenPublish" }
nexus-plugin = { id = "com.vanniktech.maven.publish", version.ref = "nexusPlugin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
kotlinBinaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompatibility" }

Expand Down
87 changes: 0 additions & 87 deletions scripts/publish-module.gradle

This file was deleted.

13 changes: 13 additions & 0 deletions scripts/publish-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import com.skydoves.cloudy.Configuration

apply(plugin = "com.vanniktech.maven.publish")

rootProject.extra.apply {
val snapshot = System.getenv("SNAPSHOT").toBoolean()
val libVersion = if (snapshot) {
Configuration.snapshotVersionName
} else {
Configuration.versionName
}
set("libVersion", libVersion)
}
46 changes: 0 additions & 46 deletions scripts/publish-root.gradle

This file was deleted.

0 comments on commit e989c19

Please sign in to comment.