Skip to content

Commit

Permalink
Merge pull request #224 from Picono435/development
Browse files Browse the repository at this point in the history
Update to 1.0-beta-7
  • Loading branch information
Picono435 authored Aug 14, 2022
2 parents 08c8864 + cd55910 commit b5c8c32
Show file tree
Hide file tree
Showing 71 changed files with 691 additions and 429 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/dev-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ jobs:
- name: Publish slimJar to maven local
run: |
cd slimjar
../gradlew publishToMavenLocal
chmod +x gradlew
./gradlew publishToMavenLocal
- name: Tests with Gradle
run: ./gradlew test
env:
STABLE_BUILD: 1
run: |
ls
./gradlew test
- name: Build with Gradle
env:
STABLE_BUILD: 1
run: ./gradlew shadowJar
- name: Publish Unit Test Results
uses: mikepenz/action-junit-report@v1
uses: mikepenz/action-junit-report@v3
if: >
always() &&
github.event.sender.login != 'dependabot[bot]' &&
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/stable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ jobs:
env:
STABLE_BUILD: 0
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
uses: mikepenz/action-junit-report@v3
if: >
always() &&
github.event.sender.login != 'dependabot[bot]' &&
( github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository )
with:
files: build/test-results/**/*.xml
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Upload Artifact
uses: actions/[email protected]
with:
Expand Down
66 changes: 30 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,89 +17,83 @@ if (System.getenv("STABLE_BUILD") != null) {
if (System.getenv("STABLE_BUILD") == '1') {
version versioning.info.build + "-DEV"
} else {
version "1.0-beta-6"
version "1.0-beta-7"
}
} else {
version versioning.info.build + "-DEV"
version "1.0-beta-7"
}

repositories {
mavenCentral()

maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}

maven {
url = 'https://oss.sonatype.org/content/repositories/snapshots'
}

maven {
url = 'https://oss.sonatype.org/content/repositories/central'
}

maven {
url = 'https://repo.citizensnpcs.co/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}

maven {
url = 'https://jitpack.io'
content {
includeGroupByRegex "com\\.github.*"
}
}

maven {
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}

maven {
url = 'https://repo.codemc.org/repository/maven-public'
content {
includeGroupByRegex "me\\.clip.*"
}
}

maven {
url = 'https://repo.rosewooddev.io/repository/public/'
content {
includeGroupByRegex "org\\.black_ixx.*"
}
}

mavenLocal();

maven {
url = 'https://repo.vshnv.tech/'
}
}

dependencies {
// Slimjar
shadow implementation(slimjar("1.2.6"))
// Spigot
compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT'
// Storage Methods
slim 'org.mongodb:mongodb-driver-sync:4.5.0'
slim 'org.mongodb:mongodb-driver-sync:4.7.1'
slim 'com.zaxxer:HikariCP:4.0.3'
slim 'com.h2database:h2:1.4.200'
slim 'org.xerial:sqlite-jdbc:3.36.0.3'
slim 'org.mariadb.jdbc:mariadb-java-client:3.0.3'
slim 'mysql:mysql-connector-java:8.0.28'
slim 'org.xerial:sqlite-jdbc:3.39.2.0'
slim 'org.mariadb.jdbc:mariadb-java-client:3.0.7'
slim 'mysql:mysql-connector-java:8.0.30'
shadow implementation('org.spongepowered:configurate-core:4.1.2')
shadow implementation('org.spongepowered:configurate-gson:4.1.2')
shadow implementation('org.spongepowered:configurate-yaml:4.1.2')
shadow implementation('org.spongepowered:configurate-hocon:4.1.2')
// Plugins API
compileOnly('me.clip:placeholderapi:2.11.1') { transitive = false }
compileOnly('me.clip:placeholderapi:2.11.2') { transitive = false }
compileOnly('com.github.MilkBowl:VaultAPI:1.7.1') { transitive = false }
compileOnly('org.black_ixx:playerpoints:3.2.0') { transitive = false }
compileOnly('org.black_ixx:playerpoints:3.2.4') { transitive = false }
compileOnly('com.github.Realizedd:TokenManager:3.2.4') { transitive = false }
// Other libraries
shadow implementation('com.github.mkremins:fanciful:18dc039f5b')
slim 'com.fasterxml.jackson.core:jackson-databind:2.13.1'
slim 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.1'
shadow implementation('org.apache.maven:maven-artifact:3.8.4')
slim 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
slim 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.3'
shadow implementation('org.apache.maven:maven-artifact:3.8.6')
shadow implementation('org.bstats:bstats-bukkit:3.0.0')
slim 'org.slf4j:slf4j-simple:1.7.36'
slim 'org.slf4j:slf4j-api:1.7.36'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.16:1.0.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
testCompileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
testCompileOnly('me.clip:placeholderapi:2.10.10') { transitive = false }
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
testCompileOnly 'org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT'
testCompileOnly('me.clip:placeholderapi:2.11.2') { transitive = false }
testCompileOnly('com.github.MilkBowl:VaultAPI:1.7') { transitive = false }
testCompileOnly('org.black_ixx:playerpoints:3.1.1') { transitive = false }
testCompileOnly('org.black_ixx:playerpoints:3.2.3') { transitive = false }
testCompileOnly('com.github.Realizedd:TokenManager:3.2.4') { transitive = false }
}

