Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'
- name: 💼 Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: 🛠 Build jars
Expand Down
1 change: 1 addition & 0 deletions Plan/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {

compileJava {
options.release = 8
sourceCompatibility = "${JavaVersion.VERSION_1_8}"
}

def apiVersion = "5.7-R0.2"
Expand Down
1 change: 1 addition & 0 deletions Plan/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ subprojects {

compileJava {
options.release = 11
sourceCompatibility = "${JavaVersion.VERSION_11}"
}

ext {
Expand Down
17 changes: 14 additions & 3 deletions Plan/common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ plugins {
id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.43"
}

compileTestFixturesJava {
sourceCompatibility = "${JavaVersion.VERSION_17}"
}

configurations {
// Runtime downloading scopes
mysqlDriver
Expand Down Expand Up @@ -198,6 +202,12 @@ tasks.named("checkstyleTest").configure {
it.dependsOn(copyYarnBuildResults)
}

// Add support for exec block https://stackoverflow.com/a/79720796/20825073
interface InjectedExecOps {
@Inject
ExecOperations getExecOps()
}

tasks.register("determineAssetModifications") {
// Skip Yarn build on Jitpack since Jitpack doesn't offer gclib version compatible with Node 20
// Jitpack build is used mainly for java dependencies.
Expand All @@ -209,14 +219,15 @@ tasks.register("determineAssetModifications") {
inputs.files(fileTree(dir: "src/main/resources/assets/plan/themes"))
outputs.file("build/resources/main/assets/plan/AssetVersion.yml")

def execOps = project.objects.newInstance(InjectedExecOps).execOps
doLast {
mkdir "build/resources/main/assets/plan"
def versionFile = file("build/resources/main/assets/plan/AssetVersion.yml")
versionFile.text = "" // Clear previous build
ConfigurableFileTree tree = fileTree(dir: "src/main/resources/assets/plan/web")
tree.forEach { File f ->
def gitModified = new ByteArrayOutputStream()
exec {
execOps.exec {
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
standardOutput = gitModified
}
Expand All @@ -232,7 +243,7 @@ tasks.register("determineAssetModifications") {
tree = fileTree(dir: "src/main/resources/assets/plan/locale")
tree.forEach { File f ->
def gitModified = new ByteArrayOutputStream()
exec {
execOps.exec {
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
standardOutput = gitModified
}
Expand All @@ -248,7 +259,7 @@ tasks.register("determineAssetModifications") {
tree = fileTree(dir: "src/main/resources/assets/plan/themes")
tree.forEach { File f ->
def gitModified = new ByteArrayOutputStream()
exec {
execOps.exec {
commandLine "git", "log", "-1", "--pretty=%ct", f.toString()
standardOutput = gitModified
}
Expand Down
Binary file modified Plan/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion Plan/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 7 additions & 5 deletions Plan/gradlew

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

6 changes: 4 additions & 2 deletions Plan/gradlew.bat

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

20 changes: 16 additions & 4 deletions Plan/velocity/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
plugins {
id "net.kyori.blossom" version "1.3.1"
id "net.kyori.blossom" version "2.2.0"
}

apply plugin: "com.gradleup.shadow"

blossom {
replaceTokenIn("src/main/java/com/djrapitops/plan/PlanVelocity.java")
replaceToken("@version@", "$fullVersion")
compileJava {
dependsOn generateTemplates
}

sourceSets {
main {
// java {
// srcDir("src/main/java-templates")
// }
blossom {
javaSources {
property("version", "$fullVersion")
}
}
}
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* This file is part of Player Analytics (Plan).
*
* Plan is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License v3 as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Plan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
*/
package net.playeranalytics.plan;

public class BuildParameters {
public static final String VERSION = "{{ version }}";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.velocitypowered.api.plugin.Plugin;
import com.velocitypowered.api.plugin.annotation.DataDirectory;
import com.velocitypowered.api.proxy.ProxyServer;
import net.playeranalytics.plan.BuildParameters;
import net.playeranalytics.plugin.PlatformAbstractionLayer;
import net.playeranalytics.plugin.VelocityPlatformLayer;
import net.playeranalytics.plugin.scheduling.RunnableFactory;
Expand All @@ -54,7 +55,7 @@
@Plugin(
id = "plan",
name = "Plan",
version = "@version@",
version = BuildParameters.VERSION,
description = "Player Analytics Plugin by AuroraLS3",
dependencies = {
@Dependency(id = "viaversion", optional = true),
Expand Down