Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Ruby with Kotlin #338

Open
wants to merge 230 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
3403c0a
First draft of KotlinPluginEnvironment
garyttierney May 25, 2017
79f79cd
Add a 'plugins' source set to the game module
garyttierney May 27, 2017
7ffef28
Compile plugins at build-time instead of runtime
garyttierney May 28, 2017
05e20d9
Reorganize project sources from src/main to src/main/java
garyttierney May 28, 2017
48e1726
Remove 'world' object from global script scope
garyttierney May 28, 2017
ad72036
Add port of the 'dummys' plugin from Ruby
garyttierney May 28, 2017
4ee123a
Add private messaging plugin
garyttierney May 28, 2017
3fb6d3f
Treat each plugin as an individual source set
garyttierney May 30, 2017
9353daa
Add plugin tests to the game build
garyttierney May 30, 2017
258fc6c
Add stub to plugin compile-time classpath
garyttierney May 31, 2017
eed32ef
Move stub.kt to main game module
garyttierney May 31, 2017
42fdaee
Make run task depend on plugin scripts
garyttierney Jun 1, 2017
7ecc2e3
Clean up plugin script compilation
garyttierney Jun 1, 2017
8d00dcc
Add height and direction params to npc_spawn
WizardJesse1 Jun 1, 2017
35ab034
Port location NPC spawns from Ruby to Kotlin
WizardJesse1 Jun 1, 2017
ce31500
Fix builds on other platforms (non-Unix)
garyttierney Jun 2, 2017
30fc810
Add base for Kotlin commands
cubeee Jun 2, 2017
8e8e2d0
Simplify on_command arguments
cubeee Jun 3, 2017
b99ee9b
Convert ::animate command to Kotlin
cubeee Jun 3, 2017
7df948e
Convert ::item command to Kotlin
cubeee Jun 3, 2017
5ea52e0
Convert messaging commands to Kotlin
cubeee Jun 3, 2017
6db9840
Overload valid_arg_length
cubeee Jun 4, 2017
72c0be8
Convert punishment commands to Kotlin
cubeee Jun 4, 2017
9f67c30
Convert teleport commands to Kotlin
cubeee Jun 4, 2017
4f45f5f
Convert experience commands to Kotlin
cubeee Jun 4, 2017
3616753
Convert npc spawn commands to Kotlin
cubeee Jun 4, 2017
4ca8978
Convert lookup commands to Kotlin
cubeee Jun 15, 2017
c082f40
Add input type checking to commands
cubeee Jun 15, 2017
df305bd
Merge pull request #340 from cubeee/kotlin-port/commands
garyttierney Jun 18, 2017
adaaae2
Refactor the plugin compile task for performance
garyttierney Jun 18, 2017
3f71483
Make plugin classes dependant on scripts
garyttierney Jun 18, 2017
1019cc8
Check for conflicting plugin names at build-time
garyttierney Jun 18, 2017
f40a3a3
Update travis-ci configuration to cache build deps
garyttierney Jun 18, 2017
d0fec15
Add missing name normalization to lookup plugin
garyttierney Jun 18, 2017
b536b2e
Add start of test framework for plugins
garyttierney Jun 19, 2017
b532168
Remove test context from plugin testing framework
garyttierney Jun 19, 2017
182de03
Allow multiple players per test
garyttierney Jun 20, 2017
97e8586
Add support for asynchronous Mob actions
garyttierney Jun 20, 2017
b17ad48
Add Jenkinsfile
garyttierney Jun 20, 2017
c15f18c
Add plugin for consumable food/drink
garyttierney Jun 22, 2017
9a8ed0d
Port the walkto and following plugins to Kotlin
garyttierney Jun 24, 2017
e605241
Add on_button method to plugin scripts
garyttierney Jun 25, 2017
b2f0c7e
Add Kotlin port of the logout plugin
garyttierney Jun 25, 2017
8dc10e8
Add kotlin port of the emote-tab plugin
garyttierney Jun 25, 2017
cb14c32
Add kotlin port of the walk/run toggle plugin
garyttierney Jun 25, 2017
b32b98e
Share kotlin version config between buildSrc and project (#353)
garyttierney Sep 16, 2017
d323bcd
Fix plugin test runner
garyttierney Sep 16, 2017
36282cf
Remove plugins.gradle and factor into common extension
garyttierney Sep 16, 2017
edcb72b
Fix plugin test running with new gradle modules
garyttierney Sep 16, 2017
b4d951c
Fix incremental script compilation
garyttierney Sep 16, 2017
a60cc82
Use main sourcset output dir for scripts
garyttierney Sep 16, 2017
68710ca
Use File.separator in settings.gradle
garyttierney Sep 16, 2017
f23114d
Fix plugin processing on windows
Major- Sep 16, 2017
445c471
Add kotlin to .editorconfig
Major- Sep 17, 2017
3a9e435
Add an await function to the AsyncActionRunner trait
garyttierney Sep 16, 2017
cf0e333
Add API plugin with common functionality
garyttierney Sep 17, 2017
e61f4ef
Adding support for mining skill
tlf30 Aug 18, 2017
a54485e
Finish up porting mining plugin to Kotlin
tlf30 Aug 18, 2017
0dc6879
Refactor mining to use async actions
garyttierney Sep 17, 2017
40095d6
Add explicit stop() to async actions
garyttierney Sep 17, 2017
a6ab74d
Merge pull request #354 from apollo-rsps/editorconfig
garyttierney Sep 17, 2017
112b8aa
Add basic detekt configuration
garyttierney Sep 17, 2017
89516da
Rewrite package names in compiled script files
garyttierney Sep 17, 2017
1f33619
Add source information to remapped scripts
garyttierney Sep 17, 2017
8a3decf
Enable experimental coroutines for all kotlin projects
garyttierney Sep 17, 2017
169d89f
Clear static object REMOVE messages when re-adding
garyttierney Sep 17, 2017
76dd8ba
Refactor asynchronous actions to avoid thread usage
garyttierney Sep 19, 2017
3e6415f
Initial commit on new woodcutting branch
tlf30 Sep 17, 2017
da7c7e1
Woodcutting now uses Async Action
tlf30 Sep 17, 2017
75a9b82
Fix all issues. Wood cutting now works.
tlf30 Sep 17, 2017
2cd160f
Refactor woodcutting to use coroutines
garyttierney Sep 19, 2017
100cfa9
Merge pull request #355 from tlf30/kotlin-experiments-woodcutting
garyttierney Sep 19, 2017
1c8bc3a
Add door support in Kotlin (#356)
arinhouck Sep 20, 2017
6d202ab
Support lookup_x inputs with the id at the end
Major- Sep 23, 2017
52c2594
Add shops plugin
Major- Sep 23, 2017
22df595
Add varrock shops
tlf30 Sep 23, 2017
53521e7
Update varrock plugin package name
garyttierney Sep 23, 2017
1796323
Merge pull request #360 from apollo-rsps/kotlin-shops
garyttierney Sep 23, 2017
64ee653
Rename dls.kt to dsl.kt
Major- Sep 23, 2017
01f2bdd
Port Fishing plugin to kotlin (#347)
tlf30 Sep 24, 2017
8c2f086
Remove meta.toml files
Major- Sep 24, 2017
ae3d3c7
Add destructuring operators for Position
Major- Sep 24, 2017
cb9e6f3
Let plugins intercept Events
Major- Sep 24, 2017
ce1bcba
Port Area plugin to Kotlin
Major- Sep 24, 2017
b4e8a71
Add skill extension properties
Major- Sep 24, 2017
046f373
Add packages to plugins
Major- Sep 24, 2017
6e3ddff
Correctly import api.Definitions
Major- Sep 24, 2017
397d9b2
Merge pull request #366 from apollo-rsps/kotlin-experiments-areas
Major- Sep 26, 2017
97896a3
Add implementation of runecrafting skill
tlf30 Dec 29, 2017
d811647
Remove dependency on embedded kotlin compiler
garyttierney Mar 27, 2018
179c35f
Add IntelliJ kotlinc configuration
garyttierney Mar 27, 2018
5d77ed5
Remove plugin script stub
garyttierney Mar 27, 2018
b2f4881
Fix nitpicks in Fishing plugin
Major- Mar 27, 2018
45a0b43
Remove incorrect Gunnarsgrunn fishing spots
Major- Mar 27, 2018
173623b
Fix nitpicks in Woodcutting plugin
Major- Mar 28, 2018
6941fc9
Fix nitpicks in Mining plugin
Major- Mar 28, 2018
0d7b2ea
Add prospecting on expired rocks
Major- Mar 28, 2018
4b68b8e
Separate prospecting actions
Major- Mar 28, 2018
0316753
Improve ::position command message
Major- Mar 28, 2018
284cad3
Merge pull request #386 from Major-/kotlin-experiments
Major- Mar 28, 2018
3c26d0a
Merge pull request #387 from Major-/kotlin-experiments-pos
Major- Mar 28, 2018
9c4eff7
Move Position destructuring functions to their own object
Major- Mar 28, 2018
94783da
Ported prayer plugin to kotlin
tlf30 Dec 30, 2017
1c0b1d8
Fix to allow multiple prayers.
tlf30 Mar 31, 2018
28c85d1
Remove now invalid packageName from prayer plugin
garyttierney Mar 31, 2018
59a651a
Fix code-style in prayer plugin
garyttierney Mar 31, 2018
7c59c2c
Clean up remaining issues on prayer plugin
garyttierney Mar 31, 2018
2b7a62d
Use a map for bone and prayer lookups
garyttierney Mar 31, 2018
7ca09f4
Rename npc spawning scripts
Major- Apr 1, 2018
8394a03
Optimise Mob.walkTo for paths that require no verification
Major- Apr 1, 2018
81e019c
Fix nitpicks in emote plugin
Major- Apr 1, 2018
78520fe
Fix scriptTemplatesClasspath for most users
Major- Apr 2, 2018
34f06b2
Add teleportation to places using ::tele [name]
cfoust Apr 2, 2018
3c6d251
Merge pull request #391 from cfoust/feat/teleport-shortcuts
Major- Apr 4, 2018
a528379
Port Herblore plugin to Kotlin
Chivvon Apr 6, 2018
68b7891
Merge pull request #396 from chivvon/herblore
Major- Apr 8, 2018
f7bf5fd
Fix nitpicks in prayer plugin
Major- Apr 8, 2018
6e94f4c
Add kotlin continuation indent to editorconfig
Major- Apr 8, 2018
275da13
Remove command utilities plugin
Major- Apr 8, 2018
d2a197f
Fix typo in shops dsl
Major- Apr 8, 2018
fdabea8
Add gradle to .editorconfig
Major- Apr 8, 2018
8fe0988
Remove util:lookup plugin
Major- Apr 8, 2018
9065929
Add Slack invite link to the README
garyttierney Sep 28, 2017
b74be81
Fix numerical attribute encoding
stevesoltys Jul 14, 2018
c44a942
Optimize collision matrix building
stevesoltys Jul 18, 2018
84f05ef
Add support for checking the bounds of entities
stevesoltys Jul 22, 2018
7fee827
Fix A* pathfinding when height is greater than zero
stevesoltys Jul 31, 2018
0651d53
Update to Kotlin 1.60 and Gradle 4.9
garyttierney Aug 19, 2018
c687f54
Add core plugins to the servers runtime classpath
garyttierney Aug 19, 2018
0934613
Make buildscripts backwards compatible with Gradle 4.0
garyttierney Aug 19, 2018
bd6db24
Remove Detekt configuration
garyttierney Aug 19, 2018
82b79ba
Remove Kotlin scripting Gradle plugin
garyttierney Aug 19, 2018
e255bd1
Replace fast-classpath-scanner with classgraph
garyttierney Aug 19, 2018
248a7d9
Update plugin test framework to junit5
garyttierney Aug 19, 2018
ebeaa7c
Use Gradles built-in JUnit 5 support
garyttierney Aug 19, 2018
88b0305
Update test runner and coverage for CI
garyttierney Aug 19, 2018
ab64a09
Add missing wrapper task in Travis config
garyttierney Aug 19, 2018
5307a62
Put plugins with the same name in unique packages
garyttierney Aug 19, 2018
37547ee
Produce coverage report with JaCoCo during CI
garyttierney Aug 19, 2018
5d84cdf
Fix recording of code coverage
garyttierney Aug 20, 2018
50d7e86
Produce XML coverage report for codecov.io
garyttierney Aug 20, 2018
71158b3
Add unit tests for areas plugin
Major- Aug 20, 2018
86fba62
Support npc and object definitions in plugin tests
Major- Aug 20, 2018
7e60393
Throw custom exception on missing plugin dependency
Major- Aug 20, 2018
ae73453
Remove (empty) util plugin
Major- Aug 20, 2018
d4de32c
Rename npc_spawn function to spawnNpc
Major- Aug 20, 2018
2080e1e
Add tests for player actions
Major- Aug 20, 2018
0b0f75d
Added all shops in Lumbridge, Falador, Edgeville, and Al-Kharid
Arham4 Jul 26, 2018
c272423
Add Gradle wrapper
garyttierney Aug 22, 2018
d8c7cdf
Add Appyveyor configuration
garyttierney Aug 22, 2018
c3cdbdf
Create zip file distributions for each AppVeyor build
garyttierney Aug 22, 2018
6198e30
Remove Gradle wrapper hack from Travis config
garyttierney Aug 22, 2018
51cfe1c
Add WalkingQueue tests
garyttierney Aug 22, 2018
d97b627
Include default configuratio in app distribution
garyttierney Aug 22, 2018
eaa6ff6
Add ktlint Gradle plugin
garyttierney Aug 22, 2018
96e11df
Remove empty allprojects block
garyttierney Aug 22, 2018
ba5ff2b
Fix inclusion of ktlint for check tasks
garyttierney Aug 22, 2018
c6cf5a4
Merge pull request #407 from arham4/kotlin-experiments
Major- Aug 22, 2018
14f5353
Merge remote-tracking branch 'origin/master' into kotlin-experiments
garyttierney Aug 22, 2018
4689ba9
Add SonarCloud scans to Travis runs
garyttierney Aug 23, 2018
cfddd05
Repackage api plugin
Major- Aug 23, 2018
0a2d94f
Fix order of gradle arguments in sonarqube run
garyttierney Aug 23, 2018
03786a6
Run Sonarqube after generating JaCoCo report
garyttierney Aug 23, 2018
5346eab
Use travis built-in SonarCloud support
garyttierney Aug 23, 2018
754343a
Move shop plugins to unique packages
garyttierney Aug 23, 2018
dc0690f
Make plugins target java 8
Major- Aug 24, 2018
fd52ee6
Add @DefinitionSource annotations
Major- Aug 24, 2018
f4aa3aa
Add tests for api plugin
Major- Aug 25, 2018
4af28a1
Add tests for spawn plugin
Major- Aug 25, 2018
b6c2102
Add tests for fishing plugin
Major- Aug 25, 2018
1d802c3
Use new SonarCloud organization
garyttierney Aug 26, 2018
46d60b4
Add herblore unit tests and clean-up plugin code
garyttierney Aug 26, 2018
d323571
Add command to teleport to another player
Subby Aug 26, 2018
1f7eb78
Add herblore tests
garyttierney Aug 26, 2018
a53929a
Remove apollo-plugin Gradle plugin
garyttierney Aug 26, 2018
970a5b0
Set input directory in detekt task
garyttierney Aug 27, 2018
b1a687b
Create detekt profiles for each project
garyttierney Aug 27, 2018
0f00988
Fix merging of JaCoCo reports
garyttierney Aug 27, 2018
c891798
Remove inline modifier from string asserts
Major- Aug 28, 2018
1f539b1
Remove duplicate GameObject rotated checks
rmcmk Aug 28, 2018
1a4724d
Repackage player actions plugin
Major- Aug 28, 2018
abc4dc3
Rename walk-to to pathing
Major- Aug 28, 2018
6836111
Repackage following plugin
Major- Aug 28, 2018
9a8f94d
Add runecrafting action unit tests
garyttierney Sep 3, 2018
2ea0f68
Add tests for most command plugins
garyttierney Sep 3, 2018
4525eed
Re-add HTML and XML code coverage reports
garyttierney Sep 4, 2018
274d805
Remove broken imports from command tests
garyttierney Sep 4, 2018
21fea83
Fix Detekt report path
garyttierney Sep 4, 2018
fc1d6f4
Add additional command test coverage
garyttierney Sep 4, 2018
20bb420
Fix typo in skill command tests
garyttierney Sep 4, 2018
5f49ec1
Add tests for remaining commands
garyttierney Sep 4, 2018
b6086d5
Fix mockk error in matcher
garyttierney Sep 4, 2018
475c7ac
Fix kotlin code style issues
garyttierney Sep 4, 2018
a0c78ce
Add library containing detekt rules for apollo plugins
garyttierney Sep 4, 2018
3326dba
Allow Netty to automatically maintain our internal usages of ByteBuf
rmcmk Nov 11, 2018
739c331
Housekeeping
Mar 26, 2019
9c1944c
Let ::pos return other players positions (#422)
Mar 29, 2019
d0c97b2
Merge pull request #421 from KeepBotting/kotlin-experiments
Major- Mar 29, 2019
9633dd0
Merge pull request #420 from ryleykimmel/netty-resource-leak-fix
Major- Mar 29, 2019
cd06a69
Merge pull request #414 from ryleykimmel/enhancement/orientation-dupl…
Major- Mar 29, 2019
8753bed
Update kotlin and coroutines dependencies
Major- Jul 13, 2019
a8d9db5
Update detekt
Major- Jul 13, 2019
16599dd
Refactor shops plugin
Major- Jul 13, 2019
bb35222
Add MagicOnMob MessageHandler
Apr 26, 2019
1b3f1ab
Merge branch 'Tomm0017-magic_on_mob' into kotlin-experiments
Major- Jul 13, 2019
57fc49a
Update test deps for Java 11
garyttierney Jul 16, 2019
04a69ea
Add Azure DevOps pipeline configuration
garyttierney Jul 16, 2019
91e38aa
Run builds in parallel on Azure CI
garyttierney Jul 16, 2019
ab787dd
Enable Gradle build caching in CI
garyttierney Jul 16, 2019
28a4752
Publish test results to CI
garyttierney Jul 16, 2019
37e20c9
Publish code coverage from Azure CI
garyttierney Jul 16, 2019
36571a3
Remove AppVeyor and Travis-CI configuration
garyttierney Jul 16, 2019
cd013fc
Publish SonarQube analysis from Azure CI
garyttierney Jul 16, 2019
655d795
Merge pull request #427 from apollo-rsps/bugfix/jdk-11
garyttierney Jul 16, 2019
809106b
Bump org.jetbrains.kotlin.jvm from 1.3.40 to 1.3.41
dependabot-preview[bot] Jul 16, 2019
ac01419
Bump org.jmailen.kotlinter from 1.16.0 to 1.26.0
dependabot-preview[bot] Jul 16, 2019
b84c6ab
Fix location of detekt report
garyttierney Jul 16, 2019
3c0d30f
Merge pull request #433 from apollo-rsps/bugfix/detekt
garyttierney Jul 16, 2019
6123c2f
Merge pull request #430 from apollo-rsps/dependabot/gradle/org.jmaile…
garyttierney Jul 16, 2019
4086cfb
Merge pull request #431 from apollo-rsps/dependabot/gradle/org.jetbra…
garyttierney Jul 16, 2019
7675546
Bump org.sonarqube from 2.6.2 to 2.7.1
dependabot-preview[bot] Jul 16, 2019
11cee7e
Merge pull request #429 from apollo-rsps/dependabot/gradle/org.sonarq…
garyttierney Jul 16, 2019
0405639
Implement new listener dsl for plugins
Major- Jul 22, 2019
8fb0c8f
Reorganise kotlin message handlers
Major- Jul 22, 2019
ed8611b
Add ButtonClick message handler
Major- Jul 22, 2019
12b4bef
Create raw handlers in plugin listener overloads
Major- Jul 23, 2019
0e91042
Update slack invite link
Major- Oct 12, 2019
2c57070
Add discord link
Major- Feb 29, 2020
30d9534
Fix NPC vertical movement
GregHib May 21, 2020
87553a8
Merge pull request #495 from GregHib/patch-1
garyttierney May 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 11 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ insert_final_newline = false
indent_style=tab
tab_width=4

[*.{kt, kts}]
indent_style=space
tab_width=4
continuation_indent_size=4

[*.gradle]
indent_style=space
tab_width=4
continuation_indent_size=4

[*.rb]
indent_style=space
indent_size=2
indent_size=2
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
*.class
*.iml

/data/rsa.pem
/data/savedGames
/game/data/rsa.pem
/game/data/savedGames
/lib/
*/target/
*/build/
**/build/
**/out/
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node {
stage 'Stage Checkout'
checkout scm

stage 'Stage Build'
gradle 'clean assemble'

stage 'Stage Test'
gradle 'check'
}

def gradle(command) {
sh "${tool name: 'gradle', type: 'hudson.plugins.gradle.GradleInstallation'}/bin/gradle ${command}"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Apollo is a high-performance, modular RuneScape emulator with a collection of ut

### Developer information

Most discussion related to the development of Apollo happens on our [Slack team](https://join.slack.com/t/apollo-rsps/shared_invite/enQtMjQ0NTYwNzkwMjExLTI5NGVmOWZjZGRkYzY4NjM1MjgxNjYyYmEyZWQxMzcxZTA5NDM1MGJkNmRkMjc2ZDQ2NjUwMjAzOGI1NjY1Zjk). If you have a problem and can't get in touch with anyone, create a GitHub issue. If making a pull request, please make sure all tests are still passing after making your changes, and that your code style is consistent with the rest of Apollo.
Most discussion related to the development of Apollo happens on our [Discord](https://discord.gg/Fuft67P). If you have a problem and can't get in touch with anyone, create a GitHub issue. If making a pull request, please make sure all tests are still passing after making your changes, and that your code style is consistent with the rest of Apollo.

### Getting started

Expand Down
47 changes: 47 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
pool:
vmImage: 'ubuntu-latest'

variables:
GRADLE_USER_HOME: $(Pipeline.Workspace)/.gradle

steps:
- task: CacheBeta@0
inputs:
key: $(Agent.OS)
path: $(GRADLE_USER_HOME)
displayName: "Gradle: setup build cache"

- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'apollo-rsps-sonarcloud'
organization: 'apollo-rsps'
scannerMode: 'Other'
displayName: "SonarCloud: prepare analysis"

- task: Gradle@2
displayName: "Gradle: build"
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m -Dorg.gradle.parallel=true -Dorg.gradle.caching=true -Dsonar.host.url=https://sonarcloud.io'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'check jacocoTestReport sonarqube'

- script: |
./gradlew --stop
displayName: "Gradle: stop daemon"

- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
displayName: "SonarCloud: publish quality gate"

- script: |
bash <(curl -s https://codecov.io/bash) -t "${CODECOV_TOKEN}"
env:
CODECOV_TOKEN: $(CODECOV_TOKEN)
displayName: "Codecov: publish coverage"
61 changes: 22 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,51 +1,34 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.41' apply(false)
id 'org.jetbrains.intellij' version '0.4.9' apply(false)
id 'org.jmailen.kotlinter' version '1.26.0' apply(false)
id 'org.sonarqube' version '2.7.1'
id "io.gitlab.arturbosch.detekt" version '1.0.0-RC16'
}

allprojects {
group = 'apollo'
version = '0.0.1'
apply plugin: 'java'
}

subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenLocal()
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://dl.bintray.com/kotlin/kotlinx/" }
}
}

dependencies {
compile group: 'org.apache.commons', name: 'commons-compress', version: '1.10'
compile group: 'org.jruby', name: 'jruby-complete', version: '9.0.5.0'
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile group: 'io.netty', name: 'netty-all', version: '4.0.34.Final'
compile group: 'com.lambdaworks', name: 'scrypt', version: '1.4.0'
compile group: 'com.mchange', name: 'c3p0', version: '0.9.5.2'
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.54'
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.4'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.4'
}
apply from: 'gradle/properties.gradle'
apply from: 'gradle/code-quality.gradle'
apply from: 'gradle/testing.gradle'
apply from: 'gradle/wrapper.gradle'

sourceSets {
main {
java {
srcDirs = ['src/main']
}
}
gradle.projectsEvaluated {
task check {
def deps = []
deps += getTasksByName("check", true).findAll { it.project != rootProject }
deps += "detekt"
deps += jacocoReport

test {
java {
srcDirs = ['src/test']
}
}
dependsOn(deps)
}
}

task(run, dependsOn: classes, type: JavaExec) {
def gameSubproject = project(':game')
def gameClasspath = gameSubproject.sourceSets.main.runtimeClasspath

main = 'org.apollo.Server'
classpath = gameClasspath
jvmArgs = ['-Xmx1750M']
}
}
11 changes: 10 additions & 1 deletion cache/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
apply plugin: 'java-library'

description = 'Apollo Cache'

dependencies {
compile project(':util')
implementation project(':util')
implementation group: 'com.google.guava', name: 'guava', version: guavaVersion

test.useJUnitPlatform()
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVintageVersion
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion
}
38 changes: 38 additions & 0 deletions game/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
apply plugin: 'application'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply from: "$rootDir/gradle/kotlin.gradle"

description = 'Apollo Game'
mainClassName = 'org.apollo.Server'

dependencies {
compile project(':cache')
compile project(':net')
compile project(':util')

compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'
compile group: 'org.jetbrains.kotlin', name: 'kotlin-scripting-common'
compile group: 'org.jetbrains.kotlin', name: 'kotlin-script-runtime'
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-jdk8', version: kotlinxCoroutinesVersion
compile group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: kotlinxCoroutinesVersion

implementation group: 'com.google.guava', name: 'guava', version: guavaVersion
implementation group: 'io.github.classgraph', name: 'classgraph', version: classGraphVersion
implementation group: 'com.lambdaworks', name: 'scrypt', version: scryptVersion

test.useJUnitPlatform()
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion
testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: junitVintageVersion
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformVersion

testImplementation group: 'junit', name: 'junit', version: junitVersion
testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: powermockVersion
testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: powermockVersion
testImplementation group: 'org.assertj', name: 'assertj-core', version: assertjVersion

project(":game:plugin").subprojects { pluginProject ->
if (pluginProject.buildFile.exists()) {
runtimeClasspath pluginProject
}
}
}

applicationDistribution.from("$rootDir/data") {
include '*.dat'
include '*.xml'
into "data/"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions data/messages.xml → game/data/messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
<handler>org.apollo.game.message.handler.ItemVerificationHandler</handler>
</chain>
</message>
<message>
<type>org.apollo.game.message.impl.MagicOnMobMessage</type>
<chain>
<handler>org.apollo.game.message.handler.MagicOnMobVerificationHandler</handler>
</chain>
</message>
<message>
<type>org.apollo.game.message.impl.NpcActionMessage</type>
<chain>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions game/plugin-detekt-rules/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apply plugin: 'java-library'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply from: "$rootDir/gradle/kotlin.gradle"

dependencies {
api group: 'io.gitlab.arturbosch.detekt', name: 'detekt-api', version: detektVersion
api group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8'

test.useJUnitPlatform()
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testImplementation("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}")

testImplementation group: 'io.gitlab.arturbosch.detekt', name: 'detekt-test', version: detektVersion
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.apollo.game.plugin.detekt

import io.gitlab.arturbosch.detekt.api.Config
import io.gitlab.arturbosch.detekt.api.RuleSet
import io.gitlab.arturbosch.detekt.api.RuleSetProvider
import org.apollo.game.plugin.detekt.rules.DeclarationInScriptRule

class ApolloPluginRuleSetProvider : RuleSetProvider {
override val ruleSetId = "apollo-plugin"

override fun instance(config: Config): RuleSet {
return RuleSet(ruleSetId, listOf(
DeclarationInScriptRule()
))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.apollo.game.plugin.detekt.rules

import io.gitlab.arturbosch.detekt.api.*
import org.jetbrains.kotlin.psi.KtClass
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtObjectDeclaration

class DeclarationInScriptRule : Rule() {
override val issue = Issue(
"DeclarationInScript",
Severity.CodeSmell,
"This rule reports a plugin file containing class or object declarations.",
Debt.FIVE_MINS
)

override fun visit(root: KtFile) {
super.visit(root)

val script = root.script ?: return
val declarations = script.declarations.filter { it is KtClass || it is KtObjectDeclaration }

declarations
.forEach {
report(CodeSmell(
issue,
Entity.from(it),
message = "Declaration of ${it.name} should live in a top-level file, not a script"
))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.apollo.game.plugin.detekt.ApolloPluginRuleSetProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.apollo.game.plugin.detekt.rules

import io.gitlab.arturbosch.detekt.test.lint
import java.nio.file.Paths
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test

internal class DeclarationInScriptRuleTest {
val rule = DeclarationInScriptRule()

@Test
fun `Finds warning in script file`() {
val srcPath = Paths.get(this.javaClass.getResource("/testData/example.kts").toURI())
val findings = rule.lint(srcPath)

assertEquals(1, findings.size)
assertEquals("Declaration of ExampleDeclaration should live in a top-level file, not a script", findings[0].message)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ExampleDeclaration {

}
28 changes: 28 additions & 0 deletions game/plugin-testing/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apply plugin: 'java-library'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply from: "$rootDir/gradle/kotlin.gradle"

dependencies {
test.useJUnitPlatform()

api project(':game')
api project(':net')

// JUnit Jupiter API and TestEngine implementation
api("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
api("org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}")
implementation("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
implementation("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}")

api group: 'io.mockk', name: 'mockk', version: mockkVersion
api group: 'org.assertj', name: 'assertj-core', version: assertjVersion
api group: 'com.willowtreeapps.assertk', name: 'assertk', version: assertkVersion

implementation group: 'org.powermock', name: 'powermock-module-junit4', version: powermockVersion
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package org.apollo.game.plugin.testing.assertions

import io.mockk.MockKMatcherScope

fun MockKMatcherScope.contains(search: String) = match<String> { it.contains(search) }
fun MockKMatcherScope.startsWith(search: String) = match<String> { it.startsWith(search) }
fun MockKMatcherScope.endsWith(search: String) = match<String> { it.endsWith(search) }
Loading