Expand All @@ -109,7 +103,7 @@ slimJar {
relocate 'org.h2', 'com.gmail.picono435.picojobs.libs.h2'
relocate 'com.h2database', 'com.gmail.picono435.picojobs.libs.h2database'
relocate 'org.xerial', 'com.gmail.picono435.picojobs.libs.xerial'
relocate 'org.mariadb.jbdc', 'com.gmail.picono435.picojobs.libs.mariadb'
relocate 'org.mariadb.jdbc', 'com.gmail.picono435.picojobs.libs.mariadb'
relocate 'com.mysql', 'com.gmail.picono435.picojobs.libs.mysql'
relocate 'com.fasterxml.jackson', 'com.gmail.picono435.picojobs.libs.jackson'
relocate 'org.slf4j', 'com.gmail.picono435.picojobs.libs.slf4j'
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
slimjar.version = 1.2.3
slimjar.version = 1.2.6
slimjar.default.repo.releases.apply=false
slimjar.default.repo.snapshot.apply=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class SlimJarPlugin : Plugin<Project> {
}
project.dependencies.extra.set(
"slimjar",
asGroovyClosure("+") { version -> "io.github.slimjar:slimjar:$version" }
asGroovyClosure("+") { version -> slimJarLib(version) }
)
// Hooks into shadow to inject relocations
val shadowTask = tasks.withType(ShadowJar::class.java).firstOrNull() ?: return
Expand All @@ -90,12 +90,10 @@ class SlimJarPlugin : Plugin<Project> {
}
}

/*slimJar.outputs.upToDateWhen {
true
}*/

// Runs the task once resources are being processed to save the json file
tasks.findByName(RESOURCES_TASK)?.finalizedBy(slimJar)
}

}

internal fun slimJarLib(version: String) = "io.github.slimjar:slimjar:$version"
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
package io.github.slimjar.func

import io.github.slimjar.exceptions.ConfigurationNotFoundException
import io.github.slimjar.slimJarLib
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.maven

/**
* Checks in the gradle.properties if should or not resolve dependencies at compile time
Expand Down Expand Up @@ -77,13 +77,9 @@ fun Project.createConfig(configName: String, vararg extends: String): Configurat
/**
* Extension for KDSL support
*/
fun DependencyHandlerScope.slimjar(version: String = "+"): String =
(extensions.getByName("slimjar") as? (String) -> String)?.let { it(version) }
?: throw IllegalStateException()
fun DependencyHandlerScope.slimjar(version: String = "+"): String = slimJarLib(version)

