Added buildfile configuration.

This commit is contained in:
Austen Adler 2015-01-06 08:56:58 -05:00
parent 04f856cd69
commit 90c89e0d6b
3 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ This project uses [Vagrant](https://www.vagrantup.com/) and creates a virtual ma
### Configuration ### Configuration
- Set the roboRIO host in `config/host` - Set the roboRIO host in `config/host`
- Copy your code into `src/` - Copy your code into `src/`
- Set the main file in `config/buildfile`
### Usage ### Usage
Once provisioning completes, log into the machine with `vagrant ssh`. Use the following commands to build and deploy your project: Once provisioning completes, log into the machine with `vagrant ssh`. Use the following commands to build and deploy your project:
@ -24,6 +25,7 @@ If you would like to automate the build process, you can run the following comma
ssh vagrant@127.0.0.1 -p 2222 -i /path/to/frc-cpp-vagrantfile/.vagrant/machines/default/virtualbox/private_key 'build&&deploy' ssh vagrant@127.0.0.1 -p 2222 -i /path/to/frc-cpp-vagrantfile/.vagrant/machines/default/virtualbox/private_key 'build&&deploy'
``` ```
Changing /path/to/frc-cpp-vagrantfile to the path of the frc-cpp-vagrantfile directory. Changing /path/to/frc-cpp-vagrantfile to the path of the frc-cpp-vagrantfile directory.
Run: `while true;do clear;build 2>&1|less;done` in the virtual machine to compile when the you press `q`
### Issues ### Issues
- There is no way to automate updating wpilib - There is no way to automate updating wpilib

View File

@ -8,7 +8,7 @@ add-apt-repository -y ppa:byteit101/frc-toolchain
apt-get update apt-get update
apt-get install -y frc-toolchain apt-get install -y frc-toolchain
# Compiles code in the /vagrant/src folder # Compiles code in the /vagrant/src folder
echo 'echo "Starting build";test -f /vagrant/build/FRCUserProgram&&rm /vagrant/build/FRCUserProgram;arm-frc-linux-gnueabi-g++ -std=c++1y -I/vagrant/wpilib/include "-I/vagrant/src" -O0 -g3 -Wall -c -fmessage-length=0 -o /vagrant/build/Robot.o /vagrant/src/Robot.cpp&&arm-frc-linux-gnueabi-g++ -L/vagrant/wpilib/lib -Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a -o /vagrant/build/FRCUserProgram /vagrant/build/Robot.o -lwpi;rm /vagrant/build/Robot.o;echo "Done"' > /usr/local/bin/build echo "echo 'Starting build';test -f /vagrant/build/FRCUserProgram&&rm /vagrant/build/FRCUserProgram;arm-frc-linux-gnueabi-g++ -std=c++1y -I/vagrant/wpilib/include '-I/vagrant/src' -O0 -g3 -Wall -c -fmessage-length=0 -o /vagrant/build/Robot.o /vagrant/src/\`cat /vagrant/config/buildfile|head -n 1\`&&arm-frc-linux-gnueabi-g++ -L/vagrant/wpilib/lib -Wl,-rpath,/opt/GenICam_v2_3/bin/Linux_armv7-a -o /vagrant/build/FRCUserProgram /vagrant/build/Robot.o -lwpi;rm /vagrant/build/Robot.o;echo 'Done'" > /usr/local/bin/build
# Uploads the code to the rRIO based on /vagrant/config/host file # Uploads the code to the rRIO based on /vagrant/config/host file
echo "cat /vagrant/FRCUserProgram | ssh \`cat /vagrant/config/host|head -n 1\` 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram;/usr/local/frc/bin/frcKillRobot.sh -t -r'||echo 'You probably haven\'t succesfully built yet. Run build to compile the program''" > /usr/local/bin/deploy echo "cat /vagrant/FRCUserProgram | ssh \`cat /vagrant/config/host|head -n 1\` 'cat > /home/lvuser/FRCUserProgram2&&rm /home/lvuser/FRCUserProgram;mv /home/lvuser/FRCUserProgram2 /home/lvuser/FRCUserProgram&&. /etc/profile.d/natinst-path.sh;chmod a+x /home/lvuser/FRCUserProgram;/usr/local/frc/bin/frcKillRobot.sh -t -r'||echo 'You probably haven\'t succesfully built yet. Run build to compile the program''" > /usr/local/bin/deploy
# Creates ssh key if it doesn't exist and cats the public key to the rRIO # Creates ssh key if it doesn't exist and cats the public key to the rRIO

2
config/buildfile Normal file
View File

@ -0,0 +1,2 @@
Zaphod.cpp
The line above should be the path of the main file relative to src. The program will compile /vagrant/src/$FILE where $FILE is the line above. It should include headers that include other files that need to be compiled. The default is Robot.cpp.