CrossTheRoadElec / Phoenix-api

CTRE Phoenix language API (targets FIRST Robotics Competition, Linux, RaspPi, Windows)
Other
39 stars 28 forks source link

Add maven publishing and library version to gradle #5

Closed JaciBrunning closed 6 years ago

JaciBrunning commented 6 years ago

Per the title.
Repo location is build/repo, although you can change this depending on your prod setup.
Version is now set in properties.gradle, zip a release with ./gradlew build zipRelease (releases located at build/releases).
Publish to maven with ./gradlew publish.

Maven group is com.ctre.phoenix (following java package convention), names are CTRE-phoenix-java and CTRE-phoenix-cpp. Java has jar, sources, javadoc and native artifacts. Cpp has binary and header artifacts.

ozrien commented 6 years ago

I'm a complete noob at maven. How do we best test this? I think we need an exact procedure, I don't know enough about how to leverage maven. If the answer is we just need to learn it, it could be a while.

JaciBrunning commented 6 years ago

If you run ./gradlew publishToMavenLocal, it will publish artifacts to ~/.m2. If you have a secondary gradle project that adds phoenix as a dependency from the local maven, you can verify that it works, whether by checking if the artifacts are published or going an extra step to unzip the artifacts to verify the contents are proper. This can be automated in another gradle script fairly easily using the mavenLocal() repository and the artifact paths above just like with any other dependency

ozrien commented 6 years ago

Closing PR, this is getting accomplished separately as part of a larger task: updating our build-server for 2019 (which includes maven-publishing).