/**
* Extension for KDSL support
*/
fun DependencyHandler.slimjar(version: String = "+"): String =
(extensions.getByName("slimjar") as? (String) -> String)?.let { it(version) }
?: throw IllegalStateException()
fun DependencyHandler.slimjar(version: String = "+"): String = slimJarLib(version)
17 changes: 0 additions & 17 deletions slimjar/slimjar/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,6 @@ publishing {

}
}
repositories {
maven {
if (project.version.endsWith('-SNAPSHOT')) {
url "https://repo.vshnv.tech/snapshots/"
} else {
url "https://repo.vshnv.tech/releases/"
}

credentials {
username = project.findProperty("reposiliteAlias") ?: ""
password = project.findProperty("reposiliteToken") ?: ""
}
authentication {
basic(BasicAuthentication)
}
}
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
import io.github.slimjar.resolver.data.DependencyData;
import io.github.slimjar.resolver.data.Repository;
import io.github.slimjar.resolver.mirrors.SimpleMirrorSelector;
import io.github.slimjar.resolver.data.Mirror;
import io.github.slimjar.resolver.data.Repository;
import io.github.slimjar.resolver.mirrors.MirrorSelector;
import io.github.slimjar.util.Packages;

import java.io.File;
Expand Down Expand Up @@ -128,12 +125,6 @@ public static JarRelocatorFacadeFactory create(final Path downloadPath, final Co
.dataProviderFactory((url) -> () -> ReflectiveJarRelocatorFacadeFactory.getJarRelocatorDependency(repositories))
.relocatorFactory((rules) -> new PassthroughRelocator())
.relocationHelperFactory((relocator) -> (dependency,file) -> file)
.mirrorSelector(new MirrorSelector() {
@Override
public Collection<Repository> select(Collection<Repository> collection, Collection<Mirror> collection1) throws MalformedURLException {
return collection;
}
})
.build();
final Class<?> jarRelocatorClass = Class.forName(Packages.fix(JAR_RELOCATOR_PACKAGE), true, classLoader);
final Class<?> relocationClass = Class.forName(Packages.fix(RELOCATION_PACKAGE), true, classLoader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.stream.Collectors;

public final class SimpleMirrorSelector implements MirrorSelector {
public static final String DEFAULT_CENTRAL_MIRROR_URL = "https://repo.vshnv.tech/";
public static final String DEFAULT_CENTRAL_MIRROR_URL = "https://repo.maven.apache.org/maven2/";
public static final String CENTRAL_URL = "https://repo.maven.apache.org/maven2/";
public static final String ALT_CENTRAL_URL = "https://repo1.maven.org/maven2/";
private static final Collection<String> CENTRAL_REPO = Arrays.asList(CENTRAL_URL, ALT_CENTRAL_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
import io.github.slimjar.resolver.data.DependencyData;
import io.github.slimjar.resolver.data.Repository;
import io.github.slimjar.util.Packages;
import io.github.slimjar.resolver.data.Mirror;
import io.github.slimjar.resolver.data.Repository;
import io.github.slimjar.resolver.mirrors.MirrorSelector;

import java.io.IOException;
import java.io.Reader;
Expand Down Expand Up @@ -82,12 +79,6 @@ public static GsonFacadeFactory create(final Path downloadPath, final Collection
.relocatorFactory((rules) -> new PassthroughRelocator())
.preResolutionDataProviderFactory(a -> Collections::emptyMap)
.relocationHelperFactory((relocator) -> (dependency,file) -> file)
.mirrorSelector(new MirrorSelector() {
@Override
public Collection<Repository> select(Collection<Repository> collection, Collection<Mirror> collection1) throws MalformedURLException {
return collection;
}
})
.build();
final Class<?> gsonClass = Class.forName(Packages.fix(GSON_PACKAGE), true, classLoader);
final Constructor<?> gsonConstructor = gsonClass.getConstructor();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/gmail/picono435/picojobs/PicoJobsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ public Handler getLoggingHandler() {
return loggingHandler;
}

/*
* Same as having serverVersion >= specifiedVersion
* Example: 1.18.1 >= 1.12.2
/**
* Same as having serverVersion &gt;= specifiedVersion
* Example: 1.18.1 &gt;= 1.12.2
*
* @param version
* @return
Expand All @@ -265,9 +265,9 @@ public boolean isMoreThan(String version) {
}
}

/*
* Same as having serverVersion <= specifiedVersion
* Example: 1.18.1 <= 1.12.2
/**
* Same as having serverVersion &lt;= specifiedVersion
* Example: 1.18.1 &lt;= 1.12.2
*
* @param version
* @return
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/gmail/picono435/picojobs/api/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.*;

import org.bukkit.ChatColor;
import com.gmail.picono435.picojobs.utils.ColorConverter;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
Expand Down Expand Up @@ -134,7 +134,7 @@ public String getID() {
* @author Picono435
*/
public String getDisplayName() {
return ChatColor.translateAlternateColorCodes('&', this.displayname);
return ColorConverter.translateAlternateColorCodes(this.displayname);
}

/**
Expand All @@ -144,7 +144,7 @@ public String getDisplayName() {
* @author Picono435
*/
public String getTag() {
return ChatColor.translateAlternateColorCodes('&', this.tag);
return ColorConverter.translateAlternateColorCodes(this.tag);
}

/**
Expand Down Expand Up @@ -251,7 +251,7 @@ public String getWorkMessage() {
if(this.workMessage == null) {
work = LanguageManager.getFormat(configString, null);
} else {
work = PlaceholderAPIHook.setPlaceholders(null, ChatColor.translateAlternateColorCodes('&', workMessage));
work = PlaceholderAPIHook.setPlaceholders(null, ColorConverter.translateAlternateColorCodes(workMessage));
}

return work;
Expand Down
Loading

0 comments on commit b5c8c32

Please sign in to comment.