Skip to content

Commit

Permalink
Merge pull request #8 from DRSchlaubi/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
DRSchlaubi authored Oct 8, 2021
2 parents 3e47aad + c70df6d commit c8f2c4d
Show file tree
Hide file tree
Showing 33 changed files with 213 additions and 333 deletions.
3 changes: 1 addition & 2 deletions bom/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
plugins {
`lavalink-publishing`
`java-platform`
`maven-publish`
}

applyPublishing()

val me = project

// Without Gradle won't find any project with the publish plugin applied
Expand Down
9 changes: 3 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import org.ajoberstar.gradle.git.publish.GitPublishExtension

plugins {
`maven-publish`
kotlin("multiplatform") version Versions.kotlin apply false
kotlin("plugin.serialization") version Versions.kotlin apply false
id("org.jetbrains.dokka") version "1.5.0"
id("kotlinx-atomicfu") version Versions.atomicFu apply false
id("org.jetbrains.dokka")
id("kotlinx-atomicfu") version "0.16.3" apply false
id("org.ajoberstar.git-publish") version "2.1.3"
}

group = "dev.schlaubi.lavakord"
version = "2.1.0"
version = "3.0.0"

allprojects {
repositories {
Expand Down
5 changes: 4 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ plugins {
}

group = "me.schlaubi"
version = "2.1.0"
version = "3.0.0"

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation(kotlin("gradle-plugin", version = "1.5.31"))
implementation(kotlin("serialization", version = "1.5.31"))
implementation("org.jetbrains.dokka", "dokka-gradle-plugin", "1.5.30")
implementation(kotlin("gradle-plugin-api", version = "1.5.30"))
implementation(gradleApi())
implementation(localGroovy())
Expand Down
9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/Compiler.kt

This file was deleted.

46 changes: 0 additions & 46 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

11 changes: 0 additions & 11 deletions buildSrc/src/main/kotlin/Projects.kt
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.project
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler

val NamedDomainObjectContainer<KotlinSourceSet>.jvmMain: NamedDomainObjectProvider<KotlinSourceSet>
get() = named<KotlinSourceSet>("jvmMain")
Expand All @@ -19,9 +14,3 @@ val NamedDomainObjectContainer<KotlinSourceSet>.jsMain: NamedDomainObjectProvide

val NamedDomainObjectContainer<KotlinSourceSet>.jsTest: NamedDomainObjectProvider<KotlinSourceSet>
get() = named<KotlinSourceSet>("jsTest")

val KotlinDependencyHandler.root: ProjectDependency
get() = project(":core")

val DependencyHandler.root: Dependency
get() = project(":core")
9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/Publishing.kt

This file was deleted.

46 changes: 46 additions & 0 deletions buildSrc/src/main/kotlin/lavalink-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
kotlin("multiplatform")
`maven-publish`
}

group = rootProject.group
version = rootProject.version

repositories {
mavenCentral()
}

kotlin {
explicitApi()

jvm {
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}

tasks {
withType<Test> {
useJUnitPlatform()
}
}
}

// See https://github.com/DRSchlaubi/Lavakord/issues/2
js(IR) {
nodejs()
// browser() doesn't work because the js websocket client does not allowed you to set headers
// Apart from that why would you need Lavalink in your browser?
}

sourceSets {
all {
languageSettings {
optIn("kotlin.RequiresOptIn")
optIn("kotlin.time.ExperimentalTime")
optIn("kotlinx.serialization.ExperimentalSerializationApi")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import java.util.*

apply(plugin = "org.gradle.maven-publish")
apply(plugin = "org.gradle.signing")
plugins {
`maven-publish`
signing
}

val configurePublishing: PublishingExtension.() -> Unit = {
publishing {
repositories {
maven {
setUrl("https://schlaubi.jfrog.io/artifactory/lavakord")

credentials {
username = System.getenv("BINTRAY_USER")
password = System.getenv("BINTRAY_KEY")
Expand All @@ -16,16 +15,16 @@ val configurePublishing: PublishingExtension.() -> Unit = {
}

publications {
filterIsInstance<MavenPublication>().forEach { publication ->
publication.pom {
withType<MavenPublication>() {
pom {
name.set(project.name)
description.set("Kotlin library which can, fetch, find, parse and analyze JVM exception stacktraces")
url.set("https://github.com/DRSchlaubi/furry-okto-rotary-phone")
description.set("Coroutine based client for Lavalink (Kotlin and Java)")
url.set("https://github.com/DRSchlaubi/Lavalink.kt")

licenses {
license {
name.set("Apache-2.0 License")
url.set("https://github.com/DRSchlaubi/furry-okto-rotary-phone/blob/main/LICENSE")
name.set("MIT License")
url.set("https://github.com/DRSchlaubi/Lavalink.kt/blob/main/LICENSE")
}
}

Expand All @@ -38,21 +37,21 @@ val configurePublishing: PublishingExtension.() -> Unit = {
}

scm {
connection.set("scm:git:https://github.com/DRSchlaubi/furry-okto-rotary-phone.git")
developerConnection.set("scm:git:https://github.com/DRSchlaubi/furry-okto-rotary-phone.git")
url.set("https://github.com/DRSchlaubi/furry-okto-rotary-phone")
connection.set("scm:git:https://github.com/DRSchlaubi/Lavalink.kt.git")
developerConnection.set("scm:git:https://github.com/DRSchlaubi/Lavalink.kt.git")
url.set("https://github.com/DRSchlaubi/Lavalink.kt")
}
}
}
}
}

val configureSigning: SigningExtension.() -> Unit = {
signing {
val signingKey = findProperty("signingKey")?.toString()
val signingPassword = findProperty("signingPassword")?.toString()
if (signingKey != null && signingPassword != null) {
useInMemoryPgpKeys(
String(Base64.getDecoder().decode(signingKey.toByteArray())),
String(java.util.Base64.getDecoder().decode(signingKey.toByteArray())),
signingPassword
)
}
Expand All @@ -61,10 +60,3 @@ val configureSigning: SigningExtension.() -> Unit = {
sign(this)
}
}

extensions.configure("signing", configureSigning)
extensions.configure("publishing", configurePublishing)

val Project.publishing: PublishingExtension
get() =
(this as ExtensionAware).extensions.getByName("publishing") as PublishingExtension
78 changes: 21 additions & 57 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,91 +1,57 @@
plugins {
kotlin("multiplatform")
`lavalink-module`
`lavalink-publishing`
kotlin("plugin.serialization")
id("kotlinx-atomicfu")
id("org.jetbrains.dokka")
`maven-publish`
id("kotlinx-atomicfu")
}

version = "2.1.0"

kotlin {
explicitApi()

jvm {
compilations.all {
kotlinOptions {
jvmTarget = Jvm.target
}
}

tasks {
withType<Test> {
useJUnitPlatform()
}
}
}

// See https://github.com/DRSchlaubi/Lavakord/issues/2
js(IR) {
nodejs()
// browser() doesn't work because the js websocket client does not allowed you to set headers
// Apart from that why would you need Lavalink in your browser?
}

sourceSets {
all {
languageSettings.optIn(ExpermientalAnnotations.requiresOptIn)
languageSettings.optIn(ExpermientalAnnotations.experimentalTime)
languageSettings.optIn(ExpermientalAnnotations.experimentalSerialization)
repositories {
mavenCentral()
}
}

commonMain {
dependencies {
api(Dependencies.coroutines)
api(Dependencies.kotlinxSerialization)
api("org.jetbrains.kotlinx:kotlinx-datetime:0.3.0")

implementation(Dependencies.`ktor-io`)
implementation(Dependencies.`ktor-utils`)
implementation(Dependencies.`ktor-client-websockets`)
implementation(Dependencies.`ktor-client-core`)
implementation(Dependencies.`ktor-client-serialization`)
implementation(Dependencies.`ktor-client-logging`)

implementation(Dependencies.kotlinLogging)
api(libs.kotlinx.coroutines.core)
api(libs.kotlinx.serialization.json)
api(libs.kotlinx.datetime)

implementation(libs.ktor.io)
implementation(libs.ktor.utils)
implementation(libs.ktor.client.websockets)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.serialization)
implementation(libs.ktor.client.logging)

implementation(libs.kotlinlogging)
}
}

commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation(Dependencies.`ktor-client-mock`)
implementation(libs.ktor.client.mock)
}
}

jvmMain {
dependencies {
implementation(Dependencies.`ktor-client-cio`)
implementation(libs.ktor.client.cio)
}
}

jvmTest {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit5"))
runtimeOnly(Dependencies.`junit-jupiter-engine`)
runtimeOnly(Dependencies.slf4jSimple)
implementation(Dependencies.coroutinesTest)
runtimeOnly(libs.junit.jupiter.engine)
runtimeOnly(libs.sl4fj.simple)
implementation(libs.kotlinx.coroutines.test)
}
}

jsMain {
dependencies {
implementation(Dependencies.`ktor-client-js`)
implementation(libs.ktor.client.js)

}
}
Expand All @@ -97,5 +63,3 @@ kotlin {
}
}
}

applyPublishing()
Loading

0 comments on commit c8f2c4d

Please sign in to comment.