Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference local schema files #535

Draft
wants to merge 9 commits into
base: sdf9
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions sdf/1.5/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
set (sdfs
actor.sdf
altimeter.sdf
audio_source.sdf
audio_sink.sdf
audio_source.sdf
battery.sdf
box_shape.sdf
camera.sdf
collision_engine.sdf
collision.sdf
contact.sdf
cylinder_shape.sdf
frame.sdf
forcetorque.sdf
frame.sdf
geometry.sdf
gps.sdf
gripper.sdf
Expand All @@ -20,16 +21,16 @@ set (sdfs
imu.sdf
inertial.sdf
joint.sdf
light.sdf
light_state.sdf
link.sdf
light.sdf
link_state.sdf
link.sdf
logical_camera.sdf
magnetometer.sdf
material.sdf
mesh_shape.sdf
model.sdf
model_state.sdf
model.sdf
noise.sdf
physics.sdf
plane_shape.sdf
Expand All @@ -39,38 +40,39 @@ set (sdfs
pose.sdf
projector.sdf
ray.sdf
rfidtag.sdf
rfid.sdf
rfidtag.sdf
road.sdf
root.sdf
scene.sdf
sensor.sdf
spherical_coordinates.sdf
sphere_shape.sdf
sonar.sdf
sphere_shape.sdf
spherical_coordinates.sdf
state.sdf
surface.sdf
transceiver.sdf
urdf.sdf
visual.sdf
world.sdf
)

set (SDF_SCHEMA)

foreach(FIL ${sdfs})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
set(root root.sdf)

get_filename_component(ABS_FIL ${root} ABSOLUTE)
get_filename_component(FIL_WE ${root} NAME_WE)

list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")
list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${FIL}"
VERBATIM)
endforeach()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${root}"
VERBATIM)

add_custom_target(schema1_5 ALL DEPENDS ${SDF_SCHEMA})

Expand Down
4 changes: 2 additions & 2 deletions sdf/1.5/schema/types.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:simpleType name="vector3">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){2}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){2}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand All @@ -26,7 +26,7 @@

<xsd:simpleType name="pose">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){5}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){5}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand Down
44 changes: 24 additions & 20 deletions sdf/1.6/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set (sdfs
actor.sdf
air_pressure.sdf
altimeter.sdf
atmosphere.sdf
audio_source.sdf
audio_sink.sdf
audio_source.sdf
battery.sdf
box_shape.sdf
camera.sdf
collision_engine.sdf
collision.sdf
contact.sdf
cylinder_shape.sdf
frame.sdf
forcetorque.sdf
frame.sdf
geometry.sdf
gps.sdf
gripper.sdf
Expand All @@ -21,16 +23,17 @@ set (sdfs
imu.sdf
inertial.sdf
joint.sdf
light.sdf
lidar.sdf
light_state.sdf
link.sdf
light.sdf
link_state.sdf
link.sdf
logical_camera.sdf
magnetometer.sdf
material.sdf
mesh_shape.sdf
model.sdf
model_state.sdf
model.sdf
noise.sdf
physics.sdf
plane_shape.sdf
Expand All @@ -40,38 +43,39 @@ set (sdfs
pose.sdf
projector.sdf
ray.sdf
rfidtag.sdf
rfid.sdf
rfidtag.sdf
road.sdf
root.sdf
scene.sdf
sensor.sdf
spherical_coordinates.sdf
sphere_shape.sdf
sonar.sdf
sphere_shape.sdf
spherical_coordinates.sdf
state.sdf
surface.sdf
transceiver.sdf
urdf.sdf
visual.sdf
world.sdf
)

set (SDF_SCHEMA)

foreach(FIL ${sdfs})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
set(root root.sdf)

get_filename_component(ABS_FIL ${root} ABSOLUTE)
get_filename_component(FIL_WE ${root} NAME_WE)

list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")
list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${FIL}"
VERBATIM)
endforeach()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${root}"
VERBATIM)

add_custom_target(schema1_6 ALL DEPENDS ${SDF_SCHEMA})

Expand Down
4 changes: 2 additions & 2 deletions sdf/1.6/schema/types.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:simpleType name="vector3">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){2}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){2}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand All @@ -26,7 +26,7 @@

<xsd:simpleType name="pose">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){5}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){5}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand Down
44 changes: 24 additions & 20 deletions sdf/1.7/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set (sdfs
actor.sdf
air_pressure.sdf
altimeter.sdf
atmosphere.sdf
audio_source.sdf
audio_sink.sdf
audio_source.sdf
battery.sdf
box_shape.sdf
camera.sdf
collision_engine.sdf
collision.sdf
contact.sdf
cylinder_shape.sdf
frame.sdf
forcetorque.sdf
frame.sdf
geometry.sdf
gps.sdf
gripper.sdf
Expand All @@ -21,16 +23,17 @@ set (sdfs
imu.sdf
inertial.sdf
joint.sdf
light.sdf
lidar.sdf
light_state.sdf
link.sdf
light.sdf
link_state.sdf
link.sdf
logical_camera.sdf
magnetometer.sdf
material.sdf
mesh_shape.sdf
model.sdf
model_state.sdf
model.sdf
noise.sdf
physics.sdf
plane_shape.sdf
Expand All @@ -40,38 +43,39 @@ set (sdfs
pose.sdf
projector.sdf
ray.sdf
rfidtag.sdf
rfid.sdf
rfidtag.sdf
road.sdf
root.sdf
scene.sdf
sensor.sdf
spherical_coordinates.sdf
sphere_shape.sdf
sonar.sdf
sphere_shape.sdf
spherical_coordinates.sdf
state.sdf
surface.sdf
transceiver.sdf
urdf.sdf
visual.sdf
world.sdf
)

set (SDF_SCHEMA)

foreach(FIL ${sdfs})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
set(root root.sdf)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the same changes to the all the sdf/*/CMakeLists.txt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

75b33b6 I've made the changes for until 1.5 since 1.4 and older do not print out the schemas


get_filename_component(ABS_FIL ${root} ABSOLUTE)
get_filename_component(FIL_WE ${root} NAME_WE)

list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")
list(APPEND SDF_SCHEMA "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${FIL}"
VERBATIM)
endforeach()
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.xsd"
COMMAND ${RUBY} ${CMAKE_SOURCE_DIR}/tools/xmlschema.rb
ARGS -s ${CMAKE_CURRENT_SOURCE_DIR} -i ${ABS_FIL} -o ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${ABS_FIL}
COMMENT "Running xml schema compiler on ${root}"
VERBATIM)

add_custom_target(schema1_7 ALL DEPENDS ${SDF_SCHEMA})

Expand Down
7 changes: 4 additions & 3 deletions sdf/1.7/schema/types.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<xsd:simpleType name="vector3">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){2}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){2}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand All @@ -26,12 +26,13 @@

<xsd:simpleType name="pose">
<xsd:restriction base="xsd:string">
<xsd:pattern value="(\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+)\s+){5}((-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+[eE][-\+]?[0-9]+))\s*"/>
<xsd:pattern value="((\s*(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s+){5}(-|\+)?(\d+(\.\d*)?|\.\d+|\d+\.\d+)([eE][-\+]?[0-9]+)?\s*)?"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="time">
<xsd:restriction base="xsd:double">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\s*\d+\s+\d+\s*"/>
</xsd:restriction>
</xsd:simpleType>

Expand Down
Loading