Skip to content

Commit

Permalink
hopefully final testing
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Apr 30, 2024
1 parent 9958362 commit a310fb1
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
17 changes: 8 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ import org.ajoberstar.grgit.Grgit

plugins {
java
`maven-publish`
id("org.ajoberstar.grgit") version "5.2.0"
alias(libs.plugins.maven.publish.base) apply false
}

val (gitVersion, release) = versionFromGit()
logger.lifecycle("Version: $gitVersion (release: $release)")

allprojects {
group = "dev.lavalink.youtube"
version = gitVersion
// The plugin project is the only one that should not have a snapshot version since lavalink expects the jar name to be specific
version = if (project.name == "plugin") {
gitVersion.removeSuffix("-SNAPSHOT")
} else {
gitVersion
}


repositories {
mavenLocal()
Expand All @@ -30,13 +36,6 @@ subprojects {
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation("org.mozilla:rhino-engine:1.7.14")
implementation("com.grack:nanojson:1.7")
compileOnly("org.slf4j:slf4j-api:1.7.25")
compileOnly("org.jetbrains:annotations:24.1.0")
}

configure<PublishingExtension> {
if (findProperty("MAVEN_PASSWORD") != null && findProperty("MAVEN_USERNAME") != null) {
repositories {
Expand Down
15 changes: 8 additions & 7 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ base {

dependencies {
compileOnly(libs.lavaplayer.v1)
}

publishing {
publications {
create<MavenPublication>("youtube-common") {
from(components["java"])
}
}
implementation(libs.rhino.engine)
implementation(libs.nanojson)
compileOnly(libs.slf4j)
compileOnly(libs.annotations)
}

mavenPublishing {
configure(JavaLibrary(JavadocJar.Javadoc()))
}
19 changes: 11 additions & 8 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar

plugins {
`java-library`
alias(libs.plugins.lavalink.gradle.plugin)
alias(libs.plugins.maven.publish.base)
}

lavalinkPlugin {
name = "youtube-plugin"
path = "dev.lavalink.youtube.plugin"
apiVersion = libs.versions.lavalink
serverVersion = "4.0.4"
configurePublishing = true
configurePublishing = false
}

base {
Expand All @@ -20,17 +24,16 @@ dependencies {
implementation(projects.v2)
compileOnly(libs.lavalink.server)
compileOnly(libs.lavaplayer.ext.youtube.rotator)
compileOnly(libs.slf4j)
compileOnly(libs.annotations)
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

publishing {
publications {
create<MavenPublication>("youtube-plugin") {
from(components["java"])
}
}
}
mavenPublishing {
coordinates("dev.lavalink.youtube", "youtube-plugin", version.toString())
configure(JavaLibrary(JavadocJar.None(), sourcesJar = false))
}
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ dependencyResolutionManagement {
library("lavalink-server", "dev.arbjerg.lavalink", "Lavalink-Server").versionRef("lavalink")
library("lavaplayer-ext-youtube-rotator", "dev.arbjerg", "lavaplayer-ext-youtube-rotator").versionRef("lavaplayer-v1")

library("rhino-engine", "org.mozilla", "rhino-engine").version("1.7.14")
library("nanojson", "com.grack", "nanojson").version("1.7")
library("slf4j", "org.slf4j", "slf4j-api").version("1.7.25")
library("annotations", "org.jetbrains", "annotations").version("24.1.0")

plugin("lavalink-gradle-plugin", "dev.arbjerg.lavalink.gradle-plugin").version("1.0.15")

val mavenPublishPlugin = version("maven-publish-plugin", "0.25.3")
Expand Down
13 changes: 7 additions & 6 deletions v2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar

plugins {
`java-library`
alias(libs.plugins.maven.publish.base)
Expand All @@ -10,12 +13,10 @@ base {
dependencies {
api(projects.common)
compileOnly(libs.lavaplayer.v2)
compileOnly(libs.slf4j)
compileOnly(libs.annotations)
}

publishing {
publications {
create<MavenPublication>("youtube-v2") {
from(components["java"])
}
}
mavenPublishing {
configure(JavaLibrary(JavadocJar.Javadoc()))
}

0 comments on commit a310fb1

Please sign in to comment.