Skip to content

Commit

Permalink
move shared build logic to buildSrc
Browse files Browse the repository at this point in the history
  • Loading branch information
vytskalt committed Mar 26, 2024
1 parent c2ce803 commit 8408a3e
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 44 deletions.
1 change: 1 addition & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}
41 changes: 0 additions & 41 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,5 @@
plugins {
`java-library`
}

allprojects {
version = "2.1.3"
group = "net.megavex"
description = "Powerful packet-level scoreboard library for Paper/Spigot servers"

repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://repo.papermc.io/repository/maven-public/")
}
}

subprojects {
apply(plugin = "java-library")

dependencies {
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
testImplementation("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")

val adventureVersion = "4.16.0"
compileOnly("net.kyori:adventure-api:$adventureVersion")
compileOnly("net.kyori:adventure-text-serializer-legacy:$adventureVersion")
compileOnly("net.kyori:adventure-text-serializer-gson:$adventureVersion")
testImplementation("net.kyori:adventure-api:$adventureVersion")

val jupiterVersion = "5.10.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jupiterVersion")
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
options.encoding = "UTF-8"
options.isIncremental = true
options.compilerArgs = mutableListOf("-Xlint:-deprecation,-unchecked")
}

tasks.test {
useJUnitPlatform()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.withType

plugins {
`java-library`
}

repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
testImplementation("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")

val adventureVersion = "4.16.0"
compileOnly("net.kyori:adventure-api:$adventureVersion")
compileOnly("net.kyori:adventure-text-serializer-legacy:$adventureVersion")
compileOnly("net.kyori:adventure-text-serializer-gson:$adventureVersion")
testImplementation("net.kyori:adventure-api:$adventureVersion")

val jupiterVersion = "5.10.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jupiterVersion")
}

tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
targetCompatibility = JavaVersion.VERSION_1_8.toString()
options.encoding = "UTF-8"
options.isIncremental = true
options.compilerArgs = mutableListOf("-Xlint:-deprecation,-unchecked")
}

tasks.test {
useJUnitPlatform()
}
1 change: 1 addition & 0 deletions commons/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}

Expand Down
3 changes: 2 additions & 1 deletion extra-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.9.23"
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
kotlin("jvm") version "1.9.23"
}

kotlin {
Expand Down
1 change: 1 addition & 0 deletions implementation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}

Expand Down
3 changes: 2 additions & 1 deletion versions/modern/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("io.papermc.paperweight.userdev") version "1.5.11"
`maven-publish`
id("net.megavex.scoreboardlibrary.base-conventions")
id("io.papermc.paperweight.userdev") version "1.5.11"
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions versions/packet-adapter-base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}

Expand Down
2 changes: 1 addition & 1 deletion versions/packetevents/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}

repositories {
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.codemc.io/repository/maven-releases/")
}

Expand Down
1 change: 1 addition & 0 deletions versions/v1_8_R3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("net.megavex.scoreboardlibrary.base-conventions")
id("net.megavex.scoreboardlibrary.publish-conventions")
}

Expand Down

0 comments on commit 8408a3e

Please sign in to comment.