Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[submodule "ros2_interfaces/common_interfaces"]
path = jros2Generator/ros2_interfaces/common_interfaces
path = ros2_interfaces/common_interfaces
url = https://github.com/ros2/common_interfaces
branch = humble
[submodule "ros2_interfaces/rcl_interfaces"]
path = jros2Generator/ros2_interfaces/rcl_interfaces
path = ros2_interfaces/rcl_interfaces
url = https://github.com/ros2/rcl_interfaces
branch = humble
[submodule "ros2_interfaces/example_interfaces"]
path = jros2Generator/ros2_interfaces/example_interfaces
path = ros2_interfaces/example_interfaces
url = https://github.com/ros2/example_interfaces
branch = humble
136 changes: 82 additions & 54 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import us.ihmc.jros2.generator.jros2GenTask

/*
* Copyright 2025 Florida Institute for Human and Machine Cognition (IHMC)
*
Expand All @@ -13,92 +15,118 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import us.ihmc.jros2.generator.task.jros2GenTask

plugins {
id("java-library")
id("java-library")
id("java-gradle-plugin")
id("us.ihmc.ihmc-build")

id("us.ihmc.ihmc-build")
id("us.ihmc.jros2.generator") version "1.0.2"
id("us.ihmc.jros2.generator") version "1.0.999"
}

ihmc {
group = "us.ihmc"
version = "1.0.1"
vcsUrl = "https://github.com/ihmcrobotics/jros2"
openSource = true
group = "us.ihmc"
version = "1.0.999"
vcsUrl = "https://github.com/ihmcrobotics/jros2"
openSource = true

configureDependencyResolution()
configurePublications()
}

configureDependencyResolution()
configurePublications()
ihmc.sourceSetProject("generator").plugins.apply("java-gradle-plugin")
ihmc.sourceSetProject("generator").gradlePlugin {
website.set("https://github.com/ihmcrobotics/jros2")
vcsUrl.set("https://github.com/ihmcrobotics/jros2")

plugins {
create("jros2Generator") {
id = "us.ihmc.jros2.generator"
displayName = "jros2 Interface Generator"
description = "Gradle plugin to generate Java ROS 2 interface classes from .msg files"
tags.set(listOf("jros2", "ros2"))
implementationClass = "us.ihmc.jros2.generator.jros2GeneratorPlugin"
}
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks.javadoc {
exclude("us/ihmc/fastddsjava/**")
exclude("us/ihmc/fastddsjava/**")
exclude("us/ihmc/fastddsjava/**")
}

sourceSets {
named("main") {
java.srcDirs("src/main/java-interfaces")
}
named("main") {
java.srcDirs("src/main/java-interfaces")
}
}

mainDependencies {
// Transitive dependencies
api("us.ihmc:javacpp:1.5.11-ihmc-2") {
isTransitive = true
}
api("us.ihmc:ihmc-native-library-loader:2.0.6") {
isTransitive = true
}
api("us.ihmc:log-tools:0.6.5") {
isTransitive = true
}
// Match this version with YoVariables
api("com.sun.xml.bind:jaxb-impl:4.0.5") {
isTransitive = true
}
api("org.antlr:ST4:4.3.4") {
isTransitive = true
}
api("org.bytedeco:javacpp:1.5.11") {
isTransitive = true
}
api("us.ihmc:ihmc-native-library-loader:2.0.6") {
isTransitive = true
}
api("us.ihmc:log-tools:0.6.5") {
isTransitive = true
}
// Match this version with YoVariables
api("com.sun.xml.bind:jaxb-impl:4.0.5") {
isTransitive = true
}
}

parserDependencies {
}

generatorDependencies {
api(gradleApi())

api(ihmc.sourceSetProject("parser"))

api("org.antlr:ST4:4.3.4") {
isTransitive = true
}
}

testDependencies {
api(ihmc.sourceSetProject("parser"))
api(ihmc.sourceSetProject("generator"))
}

tasks.register<jros2GenTask>("generate_default_interfaces") {
tasks.register<jros2GenTask>("jros2GenerateDefaultInterfaces") {
// Make sure the git submodules are updated
ProcessBuilder("git", "submodule", "update", "--init", "--recursive").directory(projectDir).start().waitFor()

description = "Generate ROS 2 default interfaces source files"
group = Char.MIN_VALUE + "jros2" // Hack to prevent Gradle from capitalizing jros2
packagePaths = listOf(
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("example_interfaces").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("example_interfaces").absolutePath,

// rcl_interfaces used as dependency to common_interfaces; we include it here
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("builtin_interfaces").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("lifecycle_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("rcl_interfaces").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("rosgraph_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("statistics_msgs").absolutePath,

projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("actionlib_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("diagnostic_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("geometry_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("nav_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("sensor_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("shape_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("std_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("stereo_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("trajectory_msgs").absolutePath,
projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("common_interfaces").resolve("visualization_msgs").absolutePath,

projectDir.resolve("jros2Generator").resolve("ros2_interfaces").resolve("jros2_example_interfaces").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("builtin_interfaces").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("lifecycle_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("rcl_interfaces").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("rosgraph_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("rcl_interfaces").resolve("statistics_msgs").absolutePath,

projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("actionlib_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("diagnostic_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("geometry_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("nav_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("sensor_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("shape_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("std_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("stereo_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("trajectory_msgs").absolutePath,
projectDir.resolve("ros2_interfaces").resolve("common_interfaces").resolve("visualization_msgs").absolutePath,

projectDir.resolve("ros2_interfaces").resolve("jros2_example_interfaces").absolutePath,
)
outputDir = sourceSets["main"].java.srcDirs.find { it.name == "java-interfaces" }.toString()
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title = jros2
extraSourceSets = ["test"]
extraSourceSets = ["test", "parser", "generator"]
compositeSearchHeight = 0
excludeFromCompositeBuild = false
101 changes: 0 additions & 101 deletions jros2Generator/build.gradle.kts

This file was deleted.

Binary file removed jros2Generator/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 0 additions & 7 deletions jros2Generator/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading