Skip to content

Latest commit

 

History

History
 
 

com.dynamo.cr

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

First of all, follow the engine setup instructions and build the engine at least once, as well as Bob.

  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. Open com.dynamo.cr.bob/build.gradle and run installBob task. Open com.dynamo.cr.common/build.gradle and run generateProtos task.

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

  5. Make sure Compiler output specified Compiler output

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

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

  8. Add com.dynamo.cr.bob as Resource Folder and com.dynamo.cr.bob.test/test resources

  9. Select com.dynamo.cr.bob.test/build folder and click Mark as: Excluded Excluded

  10. Change language level to 17 - Sealed types, always-strict floating-point semantics Change language level

  11. 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, com.dynamo.cr/com.dynamo.cr.common/ext/aws and com.dynamo.cr/com.dynamo.cr.bob.test/lib Dependencies

Testing

To be able to run single tests, change default template for JUnit tests:

  1. Open Edit Configurations
  2. Click Edit Configuration Template Edit configuration template
  3. Pick JUnit and specify working derictory as $MODULE_WORKING_DIR$/com.dynamo.cr.bob.test working derictory

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.