Skip to content

Commit

Permalink
Prepare for publishing (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpavlov committed Jan 17, 2022
1 parent 38d15a0 commit 56e45cb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .java-version
@@ -1 +1 @@
11.0
11
28 changes: 21 additions & 7 deletions build.gradle.kts
@@ -1,3 +1,5 @@
import org.gradle.api.tasks.testing.logging.TestLogEvent

plugins {
`java-library`
kotlin("jvm") version "1.6.10"
Expand All @@ -22,7 +24,6 @@ dependencies {
implementation("org.slf4j:slf4j-api:1.7.32")
implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation(kotlin("stdlib-jdk8"))
testApi("org.junit.jupiter:junit-jupiter-api:5.8.2")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
testImplementation("org.mockito:mockito-junit-jupiter:4.2.0")
Expand All @@ -37,9 +38,11 @@ dependencies {
}

group = "com.github.kpavlov.jreactive8583"
version = "1.3.5-SNAPSHOT"
version = if (findProperty("version") != "unspecified") findProperty("version")
else "0.0.1-SNAPSHOT"
description = "ISO8583 Connector for Netty"
java.sourceCompatibility = JavaVersion.VERSION_11
java.targetCompatibility = JavaVersion.VERSION_11

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
Expand All @@ -54,9 +57,11 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach

tasks.test {
useJUnitPlatform()
// testLogging {
// events "passed", "skipped", "failed"
// }
testLogging {
events = setOf(
TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED
)
}
}

val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)
Expand All @@ -72,6 +77,17 @@ java {
withJavadocJar()
}

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

tasks.assemble {
dependsOn(javadocJar)
}
Expand Down Expand Up @@ -110,14 +126,12 @@ publishing {
from(components["java"])
}

/*
repositories {
maven {
name = "myRepo"
url = uri(layout.buildDirectory.dir("repo"))
}
}
*/
}

nexusPublishing {
Expand Down
12 changes: 8 additions & 4 deletions publish.sh
@@ -1,16 +1,20 @@
# exit when any command fails
set -e

echo "Cleanup 🧹"
rm -rf build

#GRADLE_ARGS="-Pversion=1.3.5"

echo "Building 📦"
#./gradlew build --scan
./gradlew build
./gradlew $GRADLE_ARGS build

echo "Testing 🧪"
./gradlew check --stacktrace
./gradlew $GRADLE_ARGS check --stacktrace

echo "Publishing 📢"

## https://github.com/gradle-nexus/publish-plugin/
./gradlew publishToSonatype
#./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
./gradlew $GRADLE_ARGS publishToSonatype
#./gradlew $GRADLE_ARGS publishToSonatype closeAndReleaseSonatypeStagingRepository

0 comments on commit 56e45cb

Please sign in to comment.