Skip to content

Commit

Permalink
build: start working on switching to plugin builder 1.1.0 (and possib…
Browse files Browse the repository at this point in the history
…ly to kts scripts as well)
  • Loading branch information
Misat11 committed Dec 20, 2024
1 parent ba31f5c commit 06ffaa3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 34 deletions.
36 changes: 26 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
import org.screamingsandals.gradle.builder.MavenUtilities
import org.screamingsandals.gradle.builder.Utilities
import org.screamingsandals.gradle.builder.JavadocUtilities

plugins {
alias libs.plugins.screaming.plugin.builder apply false
alias libs.plugins.screaming.plugin.slib apply false
alias libs.plugins.buildconfig apply false
alias libs.plugins.lombok apply false
}

if (version.toString().endsWith('-SNAPSHOT')) {
defaultTasks 'clean', 'screamCompile'
} else {
defaultTasks 'clean', 'screamCompile', ':BedWars-API:allowJavadocUpload'
}
defaultTasks 'clean', 'build'

subprojects {
apply plugin: 'java'

if (project.name != 'BedWars-API' && project.name != 'BedWars' && project.name != 'BedWars-protocol') { // upload only BW and BW-API and BW-protocol
project.ext.disablePublishingToMaven = true
}

apply plugin: 'org.screamingsandals.plugin-builder'

apply plugin: 'io.freefair.lombok'

def mavenPublication = null
Utilities.configureLicenser(project)
if (project.name == 'BedWars-API' && project.name == 'BedWars' && project.name == 'BedWars-protocol') {
Utilities.configureSourceJarTasks(project)
mavenPublication = MavenUtilities.setupPublishing(project)
if (!version.toString().endsWith('-SNAPSHOT') && project.name == 'BedWars-API') {
JavadocUtilities.configureJavadocTasks(project)
}
Utilities.setupMavenRepositoriesFromProperties(project)
}

repositories {
mavenLocal()
mavenCentral()
maven { url 'https://repo.screamingsandals.org/public/' }
maven { url 'https://repo.papermc.io/repository/maven-snapshots/' }
maven { url 'https://repo.onarandombox.com/content/groups/public' }
maven { url 'https://repo.codemc.org/repository/maven-public/' }
maven { url 'https://repo.alessiodp.com/releases/' }
}

dependencies {
compileOnly libs.jetbrains.annotations
}

sourceCompatibility = '11.0'

compileJava {
Expand Down Expand Up @@ -69,7 +85,7 @@ subprojects {
}
}

enableShadowPlugin()
Utilities.configureShadowPlugin(project, mavenPublication)

configurations.all {
// Check for updates every build
Expand Down
8 changes: 6 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ parties-api = "3.2.6"
perworldinventory-old = "1.11.5"
perworldinventory-kt = "2.3.1"
multiverse = "4.0.0"
jetbrains-annotations = "26.0.1"

# plugins
screaming-plugin-builder = "1.0.86"
screaming-plugin-builder = "1.1.0-SNAPSHOT"
buildconfig = "3.0.2"
lombok = "8.11"

configurate = "4.1.2"
configurate-patched-gson = "4.1.2-sandals-patch"
Expand All @@ -36,8 +38,10 @@ perworldinventory-kt = { group = "me.ebonjaeger", name = "perworldinventory-kt",
multiverse = { group = "com.onarandombox.multiversecore", name = "Multiverse-Core", version.ref = "multiverse" }
configurate-gson = { group = "org.spongepowered", name = "configurate-gson", version.ref = "configurate-patched-gson" }
configurate-yaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrains-annotations" }

[plugins]
screaming-plugin-builder = { id = "org.screamingsandals.plugin-builder", version.ref = "screaming-plugin-builder" }
screaming-plugin-slib = { id = "org.screamingsandals.plugin-slib", version.ref = "screaming-plugin-builder" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }
lombok = { id = "io.freefair.lombok", version.ref = "lombok" }
44 changes: 22 additions & 22 deletions plugin/universal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
prepareTestTask()
.versions('1.21.3', '1.21.1', '1.20.6', '1.20.4', '1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
.setSubdirectory('paper-master')
.jvmArgs('-Dio.papermc.paper.suppress.sout.nags=true', '-DPaper.IgnoreJavaVersion=true') // suppress System.out.println nag
.onlineMode(false)
.pluginJar(shadowJar.archiveFile.get().asFile.toPath())
.build()
//prepareTestTask()
// .versions('1.21.3', '1.21.1', '1.20.6', '1.20.4', '1.20.2', '1.20.1', '1.19.4', '1.19.3', '1.18.2', '1.17.1', '1.16.5', '1.15.2', '1.14.4', '1.13.2', '1.12.2', '1.11.2', '1.10.2', '1.9.4', '1.8.8')
// .setSubdirectory('paper-master')
// .jvmArgs('-Dio.papermc.paper.suppress.sout.nags=true', '-DPaper.IgnoreJavaVersion=true') // suppress System.out.println nag
// .onlineMode(false)
// .pluginJar(shadowJar.archiveFile.get().asFile.toPath())
// .build()

jar {
manifest {
Expand All @@ -14,18 +14,18 @@ jar {
}
}

discord {
title = "BedWars Master #${System.getenv('BUILD_NUMBER') ?: "custom"}"
content = 'New build of BedWars is now available!'
url = System.getenv('WEBHOOK_URL')
allowedClassifiersAndExtensions = ['.jar']

if (System.getenv('GITHUB_ACTIONS_URL')) {
buildInformationUrl = System.getenv('GITHUB_ACTIONS_URL')
}
/*if (System.getenv('GITHUB_COMMIT_MESSAGE')) {
content = "New build of BedWars is now available!\n\n```\n${System.getenv('GITHUB_COMMIT_MESSAGE')}\n```"
}*/

registerTask(project)
}
//discord {
// title = "BedWars Master #${System.getenv('BUILD_NUMBER') ?: "custom"}"
// content = 'New build of BedWars is now available!'
// url = System.getenv('WEBHOOK_URL')
// allowedClassifiersAndExtensions = ['.jar']
//
// if (System.getenv('GITHUB_ACTIONS_URL')) {
// buildInformationUrl = System.getenv('GITHUB_ACTIONS_URL')
// }
// /*if (System.getenv('GITHUB_COMMIT_MESSAGE')) {
// content = "New build of BedWars is now available!\n\n```\n${System.getenv('GITHUB_COMMIT_MESSAGE')}\n```"
// }*/
//
// registerTask(project)
//}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pluginManagement {
repositories {
mavenCentral()
mavenLocal()
gradlePluginPortal()
maven {
url = "https://repo.screamingsandals.org/public/"
Expand Down

0 comments on commit 06ffaa3

Please sign in to comment.