diff --git a/build.gradle b/build.gradle index 4b6f056..fc15517 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,12 @@ spigot { sourceCompatibility = 1.8 targetCompatibility = 1.8 -compileJava.options.encoding = 'UTF-8' +compileJava { + options.encoding = 'UTF-8' + options.compilerArgs += ["-parameters"] + options.fork = true + options.forkOptions.executable = 'javac' +} archivesBaseName = project.property("pluginName") @@ -60,11 +65,13 @@ repositories { maven { url = 'https://oss.sonatype.org/content/repositories/central' } //Add your repositories here + maven { url = "https://repo.aikar.co/content/groups/aikar/" } } ext { //Define one of the supported mc versions mcVersion = project.property("mcVersion") + packageName = project.property("packageName") } dependencies { @@ -72,6 +79,7 @@ dependencies { compileOnly "org.spigotmc:spigot-api:${mcVersion}-R0.1-SNAPSHOT" //Add your dependencies here + compile "co.aikar:acf-bukkit:0.5.0-SNAPSHOT" //Test dependencies testCompile "org.mockito:mockito-core:3.+" @@ -85,6 +93,8 @@ test { shadowJar { classifier = '' + relocate 'co.aikar.commands', "${packageName}.acf" + relocate 'co.aikar.locales', "${packageName}.locales" } processResources { @@ -103,9 +113,7 @@ task copyPluginYaml(type: Copy, dependsOn: spigotPluginYaml) { into(sourceSets.main.resources.srcDirs[0]) } -tasks.test.dependsOn(copyPluginYaml) - -task deploy(type: Copy, dependsOn: ['cleanPlugin', 'copyPluginYaml', 'jar']) { +task deploy(type: Copy, dependsOn: ['cleanPlugin', 'jar']) { group 'deploy' description 'Exports you plugin to the plugin directory in your test server' diff --git a/gradle.properties b/gradle.properties index 8f68801..21c888f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,5 +3,6 @@ author = Silthus group = com.silthus apiVersion = 1.15 mcVersion = 1.15.2 +packageName = com.silthus.template pluginFolder = \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml deleted file mode 100644 index f913538..0000000 --- a/src/main/resources/plugin.yml +++ /dev/null @@ -1,6 +0,0 @@ -main: com.silthus.template.TemplatePlugin -name: SpigotTemplate -version: '1.0' -authors: [Silthus] -api-version: '1.15' -load: STARTUP diff --git a/src/test/java/com/silthus/template/TemplatePluginTests.java b/src/test/java/com/silthus/template/TemplatePluginTests.java index 3000b46..60af35b 100644 --- a/src/test/java/com/silthus/template/TemplatePluginTests.java +++ b/src/test/java/com/silthus/template/TemplatePluginTests.java @@ -9,6 +9,8 @@ import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; +import java.io.File; + @RunWith(MockitoJUnitRunner.class) public class TemplatePluginTests { @@ -19,7 +21,7 @@ public class TemplatePluginTests { public void setUp() { server = MockBukkit.mock(); - plugin = MockBukkit.load(TemplatePlugin.class); + plugin = MockBukkit.loadWith(TemplatePlugin.class, new File("build/tmp/spigotPluginYaml/plugin.yml")); }