Skip to content

Commit

Permalink
Preparing for first publish.
Browse files Browse the repository at this point in the history
  • Loading branch information
urosjarc committed Mar 25, 2024
1 parent 0807534 commit 407414b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .env-empty
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
GPG_PRIVATE_KEY=""
GPG_PRIVATE_PASSWORD=""
SONATYPE_PASSWORD=""
SONATYPE_USERNAME=""
GPG_KEY_SERVER=""
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.gradle
build/
.idea
build
.env
logs
*.plantuml
*.log
59 changes: 53 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import org.jetbrains.dokka.DokkaConfiguration.Visibility
import java.lang.Thread.sleep
import java.net.URI

val GPG_PRIVATE_KEY = System.getenv("GPG_PRIVATE_KEY")
val GPG_PRIVATE_PASSWORD = System.getenv("GPG_PRIVATE_PASSWORD")
val SONATYPE_USERNAME = System.getenv("SONATYPE_USERNAME")
val SONATYPE_PASSWORD = System.getenv("SONATYPE_PASSWORD")

plugins {
signing
`java-library`
`maven-publish`
`jvm-test-suite`
Expand All @@ -10,16 +17,20 @@ plugins {
id("org.jetbrains.dokka") version "1.9.10"
id("com.adarshr.test-logger") version "4.0.0"
id("org.jetbrains.kotlinx.kover") version "0.7.6"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}

group = "com.urosjarc"
version = "0.0.2-SNAPSHOT"
version = "0.0.1"
val github = "https://github.com/urosjarc/db-messiah-extra"

kotlin {
explicitApi()
jvmToolchain(19)
}

java {
withSourcesJar()
}
repositories {
mavenCentral()
maven { url = URI("https://jitpack.io") }
Expand All @@ -40,12 +51,25 @@ tasks.register<GradleBuild>("github") {
this.group = "verification"
this.doFirst {
println("Waiting for services to warm up...")
Thread.sleep(60 * 1000)
sleep(60 * 1000)
println("Start with testing...")
}
this.tasks = listOf("test")
}

signing {
useInMemoryPgpKeys(GPG_PRIVATE_KEY, GPG_PRIVATE_PASSWORD)
sign(publishing.publications)
}

val dokkaHtml by tasks.getting(org.jetbrains.dokka.gradle.DokkaTask::class)

val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
dependsOn(dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaHtml.outputDirectory)
}

tasks.dokkaHtml {
dokkaSourceSets {
configureEach {
Expand All @@ -67,11 +91,13 @@ tasks.dokkaHtml {
}

dependencies {
val dbMessiah = "0.0.1"

implementation(kotlin("reflect"))
implementation(project(":db-messiah"))
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.4.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
compileOnly("com.urosjarc:db-messiah:$dbMessiah")

testRuntimeOnly("com.ibm.db2:jcc:11.5.9.0")
testRuntimeOnly("com.h2database:h2:2.2.224")
Expand All @@ -85,6 +111,7 @@ dependencies {

testImplementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("com.urosjarc:db-messiah:$dbMessiah")
}

tasks.test {
Expand All @@ -98,11 +125,15 @@ publishing {
artifactId = rootProject.name
version = rootProject.version as String
from(components["java"])

artifact(javadocJar)
pom {
name = "Db Messiah Extra Utils"
description = "Extra Utils for Db Messiah, kotlin lib. for enterprise database development"
url = "https://github.com/urosjarc/db-messiah-extra"
url = github
issueManagement {
system = "Github"
url = "$github/issues"
}
licenses {
license {
name = "The Apache License, Version 2.0"
Expand All @@ -116,7 +147,23 @@ publishing {
email = "[email protected]"
}
}
scm {
connection.set("scm:git:$github")
developerConnection.set("scm:git:$github")
url.set(github)
}
}
}
}
repositories {
maven {
name = "snapshot"
setUrl { "https://oss.sonatype.org/content/repositories/snapshots/" }
credentials {
username = SONATYPE_USERNAME
password = SONATYPE_PASSWORD
}
}
}

}
3 changes: 0 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
rootProject.name = "db-messiah-extra"

include(":db-messiah")
project(":db-messiah").projectDir = file("../db-jesus")
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.urosjarc.dbmessiah.extra.serializers

import com.urosjarc.dbmessiah.data.TypeSerializer
import kotlinx.datetime.*
import kotlinx.datetime.Instant
import kotlinx.datetime.toJavaInstant
import kotlinx.datetime.toKotlinInstant
import java.sql.JDBCType
import java.sql.Timestamp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.urosjarc.dbmessiah.extra.serializers

import com.urosjarc.dbmessiah.data.TypeSerializer
import kotlinx.datetime.*
import java.sql.Date
import kotlinx.datetime.LocalTime
import kotlinx.datetime.toJavaLocalTime
import kotlinx.datetime.toKotlinLocalTime
import java.sql.JDBCType
import java.sql.Time
import java.sql.Timestamp

public object KotlinxLocalTimeTS {

Expand Down
2 changes: 0 additions & 2 deletions src/test/kotlin/impl/Test_Db2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package impl
import com.urosjarc.dbmessiah.extra.serializers.KotlinxTimeTS
import com.urosjarc.dbmessiah.impl.db2.Db2Serializer
import com.urosjarc.dbmessiah.impl.db2.Db2Service
import com.urosjarc.dbmessiah.serializers.BasicTS
import com.urosjarc.dbmessiah.serializers.JavaTimeTS
import org.junit.jupiter.api.BeforeAll
import utils.*
import utils.Serializers
Expand Down

0 comments on commit 407414b

Please sign in to comment.