Skip to content

Commit

Permalink
chore(build): update publishing configuration across all projects
Browse files Browse the repository at this point in the history
- Adjusted publishing settings in `build.gradle.kts` to standardize publication process.
- Ensured compatibility and alignment with updated project requirements.
  • Loading branch information
gibiw committed Nov 21, 2024
1 parent 13bb4fa commit ad7d284
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 62 deletions.
92 changes: 80 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import java.time.Duration

plugins {
java
signing
id("maven-publish")

kotlin("jvm") version "1.9.24"
kotlin("plugin.serialization") version "1.9.24"
id("maven-publish")
}

val gradleScriptDir by extra("${rootProject.projectDir}/gradle")
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

buildscript {
repositories {
Expand All @@ -20,12 +24,29 @@ buildscript {
}
}

val gradleScriptDir by extra("${rootProject.projectDir}/gradle")

nexusPublishing {
connectTimeout.set(Duration.ofMinutes(7))
clientTimeout.set(Duration.ofMinutes(7))

transitionCheckOptions {
maxRetries.set(100)
delayBetween.set(Duration.ofSeconds(10))
}

repositories {
sonatype()
}
}

allprojects {
group = "io.qase"
version = "1.0.0"

repositories {
mavenCentral()
google()
mavenLocal()
}

Expand All @@ -36,8 +57,12 @@ allprojects {
}
}

configure(subprojects.filter { !it.name.contains("android") }
.filter { !it.name.contains("kaspresso") }) {
configure(
subprojects
.filter { !it.name.contains("android") }
.filter { !it.name.contains("kaspresso") }
) {
apply(plugin = "signing")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")

Expand All @@ -47,10 +72,12 @@ configure(subprojects.filter { !it.name.contains("android") }

tasks.jar {
manifest {
attributes(mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
))
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}

Expand All @@ -59,6 +86,11 @@ configure(subprojects.filter { !it.name.contains("android") }
archiveClassifier.set("sources")
}

val javadocJar by tasks.creating(Jar::class) {
from(tasks.getByName("javadoc"))
archiveClassifier.set("javadoc")
}

tasks.withType(Javadoc::class) {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}
Expand All @@ -71,13 +103,49 @@ configure(subprojects.filter { !it.name.contains("android") }
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifact(javadocJar)
artifact(sourceJar)
from(components["java"])

pom {
name.set(project.name)
description.set("Module ${project.name} of Qase Kotlin reporters.")
url.set("https://github.com/qase-tms/qase-kotlin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("qase-tms")
name.set("Qase Team")
email.set("[email protected]")
}
}
scm {
developerConnection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
connection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
url.set("https://github.com/qase-tms/qase-kotlin")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/qase-tms/qase-kotlin/issue")
}
}
}
}
repositories {
mavenLocal()
}
}

// signing {
// val signingKeyId: String? by project
// val signingKey: String? by project
// val signingPassword: String? by project
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
//
// sign(publishing.publications["maven"])
// }
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
Expand Down
59 changes: 48 additions & 11 deletions qase-kaspresso-reporter/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
description = "Qase Kotlin Kaspresso reporter"

plugins {
id("com.android.library")
kotlin("android")
id("maven-publish")
signing
}

apply(plugin = "maven-publish")
Expand All @@ -14,7 +17,7 @@ repositories {

android {
namespace = "io.qase.kaspresso"
compileSdkVersion(30)
compileSdk = 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -69,19 +72,53 @@ tasks.register<Jar>("androidSourcesJar") {
from(android.sourceSets["main"].java.srcDirs)
}

publishing {
publications {
create<MavenPublication>("mavenAndroid") {
afterEvaluate {
afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
from(components["release"])
artifact(tasks.getByName<Jar>("androidJavadocsJar"))

pom {
name.set(project.name)
description.set("Module ${project.name} of Qase Kotlin reporters.")
url.set("https://github.com/qase-tms/qase-kotlin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("qase-tms")
name.set("Qase Team")
email.set("[email protected]")
}
}
scm {
developerConnection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
connection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
url.set("https://github.com/qase-tms/qase-kotlin")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/qase-tms/qase-kotlin/issue")
}
}
}
groupId = "io.qase"
artifactId = "qase-kaspresso-reporter"
version = "1.0.0"

}
}
repositories {
mavenLocal()
}

// signing {
// val signingKeyId: String? by project
// val signingKey: String? by project
// val signingPassword: String? by project
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
//
// sign(publishing.publications["maven"])
// }
}


71 changes: 55 additions & 16 deletions qase-kotlin-android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
description = "Qase Kotlin Android Integration"

plugins {
id("com.android.library")
kotlin("android")
id("maven-publish")
signing
}

apply(plugin = "maven-publish")
Expand All @@ -14,7 +17,7 @@ repositories {

android {
namespace = "io.qase.commons.kotlin.android"
compileSdkVersion(30)
compileSdk = 34

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
Expand All @@ -30,10 +33,10 @@ android {
}

dependencies {
implementation("androidx.test.ext:junit:1.1.2")
implementation("androidx.test:runner:1.4.0")
implementation("androidx.multidex:multidex:2.0.1")
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
implementation("androidx.test.ext:junit:1.2.1")
implementation("androidx.test:runner:1.6.2")
// implementation("androidx.multidex:multidex:2.0.1")
// implementation("androidx.test.uiautomator:uiautomator:2.3.0")
implementation(project(":qase-kotlin-commons"))
}

Expand All @@ -54,7 +57,8 @@ tasks.register<Javadoc>("androidJavadocs") {
"http://docs.oracle.com/javase/7/docs/api/",
"http://developer.android.com/reference/",
"http://hc.apache.org/httpcomponents-client-5.0.x/httpclient5/apidocs/",
"http://hc.apache.org/httpcomponents-core-5.0.x/httpcore5/apidocs/")
"http://hc.apache.org/httpcomponents-core-5.0.x/httpcore5/apidocs/"
)
}

tasks.register<Jar>("androidJavadocsJar") {
Expand All @@ -69,18 +73,53 @@ tasks.register<Jar>("androidSourcesJar") {
from(android.sourceSets["main"].java.srcDirs)
}

publishing {
publications {
create<MavenPublication>("mavenAndroid") {
afterEvaluate {
afterEvaluate {
println(components.names)

publishing {
publications {
create<MavenPublication>("maven") {
from(components["release"])
artifact(tasks.getByName<Jar>("androidJavadocsJar"))

pom {
name.set(project.name)
description.set("Module ${project.name} of Qase Kotlin reporters.")
url.set("https://github.com/qase-tms/qase-kotlin")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("qase-tms")
name.set("Qase Team")
email.set("[email protected]")
}
}
scm {
developerConnection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
connection.set("scm:git:git://github.com/qase-tms/qase-kotlin")
url.set("https://github.com/qase-tms/qase-kotlin")
}
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/qase-tms/qase-kotlin/issue")
}
}
}
groupId = "io.qase"
artifactId = "qase-kotlin-android"
version = "1.0.0"

}
}
repositories {
mavenLocal()
}

// signing {
// val signingKeyId: String? by project
// val signingKey: String? by project
// val signingPassword: String? by project
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
//
// sign(publishing.publications["maven"])
// }
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.qase.commons.kotlin.android.writer

import android.annotation.SuppressLint
import androidx.test.services.storage.TestStorage
import io.qase.commons.kotlin.models.Attachment
import io.qase.commons.kotlin.models.TestResult
Expand All @@ -8,8 +9,10 @@ import io.qase.commons.kotlin.writer.OutputStreamWriter

class TestStorageResultsWriter : Writer {
private val defaultPath = "qase-results"
@Suppress("RestrictedApi")
private val testStorage by lazy { TestStorage() }

@SuppressLint("RestrictedApi")
private val outputStreamResultsWriter = OutputStreamWriter { name ->
testStorage.openOutputFile("$defaultPath/$name")
}
Expand Down
25 changes: 2 additions & 23 deletions qase-kotlin-commons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
description = "Qase Kotlin Commons"

plugins {
kotlin("jvm") version "1.9.24"
kotlin("plugin.serialization") version "1.9.24"
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.1")
implementation("junit:junit:4.13.2")
Expand All @@ -17,21 +14,3 @@ dependencies {
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}

subprojects {
apply(plugin = "maven-publish")

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
repositories {
mavenLocal()
}
}
}

0 comments on commit ad7d284

Please sign in to comment.