Bot extension gradle plugin
Table of Contents
Bot extension gradle plugin allows to deploy bot extension to a configured target.
Usage
-
Add smarty plugin repository to
settings.gradle:pluginManagement { repositories { maven { url 'https://smarty.lite-games.com/repository/public' } } } -
Declare smarty-bot-extension plugin in
build.gradleplugins { id 'com.litegames.smarty-bot-extension' version '0.0.1' } -
Configure smarty bot extension deployment:
smartyBotExtension { deploy { files { extension { src jar.archivePath dst "<<ProjectName>>BotExtension.jar" } } target(com.litegames.smarty.bot.extension.config.api.deploy.AwsTarget) { uri "s3://smarty-bots-repository/<<ProjectShortName>>" accessKey project.ext["<<ProjectShortName>>.botserver.accesskey"] secretKey project.ext["<<ProjectShortName>>.botserver.secretkey"] } } } -
Put target credentials in
~/.gradle/gradle.properties:<<ProjectShortName>>.botserver.accesskey=ACCESSKEY <<ProjectShortName>>.botserver.secretkey=SECRETKEY -
For more insight, check Smarty Alpha Bot Extension example project
Other options
Configure deploy environments
By default there are two deploy environments:
-
production - saved under "prod" subfolder
-
development - saved under "dev" subfolder
smartyBotExtension {
// ...
deploy {
// Optional environment configuration.
environments {
production {
targetDir "prod"
}
development {
targetDir "dev"
}
}
// ...
}
Deploy to http server
smartyBotExtension {
deploy {
// ...
target(com.litegames.smarty.bot.extension.config.api.deploy.HttpTarget) {
uri "https:dev.lite-games.com/repository/<<ProjectShortName>>"
userName project.ext["<<ProjectShortName>>.botserver.username"]
password project.ext["<<ProjectShortName>>.botserver.password"]
}
// ...
}
}
Configuration full syntax
smartyBotExtension {
deploy {
// Files configuraiton [required]
files {
extension {
// src: File - source file
src jar.archivePath
// dst: String - destination file name
// (will be uploaded to ${target.uri}/${environment/targetDir}/${dst})
dst "<<ProjectName>>BotExtension.jar"
}
}
// Environments configuration [optional]
environments {
production {
targetDir "prod"
}
development {
targetDir "dev"
}
}
// Target configuration [required]
// - AWS target configuration example
target(com.litegames.smarty.bot.extension.config.api.deploy.AwsTarget) {
uri "s3://smarty-bots-repository/<<ProjectShortName>>"
accessKey project.ext["<<ProjectShortName>>.botserver.accesskey"]
secretKey project.ext["<<ProjectShortName>>.botserver.secretkey"]
}
// - Http target configuration example
target(com.litegames.smarty.bot.extension.config.api.deploy.HttpTarget) {
uri "https://dev.lite-games.com/repository/<<ProjectShortName>>"
userName project.ext["<<ProjectShortName>>.botserver.username"]
password project.ext["<<ProjectShortName>>.botserver.password"]
}
}
}
Troubleshooting
Gradle configuration fails
-
Make sure you are using IntelliJ IDEA IDE.
-
Compare your project configuration to Smarty Alpha Bot Extension project configuration.