Remove build.gradle (unsupported)
This commit is contained in:
parent
56f5c04619
commit
778be07e51
6 changed files with 59 additions and 101 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -174,6 +174,8 @@ Desktop.ini
|
|||
|
||||
.cursorrules
|
||||
.windsurfrules
|
||||
context.json
|
||||
run.sh
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
|
|
|||
95
build.gradle
95
build.gradle
|
|
@ -1,95 +0,0 @@
|
|||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
||||
id 'com.palantir.git-version' version '0.13.0'
|
||||
}
|
||||
|
||||
group = 'net.coreprotect'
|
||||
String projectVersion = '22.4'
|
||||
String projectBranch = ''
|
||||
version = projectVersion // `version` might be modified, we don't always want that (e.g. plugin.yml)
|
||||
description = 'Provides block protection for your server.'
|
||||
sourceCompatibility = '21'
|
||||
|
||||
if (System.getenv("BUILD_NUMBER") != null) {
|
||||
// Being built in Jenkins, append Build ID
|
||||
version += "-${System.getenv("BUILD_NUMBER")}"
|
||||
} else if (!(version ==~ '^[^.]*\\.[^.]*\\.[^.]*$')) { // Thanks https://stackoverflow.com/a/9949200/1709894
|
||||
// Append the Git hash if 'version' has less than two periods
|
||||
version += "-${gitVersion()}"
|
||||
}
|
||||
logger.info("Building version $version")
|
||||
|
||||
repositories {
|
||||
maven { url = 'https://hub.spigotmc.org/nexus/content/groups/public/' }
|
||||
maven { url = 'https://repo.papermc.io/repository/maven-public/' }
|
||||
maven { url = 'https://repo.codemc.org/repository/maven-public/' }
|
||||
maven { url = 'https://jitpack.io' }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("com.intellectualsites.bom:bom-newest:1.45")) // Ref: https://github.com/IntellectualSites/bom
|
||||
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
|
||||
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit")
|
||||
compileOnly 'io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT'
|
||||
implementation 'org.bstats:bstats-bukkit-lite:1.8'
|
||||
implementation 'com.zaxxer:HikariCP:5.0.1'
|
||||
implementation 'com.github.DeadSilenceIV:AdvancedChestsAPI:3.2-BETA'
|
||||
implementation 'com.github.oshi:oshi-core:6.6.2'
|
||||
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
|
||||
}
|
||||
|
||||
jar {
|
||||
archiveClassifier.set("original")
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives shadowJar
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
dependencies {
|
||||
// #toString because #getGroup technically returns an Object
|
||||
relocate('org.bstats', project.group.toString())
|
||||
relocate('com.zaxxer', project.group.toString())
|
||||
exclude(dependency('com.google.code.gson:.*'))
|
||||
exclude(dependency('org.intellij:.*'))
|
||||
exclude(dependency('org.jetbrains:.*'))
|
||||
exclude(dependency('org.slf4j:.*'))
|
||||
exclude(dependency('org.apache.logging.log4j:.*'))
|
||||
exclude(dependency('net.java.dev.jna:.*'))
|
||||
}
|
||||
archiveClassifier.set(null)
|
||||
}
|
||||
|
||||
ext {
|
||||
author = 'Intelli'
|
||||
|
||||
resourceTokens = [
|
||||
'project.version': projectVersion,
|
||||
'project.branch': projectBranch,
|
||||
]
|
||||
}
|
||||
|
||||
processResources {
|
||||
include 'plugin.yml'
|
||||
// Whole lotta boilerplate to get the same functionality as Maven here.
|
||||
// Replace this if Gradle ever lets us configure the filter before filtering.
|
||||
filter(new Transformer<String, String>() {
|
||||
@Override
|
||||
String transform(String s) {
|
||||
ReplaceTokens replaceTokens = new ReplaceTokens(new StringReader(s))
|
||||
replaceTokens.setBeginToken('${')
|
||||
replaceTokens.setEndToken('}')
|
||||
resourceTokens.forEach { key, val ->
|
||||
def token = new ReplaceTokens.Token()
|
||||
token.setKey(key.toString())
|
||||
token.setValue(val.toString())
|
||||
replaceTokens.addConfiguredToken(token)
|
||||
}
|
||||
return replaceTokens.readLines().join('\n')
|
||||
}
|
||||
})
|
||||
}
|
||||
49
pom.xml
49
pom.xml
|
|
@ -6,6 +6,7 @@
|
|||
<properties>
|
||||
<project.branch></project.branch>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
<build>
|
||||
<resources>
|
||||
|
|
@ -28,6 +29,18 @@
|
|||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-testCompile</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>testCompile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skipTests}</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
@ -87,6 +100,17 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.2.3</version>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<plugin.version>${project.version}</plugin.version>
|
||||
</systemPropertyVariables>
|
||||
<skipTests>${skipTests}</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
|
|
@ -174,5 +198,30 @@
|
|||
<version>3.2-BETA</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.10.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>5.10.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>5.10.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<version>5.10.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -60,7 +60,7 @@ public final class CoreProtect extends JavaPlugin {
|
|||
ShutdownService.safeShutdown(this);
|
||||
}
|
||||
|
||||
public boolean isAdvancedChestsEnabled(){
|
||||
public boolean isAdvancedChestsEnabled() {
|
||||
return advancedChestsEnabled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,10 @@ import net.coreprotect.database.Lookup;
|
|||
import net.coreprotect.database.rollback.Rollback;
|
||||
import net.coreprotect.language.Phrase;
|
||||
import net.coreprotect.listener.player.InventoryChangeListener;
|
||||
import net.coreprotect.utility.BlockUtils;
|
||||
import net.coreprotect.utility.Chat;
|
||||
import net.coreprotect.utility.EntityUtils;
|
||||
import net.coreprotect.utility.MaterialUtils;
|
||||
import net.coreprotect.utility.StringUtils;
|
||||
import net.coreprotect.utility.Util;
|
||||
import net.coreprotect.utility.WorldUtils;
|
||||
|
||||
public class CoreProtectAPI extends Queue {
|
||||
|
|
@ -196,7 +194,7 @@ public class CoreProtectAPI extends Queue {
|
|||
boolean match = false;
|
||||
|
||||
if (Config.getGlobal().API_ENABLED) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long timestamp = getCurrentTimeMillis();
|
||||
long offsetTime = timestamp - offset * 1000L;
|
||||
List<String[]> check = blockLookup(block, time);
|
||||
|
||||
|
|
@ -217,7 +215,7 @@ public class CoreProtectAPI extends Queue {
|
|||
boolean match = false;
|
||||
|
||||
if (Config.getGlobal().API_ENABLED) {
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long timestamp = getCurrentTimeMillis();
|
||||
long offsetTime = timestamp - offset * 1000L;
|
||||
List<String[]> check = blockLookup(block, time);
|
||||
|
||||
|
|
@ -233,6 +231,10 @@ public class CoreProtectAPI extends Queue {
|
|||
return match;
|
||||
}
|
||||
|
||||
protected long getCurrentTimeMillis() {
|
||||
return System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return Config.getGlobal().API_ENABLED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class RollbackProcessor {
|
|||
|
||||
List<Object> meta = null;
|
||||
if (rowMeta != null) {
|
||||
meta = Rollback.deserializeMetadata(rowMeta);
|
||||
meta = RollbackUtil.deserializeMetadata(rowMeta);
|
||||
}
|
||||
|
||||
BlockData blockData = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue