Fix plugin test running with new gradle modules

This commit is contained in:
Gary Tierney
2017-09-16 20:40:17 +01:00
parent 36282cf81e
commit edcb72b474
39 changed files with 97 additions and 129 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
apolloPlugin {
name = "Banking"
plugin {
name = "banking"
packageName = "org.apollo.game.plugin.banking"
authors = [
"Major",
-62
View File
@@ -1,17 +1,3 @@
import com.moandjiezana.toml.Toml
import java.nio.file.Paths
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'com.moandjiezana.toml', name: 'toml4j', version: '0.7.1'
}
}
subprojects {
if (it.buildFile.exists()) {
apply plugin: 'apollo-plugin'
@@ -24,51 +10,3 @@ subprojects {
}
}
}
task("convertPluginTomlToGradle") {
def pluginTree = fileTree(dir: "${project.rootDir}/game/src/plugins/")
def pluginDefinitions = pluginTree.matching {
include "**/*.toml"
}
pluginDefinitions.each { file ->
def meta = new Toml()
meta.read(file.absoluteFile)
def pluginFolder = Paths.get(file.parentFile.absolutePath)
def name = meta.getString("name", pluginFolder.getFileName().toString())
def normalizedName = name.replaceAll("[^a-zA-Z0-9_]", '_').toLowerCase()
def description = meta.getString("description", "")
def packageName = meta.getString("package", "org.apollo.game.plugin")
def authors = meta.getList("authors", new ArrayList())
def dependencies = meta.getList("dependencies", new ArrayList())
def buildFile = new File(pluginFolder.toFile(), 'build.gradle')
buildFile.withWriter('UTF-8') { writer ->
writer.write("apolloPlugin {\n")
writer.write(" name = \"$normalizedName\"\n")
if (packageName != "org.apollo.game.plugin") {
writer.write(" packageName = \"$packageName\"\n")
}
if (description.length() > 0) {
writer.write(" description = \"$description\"\n")
}
if (authors.size > 0) {
writer.write(" authors = [\n")
authors.each { writer.write(" \"$it\",\n") }
writer.write(" ]\n")
}
if (dependencies.size > 0) {
writer.write(" dependencies = [\n")
dependencies.each { writer.write(" \"$it\",\n") }
writer.write(" ]\n")
}
writer.write("}")
}
}
}
@@ -1,3 +1,3 @@
apolloPlugin {
name = "private-messaging"
plugin {
name = "private_messaging"
}
+2 -2
View File
@@ -1,5 +1,5 @@
apolloPlugin {
name = "Chat commands"
plugin {
name = "chat_commands"
packageName = "org.apollo.game.plugin.cmd"
authors = [
"Graham",
+1 -1
View File
@@ -1,4 +1,4 @@
apolloPlugin {
plugin {
name = "consumables"
packageName = "org.apollo.game.plugin.consumables"
authors = [
@@ -4,7 +4,6 @@ import org.apollo.game.message.impl.ItemOptionMessage
import org.apollo.game.model.entity.Skill
import org.apollo.game.plugin.testing.KotlinPluginTest
import org.apollo.game.plugin.testing.mockito.KotlinMockitoExtensions.matches
import org.assertj.core.api.Assertions.assertThat
import org.junit.Before
import org.junit.Test
import org.mockito.Mockito.never
+2 -2
View File
@@ -1,5 +1,5 @@
apolloPlugin {
name = "training-dummy"
plugin {
name = "training_dummy"
packageName = "org.apollo.game.plugin.entity"
authors = [
"Gary Tierney",
+2 -2
View File
@@ -1,5 +1,5 @@
apolloPlugin {
name = "emote-tab"
plugin {
name = "emote_tab"
packageName = "org.apollo.game.plugin.widget"
authors = [
"Gary Tierney",
+4 -4
View File
@@ -1,12 +1,12 @@
apolloPlugin {
plugin {
name = "following"
packageName = "org.apollo.game.plugin.entity"
authors = [
"Gary Tierney",
]
dependencies = [
"walkto",
"command_utilities",
"player_action",
"entity:walk-to",
"util:command",
"entity:player-action",
]
}
@@ -1,4 +1,4 @@
apolloPlugin {
plugin {
name = "player_action"
packageName = "org.apollo.game.plugin.entity"
authors = [
+2 -2
View File
@@ -1,10 +1,10 @@
apolloPlugin {
plugin {
name = "spawning"
packageName = "org.apollo.game.plugin.entity"
authors = [
"Gary Tierney",
]
dependencies = [
"entity_lookup",
"util:lookup",
]
}
+1 -1
View File
@@ -1,4 +1,4 @@
apolloPlugin {
plugin {
name = "walkto"
packageName = "org.apollo.plugin.entity.walkto"
authors = [
+3 -3
View File
@@ -1,10 +1,10 @@
apolloPlugin {
name = "al-kharid npc spawns"
plugin {
name = "al_kharid_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Jesse W",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
name = "al-kharid npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Jesse W" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
+3 -3
View File
@@ -1,10 +1,10 @@
apolloPlugin {
name = "edgeville npc spawns"
plugin {
name = "edgeville_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Jesse W",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
name = "edgeville npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Jesse W" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
+3 -3
View File
@@ -1,10 +1,10 @@
apolloPlugin {
name = "falador npc spawns"
plugin {
name = "falador_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Jesse W",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
name = "falador npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Jesse W" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
+3 -3
View File
@@ -1,10 +1,10 @@
apolloPlugin {
name = "lumbridge npc spawns"
plugin {
name = "lumbridge_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Gary Tierney",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
name = "lumbridge npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Gary Tierney" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
@@ -1,10 +1,10 @@
apolloPlugin {
name = "tutorial island npc spawns"
plugin {
name = "tutorial_island_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Jesse W",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
@@ -1,7 +1,7 @@
name = "tutorial island npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Jesse W" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
+3 -3
View File
@@ -1,10 +1,10 @@
apolloPlugin {
name = "varrock npc spawns"
plugin {
name = "varrock_npc_spawns"
packageName = "org.apollo.game.plugin.locations"
authors = [
"Jesse W",
]
dependencies = [
"spawning",
"entity:spawn",
]
}
+1 -1
View File
@@ -1,7 +1,7 @@
name = "varrock npc spawns"
package = "org.apollo.game.plugin.locations"
authors = [ "Jesse W" ]
dependencies = [ "spawning" ]
dependencies = [ "entity:spawn" ]
[config]
srcDir = "src/"
+1 -1
View File
@@ -1,3 +1,3 @@
apolloPlugin {
plugin {
name = "logout"
}
+1 -1
View File
@@ -1,3 +1,3 @@
apolloPlugin {
plugin {
name = "run"
}
+2 -2
View File
@@ -1,4 +1,4 @@
apolloPlugin {
name = "command utilities"
plugin {
name = "command_utilities"
packageName = "org.apollo.game.plugins.util"
}
+2 -2
View File
@@ -1,4 +1,4 @@
apolloPlugin {
name = "entity lookup"
plugin {
name = "entity_lookup"
packageName = "org.apollo.game.plugins.util"
}