Skip to content

Commit

Permalink
feat: updates & comply with simplecoreapi 0.8.0 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Im-Fran authored Oct 9, 2023
1 parent 4813859 commit 116146a
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down Expand Up @@ -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/[email protected].1
uses: JamesIves/[email protected].3
with:
branch: gh-pages
folder: build/dokka
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/gradle-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon
4 changes: 2 additions & 2 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
41 changes: 26 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("com.github.johnrengelman.shadow") version "8.1.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.8.10"
kotlin("jvm") version "1.9.10"
id("org.jetbrains.dokka") version "1.9.0"
}

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.0-SNAPSHOT"

group = "xyz.theprogramsrc"
version = projectVersion
Expand All @@ -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.20.0")
implementation("org.apache.logging.log4j:log4j-core:2.20.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>("shadowJar") {
Expand Down Expand Up @@ -88,8 +98,7 @@ tasks {
}

dokkaHtml {
outputDirectory.set(file(project.buildDir.absolutePath + "/dokka"))

outputDirectory.set(layout.buildDirectory.dir("dokka/"))
}
}

Expand Down Expand Up @@ -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"])
}
}
}
}
Expand Down
21 changes: 19 additions & 2 deletions src/main/kotlin/xyz/theprogramsrc/loggingmodule/Main.kt
Original file line number Diff line number Diff line change
@@ -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()
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
}
}
6 changes: 0 additions & 6 deletions src/main/resources/module.properties

This file was deleted.

0 comments on commit 116146a

Please sign in to comment.