367 lines
		
	
	
	
		
			14 KiB
			
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			367 lines
		
	
	
	
		
			14 KiB
			
		
	
	
	
		
			Diff
		
	
	
	
	
	
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 | 
						|
From: Kyle Wood <kyle@denwav.dev>
 | 
						|
Date: Thu, 10 Dec 2020 20:50:33 -0800
 | 
						|
Subject: [PATCH] Convert project to Gradle
 | 
						|
 | 
						|
The pom.xml file is deleted in this patch so the patch will fail to
 | 
						|
apply if there are changes made to it from upstream - thus notifying us
 | 
						|
that changes were made.
 | 
						|
 | 
						|
diff --git a/.gitignore b/.gitignore
 | 
						|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
 | 
						|
--- a/.gitignore
 | 
						|
+++ b/.gitignore
 | 
						|
@@ -0,0 +0,0 @@
 | 
						|
+.gradle/
 | 
						|
+
 | 
						|
 # Eclipse stuff
 | 
						|
 /.classpath
 | 
						|
 /.project
 | 
						|
@@ -0,0 +0,0 @@
 | 
						|
 *.ipr
 | 
						|
 *.iws
 | 
						|
 .idea/
 | 
						|
+
 | 
						|
+# vs code
 | 
						|
+/.vscode
 | 
						|
+/.factorypath
 | 
						|
diff --git a/build.gradle.kts b/build.gradle.kts
 | 
						|
new file mode 100644
 | 
						|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
 | 
						|
--- /dev/null
 | 
						|
+++ b/build.gradle.kts
 | 
						|
@@ -0,0 +0,0 @@
 | 
						|
+plugins {
 | 
						|
+    `java-library`
 | 
						|
+    `maven-publish`
 | 
						|
+}
 | 
						|
+
 | 
						|
+java {
 | 
						|
+    withSourcesJar()
 | 
						|
+    withJavadocJar()
 | 
						|
+}
 | 
						|
+
 | 
						|
+dependencies {
 | 
						|
+    // api dependencies are listed transitively to API consumers
 | 
						|
+    api("commons-lang:commons-lang:2.6")
 | 
						|
+    api("com.google.guava:guava:31.0.1-jre")
 | 
						|
+    api("com.google.code.gson:gson:2.8.8")
 | 
						|
+    api("net.md-5:bungeecord-chat:1.16-R0.4")
 | 
						|
+    api("org.yaml:snakeyaml:1.30")
 | 
						|
+
 | 
						|
+    compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
 | 
						|
+    compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.2")
 | 
						|
+    compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.2")
 | 
						|
+
 | 
						|
+    val annotations = "org.jetbrains:annotations-java5:23.0.0"
 | 
						|
+    compileOnly(annotations)
 | 
						|
+    testCompileOnly(annotations)
 | 
						|
+
 | 
						|
+    testImplementation("junit:junit:4.13.2")
 | 
						|
+    testImplementation("org.hamcrest:hamcrest-library:1.3")
 | 
						|
+    testImplementation("org.ow2.asm:asm-tree:9.2")
 | 
						|
+}
 | 
						|
+
 | 
						|
+configure<PublishingExtension> {
 | 
						|
+    publications.create<MavenPublication>("maven") {
 | 
						|
+        from(components["java"])
 | 
						|
+    }
 | 
						|
+}
 | 
						|
+
 | 
						|
+val generateApiVersioningFile by tasks.registering {
 | 
						|
+    inputs.property("version", project.version)
 | 
						|
+    val pomProps = layout.buildDirectory.file("pom.properties")
 | 
						|
+    outputs.file(pomProps)
 | 
						|
+    val projectVersion = project.version
 | 
						|
+    doLast {
 | 
						|
+        pomProps.get().asFile.writeText("version=$projectVersion")
 | 
						|
+    }
 | 
						|
+}
 | 
						|
+
 | 
						|
+tasks.jar {
 | 
						|
+    from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
 | 
						|
+        into("META-INF/maven/${project.group}/${project.name}")
 | 
						|
+    }
 | 
						|
+    manifest {
 | 
						|
+        attributes(
 | 
						|
+            "Automatic-Module-Name" to "org.bukkit"
 | 
						|
+        )
 | 
						|
+    }
 | 
						|
