Go to Post I'm impressed and incredibly amused that you found so many of Dave's evildoings, though granted, they aren't that hard to search out. - DCA Fan [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-07-2014, 02:00
Tiernoez Tiernoez is offline
Registered User
FRC #1072 (Harker Robotics)
Team Role: Programmer
 
Join Date: May 2014
Rookie Year: 2014
Location: San Jose, CA
Posts: 3
Tiernoez is an unknown quantity at this point
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!
Reply With Quote
  #2   Spotlight this post!  
Unread 06-07-2014, 15:27
Nxmq99 Nxmq99 is offline
Registered User
AKA: Nico Machado
FRC #4322 (Clockwork Oranges)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: California
Posts: 6
Nxmq99 is an unknown quantity at this point
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.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-07-2014, 19:06
jamestautges jamestautges is offline
Registered User
FRC #1306 (Badgerbots)
Team Role: Programmer
 
Join Date: Nov 2013
Rookie Year: 2012
Location: Madison, WI
Posts: 4
jamestautges is an unknown quantity at this point
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>
This copies the library to the robot project's src directory which makes it available during the build. The rm makes sure that the directory is updated every build, in case the library has changed. If you're using windows, you'll have to change the command names, but this should work on any Unix system.
Reply With Quote
  #4   Spotlight this post!  
Unread 07-07-2014, 02:35
Tiernoez Tiernoez is offline
Registered User
FRC #1072 (Harker Robotics)
Team Role: Programmer
 
Join Date: May 2014
Rookie Year: 2014
Location: San Jose, CA
Posts: 3
Tiernoez is an unknown quantity at this point
Re: Adding a custom library to Robot Code? (Java)

Thanks this is exactly what I needed!
Reply With Quote
  #5   Spotlight this post!  
Unread 14-07-2014, 22:26
Jacob Bendicksen's Avatar
Jacob Bendicksen Jacob Bendicksen is offline
Figuring out what's next
no team
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2012
Location: United States
Posts: 762
Jacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond reputeJacob Bendicksen has a reputation beyond repute
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!
__________________
jacobbendicksen.com | @jacobbendicksen

Yale University Class of 2020

Team 1540 | 2012-2016
7 Chairman's Awards, 6 other awards, 2015 Dean's List Finalist, 1 event win, 2 finalist finishes. Thanks for an amazing ride.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-07-2014, 07:44
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Adding a custom library to Robot Code? (Java)

Quote:
Originally Posted by TheCascadeKid View Post
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!
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.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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