Skip to content

Commit

Permalink
gradle update
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek committed Nov 3, 2024
1 parent c09ab04 commit 16a8f5f
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 167 deletions.
68 changes: 27 additions & 41 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ plugins {
jacoco
id("me.champeau.gradle.jmh") version "0.5.3"
id("pl.allegro.tech.build.axion-release") version "1.18.14"
id("com.adarshr.test-logger") version "3.2.0"
id("org.sonarqube") version "5.1.0.4882"
id("com.adarshr.test-logger") version "4.0.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"

}

repositories {
jcenter()
mavenCentral()
}

Expand All @@ -28,9 +28,14 @@ dependencies {
group = "com.github.bgalek.utils"
version = scmVersion.version

configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

tasks.jar {
Expand All @@ -41,33 +46,11 @@ tasks.jar {

tasks.test {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(FAILED, SKIPPED)
}
}

tasks.register<Jar>("sourcesJar") {
from(sourceSets.main.get().allJava)
archiveClassifier.set("sources")
}

tasks.register<Jar>("javadocJar") {
from(tasks.javadoc)
archiveClassifier.set("javadoc")
}

jacoco {
toolVersion = "0.8.6"
reportsDir = file("$buildDir/reports/jacoco")
}

tasks.jacocoTestReport {
reports {
xml.isEnabled = true
xml.destination = file("$buildDir/reports/jacoco/report.xml")
csv.isEnabled = false
html.isEnabled = false
xml.required = true
}
}

Expand All @@ -76,8 +59,6 @@ publishing {
create<MavenPublication>("sonatype") {
artifactId = "devicedetect"
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
Expand Down Expand Up @@ -113,24 +94,29 @@ publishing {
}
repositories {
maven {
credentials {
username = project.properties["ossrhUsername"] as String?
password = project.properties["ossrhPassword"] as String?
}
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}

signing {
useGpgCmd()
sign(publishing.publications["sonatype"])
nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}

tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
System.getenv("GPG_KEY_ID")?.let {
signing {
useInMemoryPgpKeys(
System.getenv("GPG_KEY_ID"),
System.getenv("GPG_PRIVATE_KEY"),
System.getenv("GPG_PRIVATE_KEY_PASSWORD")
)
sign(publishing.publications)
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 16a8f5f

Please sign in to comment.