import org.apache.tools.ant.taskdefs.condition.Os if (project.hasProperty('makeSim')){ //cmake wrapper tasks task setupCmake(type: Exec) { workingDir '..' commandLine 'mkdir', '-p', 'build' } task cmake(type: Exec, dependsOn: setupCmake) { workingDir '../build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine '../configure.bat', "-DNTCORE_INCLUDE_DIR=$netTablesInclude","-DNTCORE_LIBDIR=$netLibDesktopLocation" } else { commandLine 'cmake', '..', "-DNTCORE_INCLUDE_DIR=$netTablesInclude","-DNTCORE_LIBDIR=$netLibDesktopLocation" } } task frc_gazebo_plugins(type: Exec, dependsOn: cmake) { workingDir '../build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { comanndLine 'nmake', 'frc_gazebo_plugins' } else { commandLine 'make', 'frc_gazebo_plugins' } } task gz_msgs(type: Exec, dependsOn: cmake) { workingDir '../build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine 'nmake', 'gz_msgs' } else { commandLine 'make', 'gz_msgs' } } task wpilibcSim(type: Exec, dependsOn: ['cmake', ':unzipNetworkTables']) { workingDir '../build' if (Os.isFamily(Os.FAMILY_WINDOWS)) { commandLine 'nmake', 'wpilibcSim' } else { commandLine 'make', 'wpilibcSim' } } task allcsim(dependsOn: [wpilibcSim, gz_msgs, frc_gazebo_plugins]){ } build.dependsOn allcsim }