mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 08:39:27 +00:00
Treat each plugin as an individual source set
Adds separate build tasks for each plugin by auto-discovering plugin meta files in the build script. Each plugin will automatically have its main sources and tests compiled, and then it's output added to the game modules classpath. This enables support for incremental compilation of scripts, as well as unit testing using Gradle's test framework.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
name = "Banking"
|
||||
package = "org.apollo.game.plugin.banking"
|
||||
authors = [ "Major" ]
|
||||
|
||||
[config]
|
||||
srcDir = "src/"
|
||||
testDir = "test/"
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<plugin>
|
||||
<id>bank</id>
|
||||
<version>1</version>
|
||||
<name>Bank</name>
|
||||
<description>Opens the bank interface when players select 'use-quickly' on a bank booth.</description>
|
||||
<authors>
|
||||
<author>Major</author>
|
||||
</authors>
|
||||
<scripts>
|
||||
<script>bank.plugin.kts</script>
|
||||
</scripts>
|
||||
<dependencies />
|
||||
</plugin>
|
||||
@@ -0,0 +1,8 @@
|
||||
name = "spawning"
|
||||
package = "org.apollo.game.plugin.entity"
|
||||
authors = [ "Gary Tierney" ]
|
||||
dependencies = [ "entity_lookup" ]
|
||||
|
||||
[config]
|
||||
srcDir = "src/"
|
||||
testDir = "test/"
|
||||
@@ -0,0 +1,8 @@
|
||||
name = "lumbridge npc spawns"
|
||||
package = "org.apollo.game.plugin.locations"
|
||||
authors = [ "Gary Tierney" ]
|
||||
dependencies = [ "spawning" ]
|
||||
|
||||
[config]
|
||||
srcDir = "src/"
|
||||
testDir = "test/"
|
||||
@@ -0,0 +1,2 @@
|
||||
name = "entity lookup"
|
||||
package = "org.apollo.game.plugins.util"
|
||||
@@ -0,0 +1,14 @@
|
||||
import org.apollo.cache.def.ItemDefinition
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class LookupTests {
|
||||
@Test fun itemLookup() {
|
||||
val testItem = ItemDefinition(0)
|
||||
testItem.name = "sword"
|
||||
|
||||
ItemDefinition.init(arrayOf(testItem))
|
||||
|
||||
assertEquals(testItem, lookup_item("sword"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user