+}
 | 
						|
+
 | 
						|
+tasks.withType<Javadoc> {
 | 
						|
+    (options as StandardJavadocDocletOptions).links(
 | 
						|
+        "https://guava.dev/releases/31.0.1-jre/api/docs/",
 | 
						|
+        "https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
 | 
						|
+        "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
 | 
						|
+        "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
 | 
						|
+    )
 | 
						|
+}
 | 
						|
diff --git a/pom.xml b/pom.xml
 | 
						|
deleted file mode 100644
 | 
						|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
 | 
						|
--- a/pom.xml
 | 
						|
+++ /dev/null
 | 
						|
@@ -0,0 +0,0 @@
 | 
						|
-
 | 
						|
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
						|
-         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>org.spigotmc</groupId>
 | 
						|
-    <artifactId>spigot-api</artifactId>
 | 
						|
-    <version>1.18.1-R0.1-SNAPSHOT</version>
 | 
						|
-    <packaging>jar</packaging>
 | 
						|
-
 | 
						|
-    <name>Spigot-API</name>
 | 
						|
-    <url>https://www.spigotmc.org/</url>
 | 
						|
-    <description>An enhanced plugin API for Minecraft servers.</description>
 | 
						|
-
 | 
						|
-    <properties>
 | 
						|
-        <skipTests>true</skipTests>
 | 
						|
-        <maven.compiler.source>1.8</maven.compiler.source>
 | 
						|
-        <maven.compiler.target>1.8</maven.compiler.target>
 | 
						|
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
						|
-    </properties>
 | 
						|
-
 | 
						|
-    <distributionManagement>
 | 
						|
-        <repository>
 | 
						|
-            <id>spigotmc-releases</id>
 | 
						|
-            <url>https://hub.spigotmc.org/nexus/content/repositories/releases/</url>
 | 
						|
-        </repository>
 | 
						|
-        <snapshotRepository>
 | 
						|
-            <id>spigotmc-snapshots</id>
 | 
						|
-            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
 | 
						|
-        </snapshotRepository>
 | 
						|
-    </distributionManagement>
 | 
						|
-
 | 
						|
-    <dependencies>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>commons-lang</groupId>
 | 
						|
-            <artifactId>commons-lang</artifactId>
 | 
						|
-            <version>2.6</version>
 | 
						|
-            <scope>compile</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <!-- bundled with Minecraft, should be kept in sync -->
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>com.google.guava</groupId>
 | 
						|
-            <artifactId>guava</artifactId>
 | 
						|
-            <version>31.0.1-jre</version>
 | 
						|
-            <scope>compile</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <!-- bundled with Minecraft, should be kept in sync -->
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>com.google.code.gson</groupId>
 | 
						|
-            <artifactId>gson</artifactId>
 | 
						|
-            <version>2.8.8</version>
 | 
						|
-            <scope>compile</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>net.md-5</groupId>
 | 
						|
-            <artifactId>bungeecord-chat</artifactId>
 | 
						|
-            <version>1.16-R0.4</version>
 | 
						|
-            <type>jar</type>
 | 
						|
-            <scope>compile</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.yaml</groupId>
 | 
						|
-            <artifactId>snakeyaml</artifactId>
 | 
						|
-            <version>1.30</version>
 | 
						|
-            <scope>compile</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <!-- not part of the API proper -->
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.apache.maven</groupId>
 | 
						|
-            <artifactId>maven-resolver-provider</artifactId>
 | 
						|
-            <version>3.8.4</version>
 | 
						|
-            <scope>provided</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.apache.maven.resolver</groupId>
 | 
						|
-            <artifactId>maven-resolver-connector-basic</artifactId>
 | 
						|
-            <version>1.7.2</version>
 | 
						|
-            <scope>provided</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.apache.maven.resolver</groupId>
 | 
						|
-            <artifactId>maven-resolver-transport-http</artifactId>
 | 
						|
-            <version>1.7.2</version>
 | 
						|
-            <scope>provided</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <!-- annotations -->
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.jetbrains</groupId>
 | 
						|
