Skip to content

Commit

Permalink
Merge pull request #43 from Nookure/dev
Browse files Browse the repository at this point in the history
Release 2.4.0
  • Loading branch information
Angelillo15 authored Sep 4, 2023
2 parents fce6643 + 5028394 commit 4e8d28d
Show file tree
Hide file tree
Showing 312 changed files with 9,789 additions and 8,587 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Javadoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
cd ..
rm -r javadocs/javadocs/mastaff/
ls javadocs/javadocs/
cp -r MAStaff/MAStaff-API/build/docs/javadoc javadocs/javadocs/mastaff/
ls javadocs/javadocs/mastaff
cd javadocs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout main branch from GitHub
- name: Checkout main branch from GitHub
uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Seting up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 11

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Execute Gradle build
run: |
chmod +x gradlew
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/publish-api.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Publish to nexus

on: [push]
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant perms to gradlew
run: chmod +x ./gradlew
- name: build
run: ./gradlew shadowJar
- name: Nexus Repo Publish
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://repo.nookure.com/
username: admin
password: ${{ secrets.NEXUS_PASSWORD }}
format: maven2
repository: maven-releases
coordinates: groupId=es.angelillo15 artifactId=mast-api version=2.0.0b
assets: extension=jar
filename: ./MAStaff-API/build/libs/MAStaff-API.jar
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant perms to gradlew
run: chmod +x ./gradlew
- name: build
run: ./gradlew shadowJar
- name: Nexus Repo Publish
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://repo.nookure.com/
username: admin
password: ${{ secrets.NEXUS_PASSWORD }}
format: maven2
repository: maven-releases
coordinates: groupId=es.angelillo15 artifactId=mast-api version=2.0.0b
assets: extension=jar
filename: ./MAStaff-API/build/libs/MAStaff-API.jar
89 changes: 46 additions & 43 deletions MAStaff-API/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import java.time.LocalDateTime
import java.time.format.DateTimeFormatter

plugins {
id("java")
`maven-publish`
id("net.kyori.blossom") version "1.3.1"
id("org.ajoberstar.grgit") version "4.1.0"
id("java")
`maven-publish`
id("net.kyori.blossom") version "1.3.1"
id("org.ajoberstar.grgit") version "4.1.0"
}

group = "es.angelillo15"
Expand All @@ -16,46 +16,49 @@ configurations["compileClasspath"].extendsFrom(compileOnlyApi)
configurations["apiElements"].extendsFrom(compileOnlyApi)

dependencies {
compileOnly(libs.waterfall)
compileOnly(libs.spigot)
compileOnly(libs.placeholderApi)
compileOnly(libs.eglow)
compileOnly(libs.liblyBukkit)
compileOnly(libs.bundles.invAPI)
compileOnly(libs.configUpdater)
compileOnly(libs.snakeYaml)
compileOnly(libs.simpleYaml)
compileOnly(libs.jedis)
compileOnly(libs.hikariCP)
compileOnly(libs.caffeine)
compileOnly(libs.storm)
compileOnly(libs.configManager)
compileOnly(libs.adventureApi)
compileOnly(libs.adventureBukkit)
compileOnly(libs.adventureBungee)
compileOnly(libs.miniMessage)
compileOnly(libs.protocolLib)
compileOnly(libs.vault)
compileOnly(libs.velocity)
compileOnly(libs.waterfall)
compileOnly(libs.spigot)
compileOnly(libs.placeholderApi)
compileOnly(libs.liblyBukkit)
compileOnly(libs.bundles.invAPI)
compileOnly(libs.configUpdater)
compileOnly(libs.snakeYaml)
compileOnly(libs.simpleYaml)
compileOnly(libs.jedis)
compileOnly(libs.hikariCP)
compileOnly(libs.caffeine)
compileOnly(libs.storm)
compileOnly(libs.configManager)
compileOnly(libs.adventureApi)
compileOnly(libs.adventureBukkit)
compileOnly(libs.adventureBungee)
compileOnly(libs.miniMessage)
compileOnly(libs.protocolLib)
compileOnly(libs.vault)
compileOnly(libs.velocity)
}

