@@ -727,7 +727,6 @@ const core = __importStar(__webpack_require__(470));
727727const exec = __importStar ( __webpack_require__ ( 986 ) ) ;
728728const fs = __webpack_require__ ( 747 ) ;
729729const ROS_DISTRO = core . getInput ( 'ros-distro' , { required : true } ) ;
730- let GAZEBO_VERSION = core . getInput ( 'gazebo-version' ) ;
731730let SAMPLE_APP_VERSION = '' ;
732731const WORKSPACE_DIRECTORY = core . getInput ( 'workspace-dir' ) ;
733732const GENERATE_SOURCES = core . getInput ( 'generate-sources' ) ;
@@ -830,36 +829,19 @@ function fetchRosinstallDependencies() {
830829function setup ( ) {
831830 return __awaiter ( this , void 0 , void 0 , function * ( ) {
832831 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` ] ) ;
849837 }
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" ] ) ;
860843 SAMPLE_APP_VERSION = yield getSampleAppVersion ( ) ;
861844 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'.
863845 let packages = yield fetchRosinstallDependencies ( ) ;
864846 PACKAGES = packages . join ( " " ) ;
865847 }
@@ -868,29 +850,6 @@ function setup() {
868850 }
869851 } ) ;
870852}
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- }
894853function prepare_sources ( ) {
895854 return __awaiter ( this , void 0 , void 0 , function * ( ) {
896855 try {
@@ -914,8 +873,6 @@ function prepare_sources() {
914873function build ( ) {
915874 return __awaiter ( this , void 0 , void 0 , function * ( ) {
916875 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 } ` ) ;
919876 yield exec . exec ( "colcon" , [ "build" , "--build-base" , "build" , "--install-base" , "install" ] , getWorkingDirExecOptions ( ) ) ;
920877 }
921878 catch ( error ) {
@@ -951,7 +908,6 @@ function bundle() {
951908function run ( ) {
952909 return __awaiter ( this , void 0 , void 0 , function * ( ) {
953910 console . log ( `ROS_DISTRO: ${ ROS_DISTRO } ` ) ;
954- console . log ( `GAZEBO_VERSION: ${ GAZEBO_VERSION } ` ) ;
955911 console . log ( `WORKSPACE_DIRECTORY: ${ WORKSPACE_DIRECTORY } ` ) ;
956912 console . log ( `GENERATE_SOURCES: ${ GENERATE_SOURCES } ` ) ;
957913 console . log ( `COLCON_BUNDLE_RETRIES: ${ COLCON_BUNDLE_RETRIES } ` ) ;
@@ -960,34 +916,12 @@ function run() {
960916 core . setFailed ( `Invalid number of colcon bundle retries. Must be between 0-9 inclusive` ) ;
961917 }
962918 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- }
984919 if ( GENERATE_SOURCES == 'true' ) {
985920 yield prepare_sources ( ) ;
986921 }
987922 yield build ( ) ;
988923 yield bundle ( ) ;
989924 core . setOutput ( 'ros-distro' , ROS_DISTRO ) ;
990- core . setOutput ( 'gazebo-version' , "gazebo" + GAZEBO_VERSION ) ;
991925 core . setOutput ( 'sample-app-version' , SAMPLE_APP_VERSION ) ;
992926 } ) ;
993927}
0 commit comments