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.
-
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
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
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
-
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
andcom.dynamo.cr/com.dynamo.cr.bob.test/lib
-
Right click to
build.xml
and choose very last optionAdd 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
-
In
Ant
window click toProperties
, chooseProperties
and add Name:env.DYNAMO_HOME
Value:../../tmp/dynamo_home
, switch toExecution
make sure right JDK picked -
Repeat it for the rest of
build.xml
but forcom.dynamo.cr/com.dynamo.cr.bob.test/build.xml
also add Name:DM_BOB_BUNDLERTEST_ONLY_HOST
and Value:1
-
Now you can Run Ant jobs from IDEA, just pick needed
build.xml
and Run it in Ant window -
Logs with the progress of building can be found in
View -> Tool Windows -> Messages
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.