|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Adding a custom library to Robot Code? (Java)
Hello all,
So we've written a library containing some basic items that we've used from year to year. However, I'm stuck trying to figure out how to add it to the actual robot code. I don't want to add all of the files into the project itself, but, unlike with vanilla NetBeans projects, the robot project doesn't have the feature to add libraries. Could anyone give any suggestions as to how to go about doing so?Thanks so much! |
|
#2
|
|||
|
|||
|
If you bundle it with the wpilibj source, you should be able to compile it and set it as the wpilibj file for your robot in the settings within net beans.
|
|
#3
|
|||
|
|||
|
Re: Adding a custom library to Robot Code? (Java)
Go into the build.xml file and add something along the lines of the following code:
Code:
<exec executable="rm">
<arg value="-rf" />
<arg value="/path/to/robot/project/src/LibraryName" />
</exec>
<exec executable="cp">
<arg value="-R" />
<arg value="/path/to/library/src/org" />
<arg value="src/" />
</exec>
|
|
#4
|
|||
|
|||
|
Re: Adding a custom library to Robot Code? (Java)
Thanks this is exactly what I needed!
|
|
#5
|
||||
|
||||
|
Remember that you'd need to post it publicly before build season for it to be used legally - that one almost got us this year. Good luck!
|
|
#6
|
|||
|
|||
|
Re: Adding a custom library to Robot Code? (Java)
If you can, I'd recommend using GitHub -- not only does it solve the releasing part (as you'd be open-sourcing it), but if you use Git during the year, you learn valuable skills widely used in industry.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|