Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Project Build Inquiries (http://www.chiefdelphi.com/forums/showthread.php?t=148667)

AMendenhall 26-05-2016 22:59

Project Build Inquiries
 
Hi whoever is still active.

Recently I've been digging around the nitty gritty files of FRC projects, so here's some questions I have after doing some exploring (concerning mainly build.xml) WARNING: it gets rambly.

Code:

${user.home}/wpilib/wpilib.properties
I'm assuming the ${} syntax is standard for xml. A quick search says that it's a substitution variable. What other interesting things can you do with that besides go to the current user's folder? On which OSs?

Inside wpilib.properties, there's this line:
Code:

#Don't add new properties, they will be deleted by the eclipse plugin.
version=current
team-number=3925

What language is that? What other things can you do with the .properties filetype? It says you shouldn't edit it. What code is automatically changing it? Could you set up a thing in eclipse or other to automatically ask what team number you want to configure it to instead of having to go to Window->Preferences? Like the run recent button? I mean, robotBuilder has the crane, so why not a team number chooser? Also, how does robotBuilder do that? And FX?

In build.properties
Code:

robot.class=${package}.Robot
userLibs=${user.home}/navx-mxp/java/lib/navx_frc.jar

That's to include the NavX libraries. Why don't you need to do that for WPILib.jar or NetworkTables.jar? Also, there's the ${} notation.

Back in build.xml
Code:

<property file="${user.home}/wpilib/java/${version}/ant/build.properties"/>
More ${}. What is ant? There's ant-classloadertask, ant-contrib. What do those do?

In ...ant/build.properties
Code:

username=lvuser
password=
deploy.dir=/home/lvuser
deploy.kill.command=. /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r
debug.flag.dir=/tmp/
debug.flag.command=chown lvuser:ni ${debug.flag.dir}frcdebug
command.dir=/home/lvuser/
version=current
roboRIOJRE.dir=/usr/local/frc/JRE

Could you boot code to the other account on the RIO? It's got username and password. Is deploy.dir (/home/lvuser) a location on the RIO? It seems like it. What's the deploy.kill.command? Are the -t -r command line arguments? I'd assume the /usr/local/frc/bin/frcKillRobot.sh is also on the RIO. Given debug.flag.dir=/tmp/, could you SSH the RIO to look at that and is it a debug log? Questions for every line in that file.

Anyway, if anyone can answer any of those questions, I'd appreciate it. If you have any other questions about the nitty gritty of FRC Java projects, here's the thread to post 'em. Thanks!

euhlmann 27-05-2016 09:45

Re: Project Build Inquiries
 
build.xml and *.properties are part of the Apache ant build system.. This is like a scripting language for building binaries and deploying them. WPILib uses Ant for deploying code to the robot, primarily.

build.properties is where the variables for the script are stored. build.xml contains the actual script. The reason to separate out variables is so that they can conveniently be in one place, and easily configurable.

In theory, you shouldn't touch things in <user profile>\wpilib (such as wpilib.properties) because the WPILib eclipse plugin overwrites them when you start eclipse (or, I assume, when you change WPILib plugin settings).

The ${} notation is special Ant notation that inserts the specified variable from build.properties into the attribute.

slibert 27-05-2016 13:05

Re: Project Build Inquiries
 
Quote:

Originally Posted by AMendenhall (Post 1589832)

In build.properties
Code:

robot.class=${package}.Robot
userLibs=${user.home}/navx-mxp/java/lib/navx_frc.jar

That's to include the NavX libraries. Why don't you need to do that for WPILib.jar or NetworkTables.jar? Also, there's the ${} notation.

WPILib.jar and NetworkTables.jar are included directly within the "WPI Build properties" (build.properties file located at C:\Users\<yourloginname>\wpilib\java\current\ant). Since this build.properties file is installed automatically by the WPI Library plugins, and since WPILib and NetworkTables are part of the WPI Library, these two libraries are handled for you. Users are not expected to edit this file.

navx_frc.jar is from a third party (Kauai Labs) and isn't included directly in the WPI Library, which is why its necessary to modify your project's "Project Build properties" (build.properties) file. The WPI Library has added a variable named userLibs to allow a third party to add libraries to the list of libraries used by your robot application. The ${userLibs} notation is what allows your "Project Build properties" to access that variable.


All times are GMT -5. The time now is 10:39.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi