1+ // This file controls gradle, which we are using to install and update the RLBot framework used by this example bot.
2+
3+ // There's no java in this example, but we still need the plugin to make our strategy work for downloading
4+ // the framework zip.
15apply plugin : ' java'
26
37repositories {
4- jcenter()
58 maven { url ' https://jitpack.io' }
69}
710
811dependencies {
9- compile ' com.github.RLBot:RLBot:v4-SNAPSHOT:python@zip' // Fetch the python zip
12+ // Fetch the framework zip file. This will automatically stay up-to-date with the latest changes in the v4 branch.
13+ // This is useful for automatically getting fixes when the framework breaks due to Rocket League patches.
14+ // For different behavior, e.g. freezing at a specific version of the framework, see https://jitpack.io/docs/
15+ compile ' com.github.RLBot:RLBot:v4-SNAPSHOT:python@zip'
1016}
1117
18+ // Handy helper method for finding the actual files involved with a compile dependency.
1219def findFile (suffix ) {
1320 configurations. compile. filter { it. name. endsWith(suffix) }
1421}
1522
16- task assemblePython (type : Copy ) {
23+ // Extracts the RLBot framework zip into a directory in ./build/framework so it can be used by the bot.
24+ task prepareFrameworkDirectory (type : Copy ) {
1725 from zipTree(findFile(' python.zip' ). singleFile)
1826 into ' build/framework'
1927}
2028
29+ // Uses pip (the python package manager) to install all the python packages needed for this bot, as defined
30+ // in requirements.txt.
2131task pipInstallRequirements (type : Exec ) {
2232 commandLine " pip" , " install" , " -r" , " requirements.txt"
2333}
@@ -26,6 +36,11 @@ task tournamentZip(type: Zip) {
2636 from fileTree(dir : ' python_example' , exclude : ' **/__pycache__' )
2737}
2838
29- processResources. dependsOn assemblePython
30- assemblePython. dependsOn pipInstallRequirements
39+ // Installs or updates RLBot. Empty task for now. It still does stuff because it "dependsOn" tasks that do things.
40+ task updateRLBot
41+ updateRLBot. dependsOn pipInstallRequirements
42+ updateRLBot. dependsOn prepareFrameworkDirectory
3143
44+ // Must prepare the framework directory before running pip because the requirements.txt file references another one
45+ // inside the framework directory.
46+ pipInstallRequirements. dependsOn prepareFrameworkDirectory
0 commit comments