Files
allwpilib/wpilibc/simulation.gradle
Peter_Mitrano acc7fbbf01 finishing up FRCSim installer
adds build of gz_msgs on end-user computer
This means we don't need to provide different zips for different
versions of ubuntu.
The problem was that gazebo on 14.04 comes with protobuf 2.5 but gazebo on 15.10 comes with 2.6
added a few other fixes to the install script as well

also fix dependency between simluation publishing and libwpilibcsim
building

Change-Id: I57d5a26ed7795bc61a25402e2986c6023d1d78ac
2015-12-29 13:48:59 -05:00

97 lines
2.6 KiB
Groovy

import org.apache.tools.ant.taskdefs.condition.Os
//cmake wrapper tasks
task setupCmake(type: Exec) {
description = 'create build directory for cmake to use'
group = 'WPILib Simulation'
workingDir '..'
commandLine 'mkdir', '-p', 'build'
}
task cmake(type: Exec, dependsOn: setupCmake) {
description = 'run cmake in the build directory to generate makefiles'
group = 'WPILib Simulation'
workingDir '../build'
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine '../configure.bat',
"-DNTCORE_INCLUDE_DIR=$netTablesInclude",
"-DNTCORE_LIBDIR=$netLibDesktopLocation",
"-DSIMULATION_INSTALL_DIR=$simulationInstallDir"
}
else {
commandLine 'cmake', '..',
"-DNTCORE_INCLUDE_DIR=$netTablesInclude",
"-DNTCORE_LIBDIR=$netLibDesktopLocation",
"-DSIMULATION_INSTALL_DIR=$simulationInstallDir"
}
}
task frc_gazebo_plugins(type: Exec, dependsOn: cmake) {
description = 'build Gazebo plugins with cmake'
group = 'WPILib Simulation'
workingDir '../build'
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'nmake', 'frc_gazebo_plugins'
}
else {
commandLine 'make', 'frc_gazebo_plugins'
}
}
task gz_msgs(type: Exec, dependsOn: cmake) {
description = 'build gz_msgs library with cmake'
group = 'WPILib Simulation'
workingDir '../build'
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'nmake', 'gz_msgs'
}
else {
commandLine 'make', 'gz_msgs'
}
}
task wpilibcSim(type: Exec, dependsOn: ['cmake', ':unzipNetworkTables']) {
description = 'build WPILib C++ for simulation with cmake'
group = 'WPILib Simulation'
workingDir '../build'
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'nmake', 'wpilibcSim'
}
else {
commandLine 'make', 'wpilibcSim'
}
}
task allcsim(dependsOn: [wpilibcSim, gz_msgs, frc_gazebo_plugins]){
description = 'wrapper task to build all c++ simulation tasks'
group = 'WPILib Simulation'
}
task wpilibcSimCopy(type: Copy, dependsOn: allcsim) {
description = 'copy headers and ntcore library to make simulation zip'
group = 'WPILib Simulation'
into "$simulationInstallDir"
from ("$netTablesInclude"){
into "include"
}
from ("../hal/include"){
into "include"
}
from ("simulation/include"){
into "include"
}
from ("shared/include"){
into "include"
}
from ("$netLibDesktopLocation/libntcore.so") {
into "lib"
}
}
build.dependsOn allcsim