Skip to content

Latest commit

 

History

History
83 lines (50 loc) · 4.89 KB

README.md

File metadata and controls

83 lines (50 loc) · 4.89 KB

Bob

Defold Bob the Builder build system.

Paths

In general paths in bob are separated with forward slashes and paths do not have an end separator, i.e. /foo/bar instead of /foo/bar/

Library Cache

Caching of libraries is based on the Git SHA1, to the actual commit

  • The SHA1 is stored in the zip file comment
  • The SHA1 is used as ETag and If-None-Match/"304 Not modified" for cache validation
  • Note that the SHA1, in general, is not identical to the requested version as the requested version can be symbolic, e..g HEAD, 1.0, etc. Moreover, for tags, the underlying SHA1 to the actual commit in question is used and not the SHA1 for the tag-object.

Setup IDEA

  1. Download and install IntelliJ IDEA Community Edition from here: https://www.jetbrains.com/idea/download .

  2. Start the IDE and on the initial welcome screen choose Open project. Navigate to Bob's source directory com.dynamo.cr.

  3. In case there is a popup that detected maven/eclipse configuration and asks about it, just choose maven. It should make no difference.

  4. Open File -> Project Structure and in Project Settings -> Project add JDK 17

  5. In Project Settings -> Modules -> Sources select com.dynamo.cr.bob/generated, com.dynamo.cr.bob/src and com.dynamo.cr.common/src folders and click Mark as: Sources Mark as: Sources

  6. Select com.dynamo.cr.bob.test/src and com.dynamo.cr.common.test/src folders and click Mark as: Tests Mark as: Tests

  7. Change language level to 8 - Lambdas, type annotations etc. Change language level

  8. In Project Settings -> Modules -> Dependencies click + then 1 JARs or Directories... and choose com.dynamo.cr/com.dynamo.cr.common/ext and repeat for com.dynamo.cr/com.dynamo.cr.bob/lib and com.dynamo.cr/com.dynamo.cr.bob.test/lib Dependencies

  9. Right click to build.xml and choose very last option Add as Ant Build File for each of the following: com.dynamo.cr/com.dynamo.cr.bob/build.xml com.dynamo.cr/com.dynamo.cr.bob.test/build.xml com.dynamo.cr/com.dynamo.cr.common/build.xml build.xml

  10. In Ant window click to Properties, choose Properties and add Name:env.DYNAMO_HOME Value:../../tmp/dynamo_home, switch to Execution make sure right JDK picked Properties Properties2

  11. Repeat it for the rest of build.xml but for com.dynamo.cr/com.dynamo.cr.bob.test/build.xml also add Name:DM_BOB_BUNDLERTEST_ONLY_HOST and Value:1 DM_BOB_BUNDLERTEST_ONLY_HOST

  12. Now you can Run Ant jobs from IDEA, just pick needed build.xml and Run it in Ant window Build

  13. Logs with the progress of building can be found in View -> Tool Windows -> Messages Logs

Debugging

Once bob.jar has been built, it can be debugged with IntelliJ IDE.

Run Configuration

A Run configuration has to be specified that will execute bob.jar. Set it up as if executing it on the command line.

  1. From the Configurations dropdown on the top bar (next to the hammer) click Edit configuration to open the Run/Debug Configurations dialog.

  2. Click Add new/JAR Application and set a proper name for it.

  3. In the Configuration tab use the following settings:

    • Path to JAR - Absolute path to bob.jar. For example, /home/.../defold/com.dynamo.cr/com.dynamo.cr.bob/dist/bob.jar
    • Program arguments - Command line arguments given when executing bob. For example, --platform x86_64-linux distclean build --archive bundle --variant debug. It really depends on what parts of Bob's functionality you want to debug.
    • Working directory - Path of a Defold project root, since the command line arguments tells bob to build a project.
    • JRE - JVM used by Defold.

Leave the rest of the fields empty and click "Apply".

Run Configuration

Run/Debug Bob

Hit run/play or debug button to execute the Run configuration created. Check the console at the bottom for typical bob output. Next, browse bob's source code to set breakpoints, pause execution, check watches etc.