Files
allwpilib/wpilibc/simulation.gradle
Peter_Mitrano 17b363f3b4 working on install process for FRCSim 2016
To publish the simulation zip, run ./gradlew publish -PmakeSim

Targeting Ubuntu 14.04 and 15.10 for now, with 14.04 being the
currently best supported.
Two scripts have been drafted for installing, for 14.04 and 15.10
It currently publishes to ~/releases/maven/development/simulation

There is a known bug that gz_msgs for 15.10 must be built using
protobuf 2.6, which is not the default on 14.04.

Change-Id: I6cccd601671553d30fd05bbbc79c2b7dc1efbf1d
2015-12-28 16:42:24 -05:00

97 lines
2.5 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) {
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