Files
allwpilib/wpilibc/simulation.gradle
Peter Mitrano e71f454b9d Renamed folders for consistency, using sim/athena/shared schema (#27)
Rename the following folders:
hal/lib/Athena -> hal/lib/athena
hal/lib/Desktop -> hal/lib/sim
hal/lib/Shared -> hal/lib/shared
wpilibc/Athena -> wpilibc/athena
wpilibc/simulation -> wpilibc/sim

Windows users may need to run gradlew clean after updating.
2016-05-22 14:55:51 -07: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 ("sim/include"){
into "include"
}
from ("shared/include"){
into "include"
}
from ("$netLibDesktopLocation/libntcore.so") {
into "lib"
}
}
build.dependsOn allcsim