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
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
types: [ prereleased, released ]

env:
sonatypeUsername: ${{ secrets.SONATYPEUSERNAME }}
sonatypePassword: ${{ secrets.SONATYPEPASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPEUSERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPEPASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.PASSPHRASE }}

jobs:
build:
Expand Down
88 changes: 34 additions & 54 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ plugins {
`java-library`
`maven-publish`
signing
alias(libs.plugins.publish)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.jlleitschuh.ktlint)
Expand All @@ -27,8 +28,6 @@ group = "dev.gitlive"
version = project.property("version") as String

java {
withSourcesJar()
withJavadocJar()
sourceCompatibility = JavaVersion.VERSION_17
}

Expand Down Expand Up @@ -91,55 +90,43 @@ val cleanLibs by tasks.creating(Delete::class) {
delete("$${layout.buildDirectory.asFile.get().path}/libs")
}

publishing {
mavenPublishing {
publishToMavenCentral(automaticRelease = true)
signAllPublications()

repositories {
maven {
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("sonatypeUsername")
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("sonatypePassword")
coordinates("dev.gitlive", "firebase-java-sdk", project.version.toString())

pom {
name.set("Firebase Java SDK")
description.set("A pure Java port of the Firebase Android SDK for client-side Java environments.")
url.set("https://github.com/GitLiveApp/firebase-java-sdk")
inceptionYear.set("2023")

scm {
url.set("https://github.com/GitLiveApp/firebase-java-sdk")
connection.set("scm:git:https://github.com/GitLiveApp/firebase-java-sdk.git")
developerConnection.set("scm:git:https://github.com/GitLiveApp/firebase-java-sdk.git")
tag.set("HEAD")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/GitLiveApp/firebase-java-sdk/issues")
}

developers {
developer {
name.set("Nicholas Bransby-Williams")
email.set("nbransby@gmail.com")
}
}
}

publications {
create<MavenPublication>("library") {
from(components["java"])

pom {
name.set("firebase-java-sdk")
description.set("The Firebase Java SDK is a pure java port of the Firebase Android SDK to run in clientside java environments such as the desktop.")
url.set("https://github.com/GitLiveApp/firebase-java-sdk")
inceptionYear.set("2023")

scm {
url.set("https://github.com/GitLiveApp/firebase-java-sdk")
connection.set("scm:git:https://github.com/GitLiveApp/firebase-java-sdk.git")
developerConnection.set("scm:git:https://github.com/GitLiveApp/firebase-java-sdk.git")
tag.set("HEAD")
}

issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/GitLiveApp/firebase-java-sdk/issues")
}

developers {
developer {
name.set("Nicholas Bransby-Williams")
email.set("nbransby@gmail.com")
}
}

licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
comments.set("A business-friendly OSS license")
}
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
comments.set("A business-friendly OSS license")
}
}
}
Expand Down Expand Up @@ -190,13 +177,6 @@ ktlint {
version.set(libs.versions.ktlint.get())
}

signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications)
}

tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {

fun isNonStable(version: String): Boolean {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ kotlin = "2.0.20"
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.2"
ktlint = "0.47.1"
publish = "0.34.0"

[libraries]
androidx-collection = { module = "androidx.collection:collection", version = "1.4.3" }
Expand Down Expand Up @@ -40,3 +41,4 @@ ben-manes-versions = { id = "com.github.ben-manes.versions", version.ref = "ben-
jlleitschuh-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "jlleitschuh-ktlint" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
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 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down