diff --git a/README.md b/README.md index 0fb5c4d0c7..62dccc15a9 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ The gradlew wrapper only exists in the root of the main project, so be sure to r There are a few tasks other than `build` available. To see them, run the meta-task `tasks`. This will print a list of all available tasks, with a description of each task. +If opening from a fresh clone, generated java dependencies will not exist. Most IDEs will not run the generation tasks, which will cause lots of IDE errors. Manually run `./gradlew compileJava` from a terminal to run all the compile tasks, and then refresh your IDE's configuration (In VS Code open settings.gradle and save). + ### Faster builds `./gradlew build` builds _everything_, which includes debug and release builds for desktop and all installed cross compilers. Many developers don't need or want to build all of this. Therefore, common tasks have shortcuts to only build necessary components for common development and testing tasks. diff --git a/simulation/gz_msgs/build.gradle b/simulation/gz_msgs/build.gradle index ccc933efa0..31f3df4985 100644 --- a/simulation/gz_msgs/build.gradle +++ b/simulation/gz_msgs/build.gradle @@ -24,6 +24,8 @@ try { } catch(Exception ex) { } +ext.skip_gz_msgs = false + if (project.hasProperty("forceGazebo")) { if (!protobuf_version?.trim()) { println "Protobuf is not available. (pkg-config --modversion protobuf failed)" @@ -38,9 +40,11 @@ tasks.whenTaskAdded { task -> task.onlyIf { !project.hasProperty('skip_gz_msgs') } } -dependencies { - implementation "com.google.protobuf:protobuf-java:${protobuf_version}" - implementation "com.google.protobuf:protoc:${protobuf_version}" +if (!ext.skip_gz_msgs) { + dependencies { + implementation "com.google.protobuf:protobuf-java:${protobuf_version}" + implementation "com.google.protobuf:protoc:${protobuf_version}" + } } /* There is a nice gradle plugin for protobuf, and the protoc tool