diff options
-rw-r--r-- | .gitignore | 168 | ||||
-rw-r--r-- | build.gradle | 30 | ||||
-rw-r--r-- | bukkit/pom.xml | 62 | ||||
-rw-r--r-- | bungeecord/pom.xml | 55 | ||||
-rw-r--r-- | bungeecord/src/main/resources/bungee.yml | 5 | ||||
-rw-r--r-- | common/pom.xml | 63 | ||||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.jar | bin | 0 -> 54413 bytes | |||
-rw-r--r-- | gradle/wrapper/gradle-wrapper.properties | 5 | ||||
-rw-r--r-- | gradlew | 172 | ||||
-rw-r--r-- | gradlew.bat | 84 | ||||
-rw-r--r-- | pom.xml | 108 | ||||
-rw-r--r-- | settings.gradle | 2 | ||||
-rw-r--r-- | spark-bukkit/build.gradle | 11 | ||||
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java (renamed from bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java) | 0 | ||||
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java (renamed from bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java) | 0 | ||||
-rw-r--r-- | spark-bukkit/src/main/resources/plugin.yml (renamed from bukkit/src/main/resources/plugin.yml) | 4 | ||||
-rw-r--r-- | spark-bungeecord/build.gradle | 11 | ||||
-rw-r--r-- | spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java (renamed from bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java) | 0 | ||||
-rw-r--r-- | spark-bungeecord/src/main/resources/bungee.yml | 5 | ||||
-rw-r--r-- | spark-common/build.gradle | 6 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/CommandHandler.java (renamed from common/src/main/java/me/lucko/spark/common/CommandHandler.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/TickMonitor.java (renamed from common/src/main/java/me/lucko/spark/common/TickMonitor.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/http/Bytebin.java (renamed from common/src/main/java/me/lucko/spark/common/http/Bytebin.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/http/HttpClient.java (renamed from common/src/main/java/me/lucko/spark/common/http/HttpClient.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java (renamed from common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/DataAggregator.java (renamed from common/src/main/java/me/lucko/spark/profiler/DataAggregator.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/Sampler.java (renamed from common/src/main/java/me/lucko/spark/profiler/Sampler.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java (renamed from common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/StackNode.java (renamed from common/src/main/java/me/lucko/spark/profiler/StackNode.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java (renamed from common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java (renamed from common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java (renamed from common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/TickCounter.java (renamed from common/src/main/java/me/lucko/spark/profiler/TickCounter.java) | 0 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java (renamed from common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java) | 0 | ||||
-rw-r--r-- | spark-sponge/build.gradle | 14 | ||||
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java (renamed from sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java) | 5 | ||||
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java (renamed from sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java) | 0 | ||||
-rw-r--r-- | spark-universal/build.gradle | 29 | ||||
-rw-r--r-- | sponge/pom.xml | 75 | ||||
-rw-r--r-- | sponge/src/main/java-templates/me/lucko/spark/sponge/utils/PomData.java | 8 | ||||
-rw-r--r-- | universal/pom.xml | 102 |
41 files changed, 378 insertions, 646 deletions
@@ -1,164 +1,6 @@ -# Created by https://www.gitignore.io/ - -### Intellij ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/ -*.iws +/.gradle/ +/.idea/ +/build/ /out/ -*.iml -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - - -### Maven ### -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties - - -### Eclipse ### - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - - -### Linux ### -*~ - -# temporary files which can be created if a process still has a handle open of a deleted file -.fuse_hidden* - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* - -# .nfs files are created when an open file is removed but is still being accessed -.nfs* - - -### macOS ### -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon -# Thumbnails -._* -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### Windows ### -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk - - -### Java ### -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* +/run/ +/*.iml
\ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..0128f6e --- /dev/null +++ b/build.gradle @@ -0,0 +1,30 @@ +allprojects { + group = 'me.lucko' + version = '1.0-SNAPSHOT' +} + +subprojects { + apply plugin: 'java' + apply plugin: 'maven' + + ext { + pluginVersion = '1.0.4' + } + + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + + tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + } + + repositories { + mavenLocal() + mavenCentral() + + maven { url "https://repo.lucko.me/" } + maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } + maven { url "https://repo.spongepowered.org/maven" } + } + +} diff --git a/bukkit/pom.xml b/bukkit/pom.xml deleted file mode 100644 index 3e24269..0000000 --- a/bukkit/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>spark-parent</artifactId> - <groupId>me.lucko</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>spark-bukkit</artifactId> - <packaging>jar</packaging> - - <build> - <defaultGoal>clean package</defaultGoal> - <finalName>spark-bukkit</finalName> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${compiler.version}</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <!-- common --> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-common</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - - <!-- Spigot --> - <dependency> - <groupId>org.spigotmc</groupId> - <artifactId>spigot-api</artifactId> - <version>1.12.2-R0.1-SNAPSHOT</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <repositories> - <repository> - <id>spigot-repo</id> - <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> - </repository> - </repositories> - -</project> diff --git a/bungeecord/pom.xml b/bungeecord/pom.xml deleted file mode 100644 index a8c2db9..0000000 --- a/bungeecord/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>spark-parent</artifactId> - <groupId>me.lucko</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>spark-bungeecord</artifactId> - <packaging>jar</packaging> - - <build> - <defaultGoal>clean package</defaultGoal> - <finalName>spark-bungeecord</finalName> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${compiler.version}</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <!-- common --> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-common</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - - <!-- BungeeCord --> - <dependency> - <groupId>net.md-5</groupId> - <artifactId>bungeecord-api</artifactId> - <version>1.12-SNAPSHOT</version> - <scope>provided</scope> - </dependency> - </dependencies> - -</project> diff --git a/bungeecord/src/main/resources/bungee.yml b/bungeecord/src/main/resources/bungee.yml deleted file mode 100644 index 429cf0b..0000000 --- a/bungeecord/src/main/resources/bungee.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: spark -version: 1.0.4 -description: ${project.description} -author: Luck, sk89q -main: me.lucko.spark.bungeecord.SparkBungeeCordPlugin diff --git a/common/pom.xml b/common/pom.xml deleted file mode 100644 index 5f48fdf..0000000 --- a/common/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>spark-parent</artifactId> - <groupId>me.lucko</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>spark-common</artifactId> - <packaging>jar</packaging> - - <build> - <defaultGoal>clean package</defaultGoal> - <finalName>spark-common</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${compiler.version}</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <!-- gson --> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>2.7</version> - <scope>provided</scope> - </dependency> - <!-- guava --> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>19.0</version> - <scope>provided</scope> - </dependency> - - <!-- okhttp --> - <dependency> - <groupId>com.squareup.okhttp3</groupId> - <artifactId>okhttp</artifactId> - <version>3.10.0</version> - <scope>compile</scope> - </dependency> - <!-- okio --> - <dependency> - <groupId>com.squareup.okio</groupId> - <artifactId>okio</artifactId> - <version>1.14.0</version> - <scope>compile</scope> - </dependency> - </dependencies> - -</project> diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar Binary files differnew file mode 100644 index 0000000..1948b90 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.jar diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..d2c45a4 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 766d814..0000000 --- a/pom.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>me.lucko</groupId> - <artifactId>spark-parent</artifactId> - <version>1.0-SNAPSHOT</version> - - <modules> - <module>common</module> - <module>bukkit</module> - <module>bungeecord</module> - <module>sponge</module> - <module>universal</module> - </modules> - - <name>spark</name> - <description>Spark is a CPU profiling plugin based on sk89q's WarmRoast profiler.</description> - <url>https://github.com/lucko/spark</url> - - <scm> - <connection>scm:git:https://github.com/lucko/spark.git</connection> - <developerConnection>scm:git:git@github.com:lucko/spark.git</developerConnection> - <url>https://github.com/lucko/spark</url> - </scm> - - <packaging>pom</packaging> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - - <!-- Disable tests --> - <skipTests>true</skipTests> - <maven.test.skip>true</maven.test.skip> - - <!-- Standard versions used by the whole project --> - <compiler.version>3.7.0</compiler.version> - <shade.version>3.1.0</shade.version> - </properties> - - <distributionManagement> - <snapshotRepository> - <id>luck-snapshots</id> - <url>https://nexus.lucko.me/repository/maven-snapshots/</url> - </snapshotRepository> - <repository> - <id>luck-releases</id> - <url>https://nexus.lucko.me/repository/maven-releases/</url> - </repository> - </distributionManagement> - - <ciManagement> - <system>Jenkins</system> - <url>https://ci.lucko.me/job/spark</url> - </ciManagement> - - <issueManagement> - <system>GitHub</system> - <url>https://github.com/lucko/spark/issues</url> - </issueManagement> - - <profiles> - <profile> - <id>sign</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <version>1.6</version> - <executions> - <execution> - <id>sign-artifacts</id> - <phase>verify</phase> - <goals> - <goal>sign</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>ossrh</id> - <distributionManagement> - <snapshotRepository> - <id>ossrh</id> - <url>https://oss.sonatype.org/content/repositories/snapshots</url> - </snapshotRepository> - <repository> - <id>ossrh</id> - <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> - </repository> - </distributionManagement> - </profile> - </profiles> - - <repositories> - <repository> - <id>luck-repo</id> - <url>https://repo.lucko.me/</url> - </repository> - </repositories> - -</project> diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..13da274 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +rootProject.name = 'spark' +include 'spark-common', 'spark-bukkit', 'spark-bungeecord', 'spark-sponge', 'spark-universal'
\ No newline at end of file diff --git a/spark-bukkit/build.gradle b/spark-bukkit/build.gradle new file mode 100644 index 0000000..e2f4da0 --- /dev/null +++ b/spark-bukkit/build.gradle @@ -0,0 +1,11 @@ +dependencies { + compile project(':spark-common') + compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' +} + +processResources { + from(sourceSets.main.resources.srcDirs) { + expand 'pluginVersion': project.pluginVersion + include 'plugin.yml' + } +}
\ No newline at end of file diff --git a/bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java index 61a7690..61a7690 100644 --- a/bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitTickCounter.java diff --git a/bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java index dc432c5..dc432c5 100644 --- a/bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java diff --git a/bukkit/src/main/resources/plugin.yml b/spark-bukkit/src/main/resources/plugin.yml index bd549b5..94c61a3 100644 --- a/bukkit/src/main/resources/plugin.yml +++ b/spark-bukkit/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: spark -version: 1.0.4 -description: ${project.description} +version: ${pluginVersion} +description: Spark is a CPU profiling plugin based on sk89q's WarmRoast profiler authors: [Luck, sk89q] main: me.lucko.spark.bukkit.SparkBukkitPlugin diff --git a/spark-bungeecord/build.gradle b/spark-bungeecord/build.gradle new file mode 100644 index 0000000..bb87a73 --- /dev/null +++ b/spark-bungeecord/build.gradle @@ -0,0 +1,11 @@ +dependencies { + compile project(':spark-common') + compileOnly 'net.md-5:bungeecord-api:1.12-SNAPSHOT' +} + +processResources { + from(sourceSets.main.resources.srcDirs) { + expand 'pluginVersion': project.pluginVersion + include 'bungee.yml' + } +}
\ No newline at end of file diff --git a/bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java index 59bab67..59bab67 100644 --- a/bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java +++ b/spark-bungeecord/src/main/java/me/lucko/spark/bungeecord/SparkBungeeCordPlugin.java diff --git a/spark-bungeecord/src/main/resources/bungee.yml b/spark-bungeecord/src/main/resources/bungee.yml new file mode 100644 index 0000000..fa65fbc --- /dev/null +++ b/spark-bungeecord/src/main/resources/bungee.yml @@ -0,0 +1,5 @@ +name: spark +version: ${pluginVersion} +description: Spark is a CPU profiling plugin based on sk89q's WarmRoast profiler +author: Luck, sk89q +main: me.lucko.spark.bungeecord.SparkBungeeCordPlugin diff --git a/spark-common/build.gradle b/spark-common/build.gradle new file mode 100644 index 0000000..d59ce24 --- /dev/null +++ b/spark-common/build.gradle @@ -0,0 +1,6 @@ +dependencies { + compile 'com.squareup.okhttp3:okhttp:3.10.0' + compile 'com.squareup.okio:okio:1.14.0' + compileOnly 'com.google.code.gson:gson:2.7' + compileOnly 'com.google.guava:guava:19.0' +} diff --git a/common/src/main/java/me/lucko/spark/common/CommandHandler.java b/spark-common/src/main/java/me/lucko/spark/common/CommandHandler.java index 898bba7..898bba7 100644 --- a/common/src/main/java/me/lucko/spark/common/CommandHandler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/CommandHandler.java diff --git a/common/src/main/java/me/lucko/spark/common/TickMonitor.java b/spark-common/src/main/java/me/lucko/spark/common/TickMonitor.java index a30a4db..a30a4db 100644 --- a/common/src/main/java/me/lucko/spark/common/TickMonitor.java +++ b/spark-common/src/main/java/me/lucko/spark/common/TickMonitor.java diff --git a/common/src/main/java/me/lucko/spark/common/http/Bytebin.java b/spark-common/src/main/java/me/lucko/spark/common/http/Bytebin.java index 3cd5e4c..3cd5e4c 100644 --- a/common/src/main/java/me/lucko/spark/common/http/Bytebin.java +++ b/spark-common/src/main/java/me/lucko/spark/common/http/Bytebin.java diff --git a/common/src/main/java/me/lucko/spark/common/http/HttpClient.java b/spark-common/src/main/java/me/lucko/spark/common/http/HttpClient.java index 61db597..61db597 100644 --- a/common/src/main/java/me/lucko/spark/common/http/HttpClient.java +++ b/spark-common/src/main/java/me/lucko/spark/common/http/HttpClient.java diff --git a/common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java b/spark-common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java index 9a4090e..9a4090e 100644 --- a/common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/AsyncDataAggregator.java diff --git a/common/src/main/java/me/lucko/spark/profiler/DataAggregator.java b/spark-common/src/main/java/me/lucko/spark/profiler/DataAggregator.java index 1afa52c..1afa52c 100644 --- a/common/src/main/java/me/lucko/spark/profiler/DataAggregator.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/DataAggregator.java diff --git a/common/src/main/java/me/lucko/spark/profiler/Sampler.java b/spark-common/src/main/java/me/lucko/spark/profiler/Sampler.java index 3476f03..3476f03 100644 --- a/common/src/main/java/me/lucko/spark/profiler/Sampler.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/Sampler.java diff --git a/common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java b/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java index 7db0515..7db0515 100644 --- a/common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/SamplerBuilder.java diff --git a/common/src/main/java/me/lucko/spark/profiler/StackNode.java b/spark-common/src/main/java/me/lucko/spark/profiler/StackNode.java index 575400a..575400a 100644 --- a/common/src/main/java/me/lucko/spark/profiler/StackNode.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/StackNode.java diff --git a/common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java b/spark-common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java index d46a547..d46a547 100644 --- a/common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/StackTraceNode.java diff --git a/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java b/spark-common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java index 68d7dc9..68d7dc9 100644 --- a/common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/ThreadDumper.java diff --git a/common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java b/spark-common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java index 56a6cc4..56a6cc4 100644 --- a/common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/ThreadGrouper.java diff --git a/common/src/main/java/me/lucko/spark/profiler/TickCounter.java b/spark-common/src/main/java/me/lucko/spark/profiler/TickCounter.java index 53a9c27..53a9c27 100644 --- a/common/src/main/java/me/lucko/spark/profiler/TickCounter.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/TickCounter.java diff --git a/common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java b/spark-common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java index abca4b3..abca4b3 100644 --- a/common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java +++ b/spark-common/src/main/java/me/lucko/spark/profiler/TickedDataAggregator.java diff --git a/spark-sponge/build.gradle b/spark-sponge/build.gradle new file mode 100644 index 0000000..c2f0efc --- /dev/null +++ b/spark-sponge/build.gradle @@ -0,0 +1,14 @@ +plugins { + id 'ninja.miserable.blossom' version '1.0.1' +} + +dependencies { + compile project(':spark-common') + compileOnly 'org.spongepowered:spongeapi:8.0.0-SNAPSHOT' + annotationProcessor 'org.spongepowered:spongeapi:8.0.0-SNAPSHOT' +} + +blossom { + replaceTokenIn('src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java') + replaceToken '@version@', project.pluginVersion +}
\ No newline at end of file diff --git a/sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java index c6e1e18..845d2c1 100644 --- a/sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SparkSpongePlugin.java @@ -5,7 +5,6 @@ import com.google.inject.Inject; import me.lucko.spark.common.CommandHandler; import me.lucko.spark.profiler.ThreadDumper; import me.lucko.spark.profiler.TickCounter; -import me.lucko.spark.sponge.utils.PomData; import org.spongepowered.api.Game; import org.spongepowered.api.Sponge; @@ -36,8 +35,8 @@ import javax.annotation.Nullable; @Plugin( id = "spark", name = "spark", - version = "1.0.4", - description = PomData.DESCRIPTION, + version = "@version@", + description = "Spark is a CPU profiling plugin based on sk89q's WarmRoast profiler", authors = {"Luck", "sk89q"} ) public class SparkSpongePlugin implements CommandCallable { diff --git a/sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java index bda2a69..bda2a69 100644 --- a/sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeTickCounter.java diff --git a/spark-universal/build.gradle b/spark-universal/build.gradle new file mode 100644 index 0000000..d0583ac --- /dev/null +++ b/spark-universal/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' + } +} + +apply plugin: 'com.github.johnrengelman.shadow' + +dependencies { + compile project(':spark-common') + compile project(':spark-bukkit') + compile project(':spark-bungeecord') + compile project(':spark-sponge') +} + +shadowJar { + archiveName = 'spark.jar' + + relocate 'okio', 'me.lucko.spark.lib.okio' + relocate 'okhttp3', 'me.lucko.spark.lib.okhttp3' +} + +artifacts { + archives shadowJar + shadow shadowJar +}
\ No newline at end of file diff --git a/sponge/pom.xml b/sponge/pom.xml deleted file mode 100644 index d926108..0000000 --- a/sponge/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>spark-parent</artifactId> - <groupId>me.lucko</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>spark-sponge</artifactId> - <packaging>jar</packaging> - - <build> - <defaultGoal>clean package</defaultGoal> - <finalName>spark-sponge</finalName> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - </resource> - </resources> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>${compiler.version}</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>templating-maven-plugin</artifactId> - <version>1.0.0</version> - <executions> - <execution> - <id>filter-src</id> - <goals> - <goal>filter-sources</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <dependencies> - <!-- common --> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-common</artifactId> - <version>${project.version}</version> - <scope>provided</scope> - </dependency> - - <!-- Sponge --> - <dependency> - <groupId>org.spongepowered</groupId> - <artifactId>spongeapi</artifactId> - <version>8.0.0-SNAPSHOT</version> - <scope>provided</scope> - </dependency> - </dependencies> - - <repositories> - <repository> - <id>sponge-repo</id> - <url>https://repo.spongepowered.org/maven</url> - </repository> - </repositories> - -</project> diff --git a/sponge/src/main/java-templates/me/lucko/spark/sponge/utils/PomData.java b/sponge/src/main/java-templates/me/lucko/spark/sponge/utils/PomData.java deleted file mode 100644 index d81e8f5..0000000 --- a/sponge/src/main/java-templates/me/lucko/spark/sponge/utils/PomData.java +++ /dev/null @@ -1,8 +0,0 @@ -package me.lucko.spark.sponge.utils; - -public class PomData { - - public static final String DESCRIPTION = "${project.description}"; - public static final String VERSION = "${project.version}"; - -} diff --git a/universal/pom.xml b/universal/pom.xml deleted file mode 100644 index 507df7b..0000000 --- a/universal/pom.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns="http://maven.apache.org/POM/4.0.0" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <parent> - <artifactId>spark-parent</artifactId> - <groupId>me.lucko</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - - <artifactId>spark-universal</artifactId> - <packaging>jar</packaging> - - <build> - <defaultGoal>clean package</defaultGoal> - <finalName>spark</finalName> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>${shade.version}</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>shade</goal> - </goals> - <configuration> - <minimizeJar>false</minimizeJar> - <createDependencyReducedPom>false</createDependencyReducedPom> - <relocations> - <!-- shaded dependencies --> - <relocation> - <pattern>okio</pattern> - <shadedPattern>me.lucko.spark.lib.okio</shadedPattern> - </relocation> - <relocation> - <pattern>okhttp3</pattern> - <shadedPattern>me.lucko.spark.lib.okhttp3</shadedPattern> - </relocation> - </relocations> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>sign</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-gpg-plugin</artifactId> - <version>1.6</version> - <executions> - <execution> - <id>sign-artifacts</id> - <phase>verify</phase> - <goals> - <goal>sign</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - - <dependencies> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-common</artifactId> - <version>${project.version}</version> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-bukkit</artifactId> - <version>1.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-bungeecord</artifactId> - <version>1.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>me.lucko</groupId> - <artifactId>spark-sponge</artifactId> - <version>1.0-SNAPSHOT</version> - <scope>compile</scope> - </dependency> - </dependencies> - -</project> |