Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jun 21, 2024
1 parent 02ca464 commit 99e7c6a
Show file tree
Hide file tree
Showing 34 changed files with 210 additions and 989 deletions.
30 changes: 8 additions & 22 deletions .github/workflows/docs-ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
# This workflow will upload docs to the gh-pages branch whenever something is pushed to main.

name: Docs
name: Documentation CI
on:
push:
branches:
- main
pull_request:

jobs:
upload_docs:
name: upload docs
runs-on: ubuntu-20.04
env:
GRGIT_USER: ${{ secrets.GRGIT_USER }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
permissions:
id-token: write
pages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 22
- uses: gradle/actions/setup-gradle@v3
- name: Publish docs with Gradle
run: gradle gitPublishPush
jobs:
docs:
uses: kordlib/.teamcity/.github/workflows/documentation.yml@main
52 changes: 0 additions & 52 deletions .github/workflows/github-ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@ docs/
.idea/artifacts
!**/build/generated/
core/gradle.properties
.kotlin
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 4 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import org.ajoberstar.gradle.git.publish.GitPublishExtension
import dev.kord.gradle.tools.KordGradlePlugin
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin

plugins {
id("org.jetbrains.dokka")
alias(libs.plugins.kotlinx.atomicfu) apply false
alias(libs.plugins.git.publish)
alias(libs.plugins.gradle.tools) apply false
}

group = "dev.schlaubi.lavakord"
version = "6.2.0"
version = "6.3.0"

allprojects {
repositories {
Expand All @@ -26,26 +26,10 @@ tasks {
dokkaHtmlMultiModule {
outputDirectory = rootProject.file("docs")
}

gitPublishCopy {
dependsOn(dokkaHtmlMultiModule)
}
}

configure<GitPublishExtension> {
repoUri = "https://github.com/DRSchlaubi/lavakord.git"
branch = "gh-pages"

contents {
from(file("docs"))
from(file("CNAME"))
}

commitMessage = "Update Docs"
}

subprojects {
version = libraryVersion
apply<KordGradlePlugin>()
group = rootProject.group

tasks {
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ repositories {
}

dependencies {
val kotlinVersion = "1.9.24"
val kotlinVersion = "2.0.0"
implementation(kotlin("gradle-plugin", kotlinVersion))
implementation(kotlin("serialization", kotlinVersion))
implementation(kotlin("gradle-plugin-api", kotlinVersion))
implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
implementation("org.jetbrains.dokka", "dokka-gradle-plugin", "1.9.10")
implementation("com.vanniktech:gradle-maven-publish-plugin:0.29.0")
implementation("org.jetbrains.dokka", "dokka-gradle-plugin", "1.9.20")
implementation(gradleApi())
implementation(localGroovy())
}
16 changes: 0 additions & 16 deletions buildSrc/src/main/kotlin/Projects.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.Project
import org.gradle.kotlin.dsl.named
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet

private val Project.tag
get() = git("tag", "--no-column", "--points-at", "HEAD")
.takeIf { it.isNotBlank() }
?.lines()
?.single()

val Project.libraryVersion
get() = tag ?: run {
val snapshotPrefix = when (val branch = git("branch", "--show-current")) {
else -> branch.replace('/', '-')
}
"$snapshotPrefix-SNAPSHOT"
}


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

Expand Down
17 changes: 7 additions & 10 deletions buildSrc/src/main/kotlin/lavalink-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
Expand All @@ -17,10 +18,9 @@ kotlin {
explicitApi()

jvm {
compilations.all {
compilerOptions.configure {
jvmTarget = JvmTarget.JVM_1_8
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

Expand All @@ -32,12 +32,9 @@ kotlin {
useCommonJs()
}

targets.all {
compilations.all {
compilerOptions.configure {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/lavalink-publishing.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01, true)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()

pom {
Expand Down
5 changes: 4 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ kotlin {
}

jvmMain {
kotlin.srcDir("build/generated/ksp/jvm/jvmMain")
dependencies {
implementation(libs.ktor.client.okhttp)
compileOnly(libs.ksp.api)
compileOnly(libs.codegen.ksp)
}
}

Expand Down Expand Up @@ -76,7 +79,7 @@ kotlin {
}

dependencies {
//kspJvm(libs.codegen.ksp.processor)
// kspJvm(libs.codegen.ksp.processor)
}

mavenPublishing {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.schlaubi.lavakord.internal

import dev.kord.codegen.ksp.annotations.ProcessorAnnotation
import dev.schlaubi.lavakord.PluginApi

/**
* Annotation to generate utility functions for search queries.
Expand All @@ -9,7 +10,8 @@ import dev.kord.codegen.ksp.annotations.ProcessorAnnotation
@Retention(AnnotationRetention.SOURCE)
@Repeatable
@ProcessorAnnotation("dev.schlaubi.lavakord.internal.processing")
internal annotation class GenerateQueryHelper(
@PluginApi
public annotation class GenerateQueryHelper(
val serviceName: String,
val serviceWebsite: String,
val generateSearchAndPlayFunction: Boolean,
Expand All @@ -23,7 +25,7 @@ internal annotation class GenerateQueryHelper(
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
@ProcessorAnnotation("dev.schlaubi.lavakord.internal.processing")
annotation class Parameter(
public annotation class Parameter(
val name: String,
val queryName: String = "",
val kDoc: String = "",
Expand All @@ -32,13 +34,13 @@ internal annotation class GenerateQueryHelper(
) {

@ProcessorAnnotation("dev.schlaubi.lavakord.internal.processing")
annotation class EnumType(
public annotation class EnumType(
val name: String,
val value: String,
val kDoc: String
)

enum class Type {
public enum class Type {
STRING,
INT,
DOUBLE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ import io.ktor.client.engine.*
/**
* This is the internally used Http Engine
*/
public expect object HttpEngine : HttpClientEngineFactory<HttpClientEngineConfig>
public expect object HttpEngine : HttpClientEngineFactory<HttpClientEngineConfig> {
override fun create(block: HttpClientEngineConfig.() -> Unit): HttpClientEngine
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m
kotlin.mpp.stability.nowarn=true
# Sonatype sucks!
SONATYPE_CONNECT_TIMEOUT_SECONDS=300
nextPlannedVersion=6.4.0
9 changes: 8 additions & 1 deletion jda/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm

plugins {
`lavalink-jvm-module`
`lavalink-publishing`
Expand All @@ -11,7 +14,11 @@ dependencies {
api(projects.core)
api(libs.kotlinlogging)
api(libs.kotlinx.coroutines.jdk8)
api("net.dv8tion:JDA:5.0.0-beta.18") {
api("net.dv8tion:JDA:5.0.0-beta.24") {
exclude(module = "opus-java")
}
}

mavenPublishing {
configure(KotlinJvm(JavadocJar.Dokka("dokkaHtml")))
}
Loading

0 comments on commit 99e7c6a

Please sign in to comment.