Defold Bob the Builder build system.
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/
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.
First of all, follow the engine setup instructions and build the engine at least once, as well as Bob.
-
Download and install IntelliJ IDEA Community Edition from here: https://www.jetbrains.com/idea/download .
-
Start the IDE and on the initial welcome screen choose Open project. Navigate to Bob's source directory
com.dynamo.cr
. -
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 runinstallBob
task. Opencom.dynamo.cr.common/build.gradle
and rungenerateProtos
task. -
Open
File -> Project Structure
and inProject Settings -> Project
add JDK 17 -
In
Project Settings -> Modules -> Sources
selectcom.dynamo.cr.bob/generated
,com.dynamo.cr.bob/src
,com.dynamo.cr.common/generated
andcom.dynamo.cr.common/src
folders and clickMark as: Sources
-
Select
com.dynamo.cr.bob.test/src
andcom.dynamo.cr.common.test/src
folders and clickMark as: Tests
-
Add
com.dynamo.cr.bob
as Resource Folder andcom.dynamo.cr.bob.test/test
-
Select
com.dynamo.cr.bob.test/build
folder and clickMark as: Excluded
-
Change language level to
17 - Sealed types, always-strict floating-point semantics
-
In
Project Settings -> Modules -> Dependencies
click+
then1 JARs or Directories...
and choosecom.dynamo.cr/com.dynamo.cr.common/ext
and repeat forcom.dynamo.cr/com.dynamo.cr.bob/lib
,com.dynamo.cr/com.dynamo.cr.common/ext/aws
andcom.dynamo.cr/com.dynamo.cr.bob.test/lib
To be able to run single tests, change default template for JUnit tests:
- Open
Edit Configurations
- Click
Edit Configuration Template
- Pick JUnit and specify working derictory as
$MODULE_WORKING_DIR$/com.dynamo.cr.bob.test
Once bob.jar has been built, it can be debugged with IntelliJ IDE.
A Run configuration has to be specified that will execute bob.jar. Set it up as if executing it on the command line.
-
From the Configurations dropdown on the top bar (next to the hammer) click Edit configuration to open the Run/Debug Configurations dialog.
-
Click Add new/JAR Application and set a proper name for it.
-
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.jarProgram 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".
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.