WPILib source code

*I’m almost afraid to ask - in case the answer is embarrassingly obvious… or worse yet the answer is no:

Where can I download the 2016 WPILib C++ and Java source code?

All I want is the source code… not to build with, but just for reference.

I don’t have the bandwidth to download a gigabyte zip file, and I don’t want to “install” anything on my computer… just want the source code.

I know that for Java when you install the WPILib plugins it creates a folder called “wpilib” in your home directory. Inside “wpilib/java/current/lib” you will find WPILib-Sources.jar. You can open that jar file and find the source code. I am not familiar with C++ but its probably also in the wpilib folder.

Thanks, but:

The RobotPy group has a mirror of the repository here:

We have a ScreenSteps page for that: https://wpilib.screenstepslive.com/s/4485/m/wpilib_source/l/480945-getting-the-source. I don’t believe we publish a standalone zip unless you want to go mucking about in maven dependencies, but all our source is in the git repos described in that article.

I spent half an hour yesterday navigating that site, but could not find a way to download the Java or the C++ WPILib source code.

You have to clone it through git. There doesn’t seem to be a way to download it directly from WPI without cloning. However RobotPy’s github clone does have a download zip button, the direct link for which can be found here. https://github.com/robotpy/allwpilib/archive/master.zip

What is unclear? If you let us know what confused you, we can update wordings. As Thad said, however, we don’t offer direct zip downloads. You have to clone the repo, or go to one of the unofficial repos on Github and download from them. While I can’t vouch for how up to date they are (my own clone is several commits behind), I imagine the Python mirror is synced regularly.

The robotpy one is very up to date, it has the commit Brad did about 10 minutes ago.

I am not a github user, so this is unclear:

I don’t know how to “clone the repo”… or what to do after having done that.

Would be glad to learn though, if it’s straightforward.

If you download the eclipse plugin jar from the eclipse repository, you can extract the contents of the jar and all the files are in the resources/java.zip/lib folder (or resources/cpp.zip for C++).

Edit: looks like there’s an online code view here.

That’s what I was looking for. Thanks much.

EDIT: This worked too. Thank you:

*Thank you to all who responded. I think I have what I need now.

If anyone cares to walk me through the process of “clone the repo” I’m always open to learning something new…

Git is a really cool tool for managing source code, there’s a good intro tutorial on GitHub.

Hey Ether,

The RobotPy repo is automatically synchronized (and is a pure mirror – no robotpy specific changes), so it’ll stay up to date. I personally find it much easier to deal with github than collab.netcollab.net is terrible in so many ways, and I’m surprised FIRST is still using it.

To clone any git repo, you need to download+install git. Once you’ve got that taken care of, you go to some directory and from the command line do:


git clone https://github.com/robotpy/allwpilib

Alternatively, if you want to clone the “real” repo from collab.net (it’s going to be slower to access than github)… you can do this:


git clone https://usfirst.collab.net/gerrit/allwpilib

Once you’ve got it cloned, you can cd into the directory, and anytime that you want to update it you can do the following:


git pull

If you want to make code changes, let me know and I can make sure that they get submitted for consideration and eventually committed.

Oops… That’s a showstopper right there. I never install anything on my primary-use computer without first giving it a good wringing-out on my guinea-pig machine - which is presently in use for other purposes.

I will add it to my long list of fun things to look into though :slight_smile:

Sure. Even without git, if you want to make changes and stuff, let me know and we can make it happen.