-            <artifactId>annotations-java5</artifactId>
 | 
						|
-            <version>23.0.0</version>
 | 
						|
-            <scope>provided</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <!-- testing -->
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>junit</groupId>
 | 
						|
-            <artifactId>junit</artifactId>
 | 
						|
-            <version>4.13.2</version>
 | 
						|
-            <scope>test</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.hamcrest</groupId>
 | 
						|
-            <artifactId>hamcrest-library</artifactId>
 | 
						|
-            <version>1.3</version>
 | 
						|
-            <scope>test</scope>
 | 
						|
-        </dependency>
 | 
						|
-        <dependency>
 | 
						|
-            <groupId>org.ow2.asm</groupId>
 | 
						|
-            <artifactId>asm-tree</artifactId>
 | 
						|
-            <version>9.2</version>
 | 
						|
-            <scope>test</scope>
 | 
						|
-        </dependency>
 | 
						|
-    </dependencies>
 | 
						|
-
 | 
						|
-    <build>
 | 
						|
-        <plugins>
 | 
						|
-            <plugin>
 | 
						|
-                <groupId>net.md-5</groupId>
 | 
						|
-                <artifactId>scriptus</artifactId>
 | 
						|
-                <version>0.4.1</version>
 | 
						|
-                <executions>
 | 
						|
-                    <execution>
 | 
						|
-                        <phase>initialize</phase>
 | 
						|
-                        <goals>
 | 
						|
-                            <goal>describe</goal>
 | 
						|
-                        </goals>
 | 
						|
-                    </execution>
 | 
						|
-                </executions>
 | 
						|
-            </plugin>
 | 
						|
-            <plugin>
 | 
						|
-                <groupId>org.apache.maven.plugins</groupId>
 | 
						|
-                <artifactId>maven-compiler-plugin</artifactId>
 | 
						|
-                <version>3.8.1</version>
 | 
						|
-                <configuration>
 | 
						|
-                    <!-- we use the Eclipse compiler as it doesn't need a JDK -->
 | 
						|
-                    <compilerId>eclipse</compilerId>
 | 
						|
-                </configuration>
 | 
						|
-                <dependencies>
 | 
						|
-                    <dependency>
 | 
						|
-                        <groupId>org.codehaus.plexus</groupId>
 | 
						|
-                        <artifactId>plexus-compiler-eclipse</artifactId>
 | 
						|
-                        <version>2.8.8</version>
 | 
						|
-                    </dependency>
 | 
						|
-                    <dependency>
 | 
						|
-                        <groupId>org.eclipse.jdt</groupId>
 | 
						|
-                        <artifactId>ecj</artifactId>
 | 
						|
-                        <version>3.28.0</version>
 | 
						|
-                    </dependency>
 | 
						|
-                </dependencies>
 | 
						|
-            </plugin>
 | 
						|
-            <plugin>
 | 
						|
-                <groupId>org.apache.maven.plugins</groupId>
 | 
						|
-                <artifactId>maven-jar-plugin</artifactId>
 | 
						|
-                <version>3.2.0</version>
 | 
						|
-                <configuration>
 | 
						|
-                    <archive>
 | 
						|
-                        <manifest>
 | 
						|
-                            <addDefaultEntries>false</addDefaultEntries>
 | 
						|
-                        </manifest>
 | 
						|
-                        <manifestEntries>
 | 
						|
-                            <Automatic-Module-Name>org.bukkit</Automatic-Module-Name>
 | 
						|
-                        </manifestEntries>
 | 
						|
-                    </archive>
 | 
						|
-                </configuration>
 | 
						|
-            </plugin>
 | 
						|
-            <plugin>
 | 
						|
-                <groupId>org.apache.maven.plugins</groupId>
 | 
						|
-                <artifactId>maven-shade-plugin</artifactId>
 | 
						|
-                <version>3.2.4</version>
 | 
						|
-                <executions>
 | 
						|
-                    <execution>
 | 
						|
-                        <phase>package</phase>
 | 
						|
-                        <goals>
 | 
						|
-                            <goal>shade</goal>
 | 
						|
-                        </goals>
 | 
						|
-                    </execution>
 | 
						|
-                </executions>
 | 
						|
