diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ceab9f2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,16 @@ +name: Build + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Gradle + run: ./gradlew build diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c9874f8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: java -install: true - -os: linux -dist: trusty -jdk: oraclejdk8 - -jobs: - include: - - stage: build - script: ./gradlew build -s diff --git a/README.md b/README.md index 5d655f6..9cbe041 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,14 @@ their dependencies * Other fields are parameters of plugin and must be provided directly * Example is available in the [example section](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L6-L11): here `Hello` is name of plugin and `parameter` is its configuration parameter + * Change [params](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L12-L17): + * Any key here will be available in plugins as name of param + * Any value must contains: + * `type` to detect which one object to instantiate + * Other type parameters + * You may look into example related to database in + [config](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#13): `defaultDatabase` + is easily available in plugins as `params.database` extension ## How to launch diff --git a/build.gradle b/build.gradle index 53dea46..69ebd72 100644 --- a/build.gradle +++ b/build.gradle @@ -38,5 +38,6 @@ application { kapt { arguments { arg("com.github.matfax.klassindex.IndexSubclasses", "dev.inmo.plagubot.Plugin") + arg("com.github.matfax.klassindex.IndexAnnotated", "dev.inmo.sdi.SDIIncluded") } } diff --git a/config.json b/config.json index 3b998f1..a60e7dd 100644 --- a/config.json +++ b/config.json @@ -1,12 +1,17 @@ { - "database": { - "url": "jdbc:sqlite:file:test?mode=memory&cache=shared" - }, "botToken": "1234567890:ABCDEFGHIJKLMNOP_qrstuvwxyz12345678", "plugins": [ { "type": "Hello", "parameter": "Example" } - ] + ], + "params": { + "defaultDatabase": [ + "dev.inmo.plagubot.config.DatabaseConfig", + { + "url": "jdbc:sqlite:file:test?mode=memory&cache=shared" + } + ] + } } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2b5b459..1f249ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,6 +3,6 @@ org.gradle.parallel=true kotlin.js.generate.externals=true kotlin.incremental=true -kotlin_version=1.4.21 -plagubot_version=0.0.5 +kotlin_version=1.4.30 +plagubot_version=0.1.0 klassindex_version=4.1.0-rc.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index be52383..2a56324 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists