diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 869c7c2..d2df7bf 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -17,7 +17,7 @@ jobs: steps: # Checkout the Code - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Set up git hashes environment variables - name: Git Hashes uses: Im-Fran/git-hashes-action@v1.0.3 @@ -52,7 +52,7 @@ jobs: args: ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar application/java-archive # Now we deploy the documents to GitHub pages - name: Deploy Dokka - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.4.3 with: branch: gh-pages folder: build/dokka diff --git a/.github/workflows/gradle-test.yml b/.github/workflows/gradle-test.yml index e2bcf6e..751318f 100644 --- a/.github/workflows/gradle-test.yml +++ b/.github/workflows/gradle-test.yml @@ -7,26 +7,26 @@ jobs: fail-fast: false max-parallel: 4 matrix: - java-version: [11,16,17] + java-version: [11, 16, 17] # Set up OS runs-on: ubuntu-latest # Set up environment variables env: - ENV: 'local' # Set to local, so it won't deploy the jar to the repos + ENV: "local" # Set to local, so it won't deploy the jar to the repos steps: # Checkout code - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Setup java and maven - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 with: distribution: adopt java-version: ${{ matrix.java-version }} - cache: 'gradle' + cache: "gradle" # Setup executable gradle - name: Make Gradle executable run: chmod +x gradlew # Test building without dokka - name: Build Jar with Java ${{ matrix.java-version }} - run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon \ No newline at end of file + run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 91e75b3..b63fdf3 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -6,5 +6,5 @@ jobs: name: "Validation" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 \ No newline at end of file + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v1 diff --git a/build.gradle.kts b/build.gradle.kts index 65d7df1..1ce4111 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,19 +3,19 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { `maven-publish` - id("io.github.gradle-nexus.publish-plugin") version "1.1.0" - id("com.github.johnrengelman.shadow") version "7.1.2" + id("io.github.gradle-nexus.publish-plugin") version "1.3.0" + id("com.github.johnrengelman.shadow") version "8.1.1" id("cl.franciscosolis.blossom-extended") version "1.3.1" - kotlin("jvm") version "1.8.10" - id("org.jetbrains.dokka") version "1.7.20" + kotlin("jvm") version "1.9.10" + id("org.jetbrains.dokka") version "1.9.10" } val env = project.rootProject.file(".env").let { file -> if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap() }.toMutableMap().apply { putAll(System.getenv()) } -val projectVersion = env["VERSION"] ?: "0.3.1-SNAPSHOT" +val projectVersion = env["VERSION"] ?: "0.4.1-SNAPSHOT" group = "xyz.theprogramsrc" version = projectVersion @@ -26,21 +26,31 @@ repositories { mavenCentral() maven("https://s01.oss.sonatype.org/content/groups/public/") + maven("https://oss.sonatype.org/content/repositories/snapshots/") + maven("https://oss.sonatype.org/content/repositories/releases/") maven("https://oss.sonatype.org/content/groups/public/") maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") + maven("https://repo.papermc.io/repository/maven-public/") maven("https://repo.codemc.org/repository/maven-public/") maven("https://jitpack.io/") } dependencies { - compileOnly("xyz.theprogramsrc:simplecoreapi:0.6.2-SNAPSHOT") + compileOnly("xyz.theprogramsrc:simplecoreapi:0.8.0-SNAPSHOT") - implementation("org.apache.logging.log4j:log4j-api:2.19.0") - implementation("org.apache.logging.log4j:log4j-core:2.19.0") + implementation("org.apache.logging.log4j:log4j-api:2.21.0") + implementation("org.apache.logging.log4j:log4j-core:2.21.0") - testImplementation("org.junit.jupiter:junit-jupiter:5.9.2") + testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") } +blossom { + replaceToken("@name@", rootProject.name) + replaceToken("@version@", project.version.toString()) + replaceToken("@description@", project.description) + replaceToken("@git_short@", env["GIT_COMMIT_SHORT_HASH"] ?: "unknown") + replaceToken("@git_full@", env["GIT_COMMIT_LONG_HASH"] ?: "unknown") +} tasks { named("shadowJar") { @@ -88,8 +98,7 @@ tasks { } dokkaHtml { - outputDirectory.set(file(project.buildDir.absolutePath + "/dokka")) - + outputDirectory.set(layout.buildDirectory.dir("dokka/")) } } @@ -161,14 +170,16 @@ publishing { } } -nexusPublishing { - repositories { - sonatype { - nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) - snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) +if(env["ENV"] == "prod") { + nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) - username.set(env["SONATYPE_USERNAME"]) - password.set(env["SONATYPE_PASSWORD"]) + username.set(env["SONATYPE_USERNAME"]) + password.set(env["SONATYPE_PASSWORD"]) + } } } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..7f93135 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 42defcc..3fa8f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..1aa94a4 100755 --- a/gradlew +++ b/gradlew @@ -83,10 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/src/main/kotlin/xyz/theprogramsrc/loggingmodule/Main.kt b/src/main/kotlin/xyz/theprogramsrc/loggingmodule/Main.kt index 8e5d820..6bf9fc0 100644 --- a/src/main/kotlin/xyz/theprogramsrc/loggingmodule/Main.kt +++ b/src/main/kotlin/xyz/theprogramsrc/loggingmodule/Main.kt @@ -1,5 +1,22 @@ package xyz.theprogramsrc.loggingmodule -import xyz.theprogramsrc.simplecoreapi.global.module.Module +import xyz.theprogramsrc.simplecoreapi.global.models.module.Module +import xyz.theprogramsrc.simplecoreapi.global.models.module.ModuleDescription -class Main: Module() \ No newline at end of file +class FilesModule: Module { + + override val description: ModuleDescription = + ModuleDescription( + name = "@name@", + version = "@version@", + authors = listOf("Im-Fran") + ) + + override fun onEnable() { + // Do nothing + } + + override fun onDisable() { + // Do nothing + } +} \ No newline at end of file diff --git a/src/main/resources/module.properties b/src/main/resources/module.properties deleted file mode 100644 index 838c8ac..0000000 --- a/src/main/resources/module.properties +++ /dev/null @@ -1,6 +0,0 @@ -main=xyz.theprogramsrc.loggingmodule.Main -name=LoggingModule -description=@description@ -version=@version@ -author=TheProgramSrc -module-id=loggingmodule