-                <configuration>
 | 
						|
-                    <filters>
 | 
						|
-                        <filter>
 | 
						|
-                            <artifact>*:*</artifact>
 | 
						|
-                            <excludes>
 | 
						|
-                                <exclude>META-INF/MANIFEST.MF</exclude>
 | 
						|
-                            </excludes>
 | 
						|
-                        </filter>
 | 
						|
-                    </filters>
 | 
						|
-                    <!-- when downloading via Maven we can pull depends individually -->
 | 
						|
-                    <shadedArtifactAttached>true</shadedArtifactAttached>
 | 
						|
-                </configuration>
 | 
						|
-            </plugin>
 | 
						|
-            <plugin>
 | 
						|
-                <groupId>org.apache.maven.plugins</groupId>
 | 
						|
-                <artifactId>maven-javadoc-plugin</artifactId>
 | 
						|
-                <version>3.3.1</version>
 | 
						|
-                <configuration>
 | 
						|
-                    <links>
 | 
						|
-                        <link>https://guava.dev/releases/31.0.1-jre/api/docs/</link>
 | 
						|
-                        <link>https://javadoc.io/doc/org.yaml/snakeyaml/1.30/</link>
 | 
						|
-                        <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/</link>
 | 
						|
-                        <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link>
 | 
						|
-                    </links>
 | 
						|
-                </configuration>
 | 
						|
-            </plugin>
 | 
						|
-        </plugins>
 | 
						|
-    </build>
 | 
						|
-
 | 
						|
-    <profiles>
 | 
						|
-        <profile>
 | 
						|
-            <id>development</id>
 | 
						|
-            <properties>
 | 
						|
-                <skipTests>false</skipTests>
 | 
						|
-            </properties>
 | 
						|
-            <build>
 | 
						|
-                <plugins>
 | 
						|
-                    <plugin>
 | 
						|
-                        <groupId>org.apache.maven.plugins</groupId>
 | 
						|
-                        <artifactId>maven-checkstyle-plugin</artifactId>
 | 
						|
-                        <version>3.1.2</version>
 | 
						|
-                        <executions>
 | 
						|
-                            <execution>
 | 
						|
-                                <phase>process-classes</phase>
 | 
						|
-                                <goals>
 | 
						|
-                                    <goal>check</goal>
 | 
						|
-                                </goals>
 | 
						|
-                            </execution>
 | 
						|
-                        </executions>
 | 
						|
-                        <configuration>
 | 
						|
-                            <configLocation>checkstyle.xml</configLocation>
 | 
						|
-                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
 | 
						|
-                        </configuration>
 | 
						|
-                        <dependencies>
 | 
						|
-                            <dependency>
 | 
						|
-                                <groupId>com.puppycrawl.tools</groupId>
 | 
						|
-                                <artifactId>checkstyle</artifactId>
 | 
						|
-                                <version>8.45.1</version>
 | 
						|
-                            </dependency>
 | 
						|
-                        </dependencies>
 | 
						|
-                    </plugin>
 | 
						|
-                    <plugin>
 | 
						|
-                        <groupId>org.codehaus.mojo</groupId>
 | 
						|
-                        <artifactId>animal-sniffer-maven-plugin</artifactId>
 | 
						|
-                        <version>1.20</version>
 | 
						|
-                        <executions>
 | 
						|
-                            <execution>
 | 
						|
-                                <phase>process-classes</phase>
 | 
						|
-                                <goals>
 | 
						|
-                                    <goal>check</goal>
 | 
						|
-                                </goals>
 | 
						|
-                            </execution>
 | 
						|
-                        </executions>
 | 
						|
-                        <configuration>
 | 
						|
-                            <signature>
 | 
						|
-                                <groupId>org.codehaus.mojo.signature</groupId>
 | 
						|
-                                <artifactId>java18</artifactId>
 | 
						|
-                                <version>1.0</version>
 | 
						|
-                            </signature>
 | 
						|
-                        </configuration>
 | 
						|
-                    </plugin>
 | 
						|
-                </plugins>
 | 
						|
-            </build>
 | 
						|
-        </profile>
 | 
						|
-    </profiles>
 | 
						|
-</project>
 |