blossom {
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
val current = LocalDateTime.now().format(formatter)


replaceTokenIn("src/main/java/es/angelillo15/mast/api/Constants.java")
replaceToken("{version}", project.version)
replaceToken("{git-commit}", grgit.head().abbreviatedId ?: "undefined")
replaceToken("{git-user}", grgit.head().committer.name ?: "undefined")
replaceToken("{git-date}", current ?: "undefined")
replaceToken("{git-branch}", grgit.branch.current().name ?: "undefined")

if (project.version.toString().endsWith("-SNAPSHOT") ||
project.version.toString().endsWith("-DEV") ||
project.version.toString().endsWith("-BETA") ||
project.version.toString().endsWith("-ALPHA"))
{
replaceToken("false", "true")
}
val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm")
val current = LocalDateTime.now().format(formatter)


replaceTokenIn("src/main/java/es/angelillo15/mast/api/Constants.java")
replaceToken("{version}", project.version)
replaceToken("{git-commit}", grgit.head().abbreviatedId ?: "undefined")
replaceToken("{git-user}", grgit.head().committer.name ?: "undefined")
replaceToken("{git-date}", current ?: "undefined")
replaceToken("{git-branch}", grgit.branch.current().name ?: "undefined")

if (project.version.toString().endsWith("-SNAPSHOT") ||
project.version.toString().endsWith("-DEV") ||
project.version.toString().endsWith("-BETA") ||
project.version.toString().endsWith("-ALPHA")
) {
replaceToken("false", "true")
}
}

tasks.withType<Javadoc> {
options.encoding = "UTF-8"
}
23 changes: 10 additions & 13 deletions MAStaff-API/src/main/java/es/angelillo15/mast/api/Constants.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package es.angelillo15.mast.api;

import lombok.Getter;

public class Constants {
public static final String VERSION = "{version}";
public static final String COMMIT = "{git-commit}";
public static final String COMMIT_USER = "{git-user}";
public static final String COMMIT_TIME = "{git-date}";
public static final String GIT_BRANCH = "{git-branch}";
public static final boolean DEV_MODE = false;
public static String getVersion() {
return VERSION;
}
private Constants() {}


public static final String VERSION = "{version}";
public static final String COMMIT = "{git-commit}";
public static final String COMMIT_USER = "{git-user}";
public static final String COMMIT_TIME = "{git-date}";
public static final String GIT_BRANCH = "{git-branch}";
public static final boolean DEV_MODE = false;
private Constants() {}
public static String getVersion() {
return VERSION;
}
}
60 changes: 30 additions & 30 deletions MAStaff-API/src/main/java/es/angelillo15/mast/api/ILogger.java
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
package es.angelillo15.mast.api;

public abstract class ILogger {
private static ILogger instance;
private static ILogger instance;

public static ILogger getInstance() {
return instance;
}

public static void setInstance(ILogger instance) {
ILogger.instance = instance;
}
public static ILogger getInstance() {
return instance;
}

abstract public void info(String message);
public static void setInstance(ILogger instance) {
ILogger.instance = instance;
}

abstract public void warn(String message);
public abstract void info(String message);

abstract public void error(String message);
public abstract void warn(String message);

abstract public void debug(String message);
public abstract void error(String message);

void info(String message, Object... args) {
info(format(message, args));
}
public abstract void debug(String message);

void warn(String message, Object... args) {
warn(format(message, args));
}
void info(String message, Object... args) {
info(format(message, args));
}

void error(String message, Object... args) {
error(format(message, args));
}
void warn(String message, Object... args) {
warn(format(message, args));
}

void debug(String message, Object... args) {
debug(format(message, args));
}
void error(String message, Object... args) {
error(format(message, args));
}

String format(String message, Object... args) {
String msg = message;
for (Object arg : args) {
msg = msg.replaceFirst("\\{\\}", arg.toString());
}
void debug(String message, Object... args) {
debug(format(message, args));
}

return msg;
String format(String message, Object... args) {
String msg = message;
for (Object arg : args) {
msg = msg.replaceFirst("\\{\\}", arg.toString());
}

return msg;
}
}
Loading

0 comments on commit 4e8d28d

Please sign in to comment.