Commit Graph

29 Commits

Author SHA1 Message Date
Gary Tierney 57fc49a42b Update test deps for Java 11
Prevent bytecode generation related test failures in tests that rely on
PowerMock by updating to PowerMock 2.
2019-07-16 16:35:34 +01:00
Major 8753bedf7e Update kotlin and coroutines dependencies 2019-07-13 15:14:35 +01:00
KeepBotting 739c331860 Housekeeping 2019-03-26 14:05:40 -04:00
Gary Tierney ba5ff2b765 Fix inclusion of ktlint for check tasks 2018-08-22 23:16:53 +01:00
Gary Tierney d97b6274c6 Include default configuratio in app distribution 2018-08-22 22:13:16 +01:00
Gary Tierney 5d84cdf40f Fix recording of code coverage 2018-08-20 01:29:52 +01:00
Gary Tierney e255bd195e Replace fast-classpath-scanner with classgraph 2018-08-19 20:32:42 +01:00
Gary Tierney 82b79ba60c Remove Kotlin scripting Gradle plugin 2018-08-19 19:59:05 +01:00
Gary Tierney 09346134fa Make buildscripts backwards compatible with Gradle 4.0 2018-08-19 19:50:27 +01:00
Gary Tierney c687f549da Add core plugins to the servers runtime classpath 2018-08-19 19:37:36 +01:00
Gary Tierney 0651d535fa Update to Kotlin 1.60 and Gradle 4.9
Removes the dependency on legacy script compilation and now relies on script
discovery.  In addition, the Gradle build scripts were refactored and updated
to be compatible with Gradle 5.0 and make use of the new java-library
configurations.
2018-08-19 19:26:51 +01:00
Gary Tierney 5d77ed5e4b Remove plugin script stub 2018-03-27 22:35:12 +01:00
Gary Tierney d8116478d4 Remove dependency on embedded kotlin compiler
This is a large change that significantly simplifies the plugin build system by
having the kotlinc handle everything related to script compilation.  Since we
no longer use package name rewriting, the "packageName" option has been dropped
from the gradle script API and has been removed from existing plugins.

In addition to simplifying the build system, it should also significantly speed
up build times.  Previously we ran 2 build processes for every plugin and
didn't have fully working incremental compilation for scripts compared to 1
build process with built-in incremental compilation.

There were also some random pieces of code that referenced kotlinc directly, so
those have either been removed or refactored out.
2018-03-27 22:35:05 +01:00
Gary Tierney 8a3decfc54 Enable experimental coroutines for all kotlin projects 2017-09-17 19:37:14 +01:00
Gary Tierney edcb72b474 Fix plugin test running with new gradle modules 2017-09-16 20:40:17 +01:00
Gary Tierney 36282cf81e Remove plugins.gradle and factor into common extension 2017-09-16 18:49:06 +01:00
Gary Tierney 97e85868ff Add support for asynchronous Mob actions
Adds asynchronous implementations of the Action and DistancedAction
classes, allowing plugins to make use of suspendable functions in Kotlin
instead of creating mini state machines to keep track of state.

The asynchronicity works by creating coroutine backed Channels for each
asynchronous action and having them listen on "pulse" events from the
action scheduler.  The action can then suspend execution until a pulse is
received or until some expensive operation has completed (i.e.,
pathfinding).

If an asynchronous action is still busy when a pulse arrives then the
number of missed pulses will be accumulated and sent to the action at
the next possible time.

The training dummy plugin has been updated to use asycnrhonous actions
as an example.
2017-06-20 07:31:07 +01:00
Gary Tierney 182de0330f Allow multiple players per test
Refactors the test helpers to use receiver functions so multiple players
can exist in the world per test case.  The AddFriendsTest is an example
of where this is needed.

Additionally, Hamcrest has been replaced with AssertJ for fluent
assertions.
2017-06-20 02:33:27 +01:00
Gary Tierney b532168551 Remove test context from plugin testing framework 2017-06-19 17:14:24 +01:00
Gary Tierney ce3150082d Fix builds on other platforms (non-Unix) 2017-06-02 22:30:39 +01:00
Gary Tierney 7ecc2e3158 Clean up plugin script compilation 2017-06-01 23:09:24 +01:00
Gary Tierney 42fdaee8b8 Make run task depend on plugin scripts 2017-06-01 22:47:50 +01:00
Gary Tierney eed32efcf9 Move stub.kt to main game module 2017-05-31 21:05:35 +01:00
Gary Tierney 3fb6d3f792 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.
2017-05-30 21:06:37 +01:00
Gary Tierney 05e20d9d51 Reorganize project sources from src/main to src/main/java 2017-05-28 22:04:34 +01:00
Gary Tierney 7ffef28117 Compile plugins at build-time instead of runtime
Adds gradle tasks to build all plugin scripts under data/plugins with
the KotlinPluginCompiler implementation previously used for runtime code
generation.  In addition to .plugin.kts files, scripts can also declare
API code in .kt files which will also be included on the classpath and
made available to other plugins.
2017-05-28 01:43:35 +01:00
Gary Tierney 79f79cd15c Add a 'plugins' source set to the game module
Creates a new sourceset for server plugins to support IDE integration
with plugin code.  Additionally moves plugins to game/data/plugins and
contains some gradle related fixes (remove java plugin from root project
and fix exec task dependency).
2017-05-27 18:58:05 +01:00
Gary Tierney 3403c0a2d1 First draft of KotlinPluginEnvironment 2017-05-27 18:57:39 +01:00
Gary Tierney 4d79052199 Convert to the gradle build system
Ports the Maven build POMs to Gradle build scripts, which are a bit
friendlier to use.  Instead of using the exec:java Maven goal to run the
server now, the gradle run task should be used.
2017-01-02 04:44:04 +00:00