-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Team612/dev-windows
Dev windows
- Loading branch information
Showing
9 changed files
with
261 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ FRCUserProgram | |
|
||
#CTRE | ||
CTRE/ | ||
|
||
#Other binaries | ||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
all: | ||
start batch\build.bat | ||
|
||
deploy: | ||
start batch\deploy.bat | ||
|
||
update: | ||
del CTRE /Q | ||
del wpilib /Q | ||
start batch\.get-ctre.bat | ||
start batch\.wpilib-download.bat | ||
|
||
clean: | ||
del .build\cmake_install.cmake .build\CMakeCache.txt .build\FRCUserProgram .build\Makefile /Q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@echo off | ||
|
||
REM Doesn't actually download compiler because on windows its a nice installer already. | ||
|
||
for %%x in (arm-frc-linux-gnueabi-g++.exe) do (SET FOUND=%%~$PATH:x) | ||
if defined FOUND ( | ||
ECHO ^.compiler-download.bat: Valid FRC Compiler found in PATH! | ||
GOTO end | ||
) else ( | ||
GOTO no-compiler | ||
) | ||
|
||
:no-compiler | ||
ECHO ^.compiler-download.bat: Valid FRC Compiler not found in PATH! | ||
ECHO ^.compiler-download.bat: Please download the FRC Compiler from: http://first.wpi.edu/FRC/roborio/toolchains/ | ||
ECHO. 1>Error.txt | ||
GOTO end | ||
|
||
ECHO .compiler-download.bat: Exiting... | ||
GOTO end | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@echo off | ||
|
||
ECHO ^.get-ctre^.bat: Downloading CTRE^.^.^. | ||
|
||
if defined ProgramFiles(x86) ( | ||
for %%x in (wget64.exe) do (SET WGET=%%~$PATH:x) | ||
if defined WGET ( | ||
wget64.exe -r -nd --progress=bar http://www.ctr-electronics.com//downloads/lib/CTRE_FRCLibs_NON-WINDOWS.zip | ||
GOTO get-ctre | ||
) else ( | ||
ECHO ^.get-ctre^.bat: Please download wget64 and add it to the PATH | ||
GOTO error | ||
) | ||
) else ( | ||
REM assuming 32 bit | ||
for %%x in (wget.exe) do (SET WGET=%%~$PATH:x) | ||
if defined WGET ( | ||
wget.exe -r -nd --progress=bar http://www.ctr-electronics.com//downloads/lib/CTRE_FRCLibs_NON-WINDOWS.zip | ||
GOTO get-ctre | ||
) else ( | ||
ECHO ^.get-ctre^.bat: Please download wget ^(32 bit^)^. Add it to the PATH | ||
GOTO error | ||
) | ||
) | ||
|
||
REM if there was no error, unzip | ||
REM lol downloading the non-windows even though this is windows | ||
:get-ctre | ||
mkdir ctre_full | ||
CD ctre_full | ||
unzip ..\CTRE_FRCLibs_NON-WINDOWS.zip | ||
ECHO ^.get-ctre^.bat: Cleaning up^.^.^. | ||
CD .. | ||
ECHO D | xcopy ctre_full\cpp CTRE /s/e | ||
rmdir ctre_full\ /S /Q | ||
del CTRE_FRCLibs_NON-WINDOWS^.zip /Q | ||
GOTO end | ||
|
||
:error | ||
ECHO. 1>CTRE^.txt | ||
GOTO end | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@echo off | ||
|
||
REM This scripts downloads the latest version of wpilib. | ||
REM It does not check for the latest version | ||
REM To ensure the installation of the latest version, run nmake -f Makefile.win update | ||
|
||
if defined ProgramFiles(x86) ( | ||
for %%x in (wget64.exe) do (SET WGET=%%~$PATH:x) | ||
if defined WGET ( | ||
wget64.exe http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.cpp_2017.1.1.jar | ||
GOTO wpilib-download | ||
) else ( | ||
ECHO ^.wpilib-download^.bat: Please download wget64^. Add it to the PATH | ||
GOTO error | ||
) | ||
) else ( | ||
REM assuming 32 bit | ||
for %%x in (wget.exe) do (SET WGET=%%~$PATH:x) | ||
if defined WGET ( | ||
wget.exe http://first.wpi.edu/FRC/roborio/release/eclipse/plugins/edu.wpi.first.wpilib.plugins.cpp_2017.1.1.jar | ||
GOTO wpilib-download | ||
) else ( | ||
ECHO ^.wpilib-download.bat: Please download wget ^(32 bit^)^. Add it to the PATH | ||
GOTO error | ||
) | ||
) | ||
|
||
REM if there was no error, unzip | ||
:wpilib-download | ||
mkdir wpilib | ||
CD wpilib | ||
unzip ..\edu.wpi.first.wpilib.plugins.cpp_2017.1.1.jar | ||
rmdir edu /S /Q | ||
rmdir META-INF /S /Q | ||
rmdir plugin.xml /S /Q | ||
unzip resources\cpp.zip | ||
ECHO ^.wpilib-download.bat: Cleaning up... | ||
rmdir resources\ /S /Q | ||
CD .. | ||
del edu.wpi.first.wpilib.plugins.cpp_2017.1.1.jar | ||
GOTO end | ||
|
||
:error | ||
ECHO. 1>wpilib.txt | ||
GOTO end | ||
|
||
:end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
call batch\.compiler-download.bat | ||
|
||
REM Exit if FRC C++ Toolchain not found | ||
if exist Error.txt ( | ||
ECHO batch\build.bat: Compiler not found | ||
ECHO batch\build.bat: Exiting... | ||
del Error.txt /Q | ||
GOTO error | ||
) | ||
|
||
ECHO build.bat: Checking internet... | ||
|
||
Ping www.google.com -n 2 -w 1000 | ||
if errorlevel 1 ( | ||
ECHO build.bat: Offline | ||
) else ( | ||
ECHO build.bat: Online | ||
if not exist CTRE call batch\.get-ctre.bat | ||
if exist CTRE.txt ( | ||
del CTRE.txt /Q | ||
GOTO error | ||
) | ||
if not exist wpilib call batch\.wpilib-download.bat | ||
if exist wpilib.txt ( | ||
del wpilib.txt /Q | ||
GOTO error | ||
) | ||
REM exit early if unable to get required materials | ||
) | ||
|
||
CD .build | ||
|
||
del CMakeCache.txt cmake_install.cmake Makefile | ||
rmdir CMakeFiles\ /S /Q | ||
|
||
ECHO build.bat: Generating Makefiles... | ||
cmake .. -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=arm.cmake -DCMAKE_TOOLCHAIN_FILE=robot.cmake | ||
|
||
nmake | ||
|
||
ECHO build.bat: Deleting CMakeFiles... | ||
rmdir CMakeFiles\ /S /Q | ||
|
||
ECHO build.sh: Re-naming outfile... | ||
if exist FRCUserProgram del FRCUserProgram /Q | ||
move FRC FRCUserProgram | ||
|
||
if exist FRCUserProgram ( | ||
ECHO Build successfully! | ||
CD .. | ||
PAUSE | ||
GOTO end | ||
) else ( | ||
ECHO Build failed! | ||
CD .. | ||
PAUSE | ||
GOTO error | ||
) | ||
|
||
:end | ||
EXIT | ||
|
||
:error | ||
EXIT /b 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
@echo off | ||
|
||
if exist .build\FRCUserProgram ( | ||
ECHO deploy.bat: Deploying robot code... | ||
GOTO checkwinscp | ||
) else ( | ||
ECHO deploy.bat: Valid FRCUserProgram not found! | ||
GOTO noscp | ||
) | ||
|
||
:checkwinscp | ||
for %%x in (winscp.exe) do (SET WINSCP=%%~$PATH:x) | ||
if defined WINSCP GOTO deploy | ||
|
||
:deploy | ||
ECHO Enter roborio ip address | ||
SET /p ADDRESS=Usually roborio-TEAM-frc.local, 10.TE.AM.X, or 172.22.11.2 for Static USB: | ||
winscp lvuser@%ADDRESS% /upload .build\FRCUserProgram | ||
ECHO deploy.bat: deployed successfully! | ||
PAUSE | ||
GOTO end | ||
|
||
:noscp | ||
REM only runs if winscp isn't found in the path | ||
ECHO .deploy.bat: It looks like WinSCP has not been added to your PATH | ||
ECHO .deploy.bat: Deploying to the robot from FRC++ Build Tools requires WinSCP | ||
ECHO .deploy.bat: If you do not have the intention of deploying using WinSCP, simply copy FRCUserProgram in the .build folder to /home/lvuser on the roborio with your method of choice. | ||
GOTO end | ||
|
||
:end | ||
EXIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters