@@ -727,7 +727,6 @@ const core = __importStar(__webpack_require__(470));
727
727
const exec = __importStar ( __webpack_require__ ( 986 ) ) ;
728
728
const fs = __webpack_require__ ( 747 ) ;
729
729
const ROS_DISTRO = core . getInput ( 'ros-distro' , { required : true } ) ;
730
- let GAZEBO_VERSION = core . getInput ( 'gazebo-version' ) ;
731
730
let SAMPLE_APP_VERSION = '' ;
732
731
const WORKSPACE_DIRECTORY = core . getInput ( 'workspace-dir' ) ;
733
732
const GENERATE_SOURCES = core . getInput ( 'generate-sources' ) ;
@@ -830,36 +829,19 @@ function fetchRosinstallDependencies() {
830
829
function setup ( ) {
831
830
return __awaiter ( this , void 0 , void 0 , function * ( ) {
832
831
try {
833
- yield exec . exec ( "sudo" , [ "apt-key" , "adv" , "--fetch-keys" , "http://packages.osrfoundation.org/gazebo.key" ] ) ;
834
- let aptPackages = [
835
- "zip" ,
836
- "cmake" ,
837
- "lcov" ,
838
- "libgtest-dev" ,
839
- "python3-colcon-common-extensions" ,
840
- "python3-apt" ,
841
- "python3-pip" ,
842
- ( ROS_DISTRO == "foxy" ) ? "python3-rosinstall" : "python-rosinstall" ,
843
- ] ;
844
- if ( ROS_DISTRO != "foxy" ) {
845
- //focal (foxy) does not ship with python2 and does not require python-pip
846
- //using the ros_distro instead of ubuntu_distro saves users from specifying another
847
- //essentially redundant parameter.
848
- aptPackages = aptPackages . concat ( [ "python-pip" ] ) ;
832
+ if ( ! fs . existsSync ( "/etc/timezone" ) ) {
833
+ //default to US Pacific if timezone is not set.
834
+ const timezone = "US/Pacific" ;
835
+ yield exec . exec ( "bash" , [ "-c" , `ln -snf /usr/share/zoneinfo/${ timezone } /etc/localtime` ] ) ;
836
+ yield exec . exec ( "bash" , [ "-c" , `echo ${ timezone } > /etc/timezone` ] ) ;
849
837
}
850
- const python3Packages = [
851
- "setuptools" ,
852
- "colcon-bundle" ,
853
- "colcon-ros-bundle"
854
- ] ;
855
- yield exec . exec ( "sudo" , [ "apt-get" , "update" ] ) ;
856
- yield exec . exec ( "sudo" , [ "apt-get" , "install" , "-y" ] . concat ( aptPackages ) ) ;
857
- yield exec . exec ( "sudo" , [ "pip3" , "install" , "-U" ] . concat ( python3Packages ) ) ;
858
- yield exec . exec ( "rosdep" , [ "update" ] ) ;
859
- yield loadROSEnvVariables ( ) ;
838
+ yield exec . exec ( "bash" , [ "-c" , `scripts/setup.sh --install-ros ${ ROS_DISTRO } ` ] ) ;
839
+ loadROSEnvVariables ( ) ;
840
+ yield exec . exec ( "apt-get" , [ "update" ] ) ;
841
+ //zip required for prepare_sources step.
842
+ yield exec . exec ( "apt-get" , [ "install" , "-y" , "zip" ] ) ;
860
843
SAMPLE_APP_VERSION = yield getSampleAppVersion ( ) ;
861
844
console . log ( `Sample App version found to be: ${ SAMPLE_APP_VERSION } ` ) ;
862
- // Update PACKAGES_TO_SKIP_TESTS with the new packages added by 'rosws update'.
863
845
let packages = yield fetchRosinstallDependencies ( ) ;
864
846
PACKAGES = packages . join ( " " ) ;
865
847
}
@@ -868,29 +850,6 @@ function setup() {
868
850
}
869
851
} ) ;
870
852
}
871
- function setup_gazebo_source ( ) {
872
- return __awaiter ( this , void 0 , void 0 , function * ( ) {
873
- try {
874
- const gazebo_apt_file = "/etc/apt/sources.list.d/gazebo-stable.list" ;
875
- yield exec . exec ( "sudo" , [ "rm" , "-f" , gazebo_apt_file ] ) ;
876
- yield exec . exec ( "bash" , [ "-c" , `echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable \`lsb_release -cs\` main" | sudo tee ${ gazebo_apt_file } ` ] ) ;
877
- yield exec . exec ( "sudo" , [ "apt-get" , "update" ] ) ;
878
- if ( ROS_DISTRO == "kinetic" ) {
879
- const gazebo9_rosdep_file = "/etc/ros/rosdep/sources.list.d/00-gazebo9.list" ;
880
- yield exec . exec ( "sudo" , [ "rm" , "-f" , gazebo9_rosdep_file ] ) ;
881
- yield exec . exec ( "bash" , [ "-c" , `echo "yaml https://github.com/osrf/osrf-rosdep/raw/master/gazebo9/gazebo.yaml" | sudo tee -a ${ gazebo9_rosdep_file } ` ] ) ;
882
- yield exec . exec ( "bash" , [ "-c" , `echo "yaml https://github.com/osrf/osrf-rosdep/raw/master/gazebo9/releases/indigo.yaml indigo" | sudo tee -a ${ gazebo9_rosdep_file } ` ] ) ;
883
- yield exec . exec ( "bash" , [ "-c" , `echo "yaml https://github.com/osrf/osrf-rosdep/raw/master/gazebo9/releases/jade.yaml jade" | sudo tee -a ${ gazebo9_rosdep_file } ` ] ) ;
884
- yield exec . exec ( "bash" , [ "-c" , `echo "yaml https://github.com/osrf/osrf-rosdep/raw/master/gazebo9/releases/kinetic.yaml kinetic" | sudo tee -a ${ gazebo9_rosdep_file } ` ] ) ;
885
- yield exec . exec ( "bash" , [ "-c" , `echo "yaml https://github.com/osrf/osrf-rosdep/raw/master/gazebo9/releases/lunar.yaml lunar" | sudo tee -a ${ gazebo9_rosdep_file } ` ] ) ;
886
- yield exec . exec ( "rosdep" , [ "update" ] ) ;
887
- }
888
- }
889
- catch ( error ) {
890
- core . setFailed ( error . message ) ;
891
- }
892
- } ) ;
893
- }
894
853
function prepare_sources ( ) {
895
854
return __awaiter ( this , void 0 , void 0 , function * ( ) {
896
855
try {
@@ -914,8 +873,6 @@ function prepare_sources() {
914
873
function build ( ) {
915
874
return __awaiter ( this , void 0 , void 0 , function * ( ) {
916
875
try {
917
- yield exec . exec ( "rosdep" , [ "install" , "--from-paths" , "." , "--ignore-src" , "-r" , "-y" , "--rosdistro" , ROS_DISTRO ] , getWorkingDirExecOptions ( ) ) ;
918
- console . log ( `Building the following packages: ${ PACKAGES } ` ) ;
919
876
yield exec . exec ( "colcon" , [ "build" , "--build-base" , "build" , "--install-base" , "install" ] , getWorkingDirExecOptions ( ) ) ;
920
877
}
921
878
catch ( error ) {
@@ -951,7 +908,6 @@ function bundle() {
951
908
function run ( ) {
952
909
return __awaiter ( this , void 0 , void 0 , function * ( ) {
953
910
console . log ( `ROS_DISTRO: ${ ROS_DISTRO } ` ) ;
954
- console . log ( `GAZEBO_VERSION: ${ GAZEBO_VERSION } ` ) ;
955
911
console . log ( `WORKSPACE_DIRECTORY: ${ WORKSPACE_DIRECTORY } ` ) ;
956
912
console . log ( `GENERATE_SOURCES: ${ GENERATE_SOURCES } ` ) ;
957
913
console . log ( `COLCON_BUNDLE_RETRIES: ${ COLCON_BUNDLE_RETRIES } ` ) ;
@@ -960,34 +916,12 @@ function run() {
960
916
core . setFailed ( `Invalid number of colcon bundle retries. Must be between 0-9 inclusive` ) ;
961
917
}
962
918
yield setup ( ) ;
963
- if ( ROS_DISTRO == "kinetic" && ( GAZEBO_VERSION == "" || GAZEBO_VERSION == "7" ) ) {
964
- GAZEBO_VERSION = "7" ;
965
- }
966
- else if ( ROS_DISTRO == "kinetic" && GAZEBO_VERSION == "9" ) {
967
- yield setup_gazebo_source ( ) ;
968
- }
969
- else if ( ROS_DISTRO == "melodic" && ( GAZEBO_VERSION == "" || GAZEBO_VERSION == "9" ) ) {
970
- GAZEBO_VERSION = "9" ;
971
- yield setup_gazebo_source ( ) ;
972
- }
973
- else if ( ROS_DISTRO == "dashing" && ( GAZEBO_VERSION == "" || GAZEBO_VERSION == "9" ) ) {
974
- GAZEBO_VERSION = "9" ;
975
- yield setup_gazebo_source ( ) ;
976
- }
977
- else if ( ROS_DISTRO == "foxy" && ( GAZEBO_VERSION == "" || GAZEBO_VERSION == "11" ) ) {
978
- GAZEBO_VERSION = "11" ;
979
- yield setup_gazebo_source ( ) ;
980
- }
981
- else {
982
- core . setFailed ( `Invalid ROS and Gazebo combination` ) ;
983
- }
984
919
if ( GENERATE_SOURCES == 'true' ) {
985
920
yield prepare_sources ( ) ;
986
921
}
987
922
yield build ( ) ;
988
923
yield bundle ( ) ;
989
924
core . setOutput ( 'ros-distro' , ROS_DISTRO ) ;
990
- core . setOutput ( 'gazebo-version' , "gazebo" + GAZEBO_VERSION ) ;
991
925
core . setOutput ( 'sample-app-version' , SAMPLE_APP_VERSION ) ;
992
926
} ) ;
993
927
}
0 commit comments