Skip to content

Commit 116146a

Browse files
authored
feat: updates & comply with simplecoreapi 0.8.0 (#52)
1 parent 4813859 commit 116146a

File tree

6 files changed

+54
-32
lines changed

6 files changed

+54
-32
lines changed

.github/workflows/gradle-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
steps:
1818
# Checkout the Code
1919
- name: Checkout Code
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
# Set up git hashes environment variables
2222
- name: Git Hashes
2323
uses: Im-Fran/[email protected]
@@ -52,7 +52,7 @@ jobs:
5252
args: ./build/libs/${{ env.PROJECT_NAME }}-${{ env.VERSION }}.jar application/java-archive
5353
# Now we deploy the documents to GitHub pages
5454
- name: Deploy Dokka
55-
uses: JamesIves/[email protected].1
55+
uses: JamesIves/[email protected].3
5656
with:
5757
branch: gh-pages
5858
folder: build/dokka

.github/workflows/gradle-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ jobs:
77
fail-fast: false
88
max-parallel: 4
99
matrix:
10-
java-version: [11,16,17]
10+
java-version: [11, 16, 17]
1111
# Set up OS
1212
runs-on: ubuntu-latest
1313
# Set up environment variables
1414
env:
15-
ENV: 'local' # Set to local, so it won't deploy the jar to the repos
15+
ENV: "local" # Set to local, so it won't deploy the jar to the repos
1616
steps:
1717
# Checkout code
1818
- name: Checkout Code
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
# Setup java and maven
2121
- name: Set up JDK ${{ matrix.java-version }}
2222
uses: actions/setup-java@v3
2323
with:
2424
distribution: adopt
2525
java-version: ${{ matrix.java-version }}
26-
cache: 'gradle'
26+
cache: "gradle"
2727
# Setup executable gradle
2828
- name: Make Gradle executable
2929
run: chmod +x gradlew
3030
# Test building without dokka
3131
- name: Build Jar with Java ${{ matrix.java-version }}
32-
run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon
32+
run: ./gradlew clean shadowJar test -x dokkaHtml -no-daemon

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ jobs:
66
name: "Validation"
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v3
10-
- uses: gradle/wrapper-validation-action@v1
9+
- uses: actions/checkout@v4
10+
- uses: gradle/wrapper-validation-action@v1

build.gradle.kts

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
44
plugins {
55
`maven-publish`
66
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
7-
id("com.github.johnrengelman.shadow") version "8.1.0"
7+
id("com.github.johnrengelman.shadow") version "8.1.1"
88
id("cl.franciscosolis.blossom-extended") version "1.3.1"
99

10-
kotlin("jvm") version "1.8.10"
11-
id("org.jetbrains.dokka") version "1.8.10"
10+
kotlin("jvm") version "1.9.10"
11+
id("org.jetbrains.dokka") version "1.9.0"
1212
}
1313

1414
val env = project.rootProject.file(".env").let { file ->
1515
if(file.exists()) file.readLines().filter { it.isNotBlank() && !it.startsWith("#") && it.split("=").size == 2 }.associate { it.split("=")[0] to it.split("=")[1] } else emptyMap()
1616
}.toMutableMap().apply { putAll(System.getenv()) }
1717

18-
val projectVersion = env["VERSION"] ?: "0.3.1-SNAPSHOT"
18+
val projectVersion = env["VERSION"] ?: "0.4.0-SNAPSHOT"
1919

2020
group = "xyz.theprogramsrc"
2121
version = projectVersion
@@ -26,21 +26,31 @@ repositories {
2626
mavenCentral()
2727

2828
maven("https://s01.oss.sonatype.org/content/groups/public/")
29+
maven("https://oss.sonatype.org/content/repositories/snapshots/")
30+
maven("https://oss.sonatype.org/content/repositories/releases/")
2931
maven("https://oss.sonatype.org/content/groups/public/")
3032
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
33+
maven("https://repo.papermc.io/repository/maven-public/")
3134
maven("https://repo.codemc.org/repository/maven-public/")
3235
maven("https://jitpack.io/")
3336
}
3437

3538
dependencies {
36-
compileOnly("xyz.theprogramsrc:simplecoreapi:0.6.2-SNAPSHOT")
39+
compileOnly("xyz.theprogramsrc:simplecoreapi:0.8.0-SNAPSHOT")
3740

3841
implementation("org.apache.logging.log4j:log4j-api:2.20.0")
3942
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
4043

41-
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
44+
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
4245
}
4346

47+
blossom {
48+
replaceToken("@name@", rootProject.name)
49+
replaceToken("@version@", project.version.toString())
50+
replaceToken("@description@", project.description)
51+
replaceToken("@git_short@", env["GIT_COMMIT_SHORT_HASH"] ?: "unknown")
52+
replaceToken("@git_full@", env["GIT_COMMIT_LONG_HASH"] ?: "unknown")
53+
}
4454

4555
tasks {
4656
named<ShadowJar>("shadowJar") {
@@ -88,8 +98,7 @@ tasks {
8898
}
8999

90100
dokkaHtml {
91-
outputDirectory.set(file(project.buildDir.absolutePath + "/dokka"))
92-
101+
outputDirectory.set(layout.buildDirectory.dir("dokka/"))
93102
}
94103
}
95104

@@ -161,14 +170,16 @@ publishing {
161170
}
162171
}
163172

164-
nexusPublishing {
165-
repositories {
166-
sonatype {
167-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
168-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
173+
if(env["ENV"] == "prod") {
174+
nexusPublishing {
175+
repositories {
176+
sonatype {
177+
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
178+
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
169179

170-
username.set(env["SONATYPE_USERNAME"])
171-
password.set(env["SONATYPE_PASSWORD"])
180+
username.set(env["SONATYPE_USERNAME"])
181+
password.set(env["SONATYPE_PASSWORD"])
182+
}
172183
}
173184
}
174185
}
Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
package xyz.theprogramsrc.loggingmodule
22

3-
import xyz.theprogramsrc.simplecoreapi.global.module.Module
3+
import xyz.theprogramsrc.simplecoreapi.global.models.module.Module
4+
import xyz.theprogramsrc.simplecoreapi.global.models.module.ModuleDescription
45

5-
class Main: Module()
6+
class FilesModule: Module {
7+
8+
override val description: ModuleDescription =
9+
ModuleDescription(
10+
name = "@name@",
11+
version = "@version@",
12+
authors = listOf("Im-Fran")
13+
)
14+
15+
override fun onEnable() {
16+
// Do nothing
17+
}
18+
19+
override fun onDisable() {
20+
// Do nothing
21+
}
22+
}

src/main/resources/module.properties

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)