Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Gradle build properties

Christian W edited this page Dec 3, 2016 · 4 revisions

gradle.properties

The gradle.properties file is a way to specify options to a Gradle build. It's documented here. The following are the contents of Christian's ~/.gradle/gradle.properties file as of 2016-12-02, along with an explanation of what the properties do.

# For tests annotated with NeedsCdmUnitTest
systemProp.unidata.testdata.path=/Users/cwardgar/dev/data
# For tests annotated with NeedsContentRoot
systemProp.tds.content.root.path=/Users/cwardgar/dev/projects/thredds2/tds/src/test/content
# For Dennis's thredds.server.reify.TestDownload
systemProp.tds.download.dir=/tmp/download

# Location of NetCDF-4 C library
systemProp.jna.library.path=/opt/netcdf-4.4.1/lib

# For signing Web Start jars and syncing them to our web server.
# "/web" is on www.unidata.ucar.edu
keystore=PRIVATE
keystoreAlias=PRIVATE
keystorePassword=PRIVATE
webdir=/Volumes/web/content/software/thredds/v4.6/netcdf-java

# Publishing
nexus.username=PRIVATE
nexus.password=PRIVATE

# For https://coveralls.io/github/Unidata/thredds
coveralls.repo.token=PRIVATE

# For https://sonarqube.com/dashboard/index/thredds
sonarqube.user.token=PRIVATE

All PRIVATE values can be found on the UCAR wiki.

Testing

  • systemProp.unidata.testdata.path: sets the unidata.testdata.path system property, for use by tests annotated with NeedsCdmUnitTest. You should comment this one out unless you have a local copy of our test data like I do.
  • systemProp.tds.content.root.path: sets the tds.content.root.path system property, for use by tests annotated with NeedsContentRoot. All of the catalogs that we need for our tests already exist in the repo at tds/src/test/content. However, I believe the path needs to be absolute (e.g. /Users/cwardgar/dev/projects/thredds2/tds/src/test/content), so modify as needed.
  • systemProp.tds.download.dir: sets the tds.download.dir system property, which is used by Dennis's thredds.server.reify.TestDownload

NetCDF-4 C Library Loading

  • systemProp.jna.library.path: sets the jna.library.path system property, which points to the directory in which libnetcdf is installed.

Web start jar signing

Java Web Start requires that jars be signed, so that clients can verify that those artifacts came from the expected source and have not been tampered with. We use the following properties in :ui:releaseWebstart for signing:

  • keystore: location of the Unidata keystore database, which contains the key pair and certificate that we use to sign jars.
  • keystoreAlias: identifies the key pair and certificate within the keystore that we're signing with.
  • keystorePassword: the password that protects the keystore.

Artifact deployment

webdir is the network directory to which Web Start artifacts are deployed (in :ui:releaseWebstart) and to which Javadoc artifacts are deployed (in :cdm:releaseDocs and :ui:releaseDocs). The complete path is www.unidata.ucar.edu:/web/content/software/thredds/v${release.major}/netcdf-java/, where ${release.major} refers to the truncated, 2-part version string (e.g. 4.6). You'll need to mount www.unidata.ucar.edu:/web/ to some directory on your file system. For example, on OSX I've mounted it to /Volumes/web/, which results in webdir=/Volumes/web/content/software/thredds/v4.6/netcdf-java.

Maven publication

nexus.username and nexus.password are the login credentials to the Unidata Nexus server. The :publish task needs those values in order to deploy Maven artifacts to the Releases and Snapshots repositories.

Coveralls

coveralls.repo.token is the access token associated with our Coveralls code coverage report. It is used by the :coveralls task to upload new metrics after unit tests are run.

SonarQube

sonarqube.user.token is the access token associated with our SonarQube static analysis report. It is used by the :sonarqube task to upload new metrics.

Command-line

All of the above properties can be set on the command-line, instead of in gradle.properties. In fact, that is what we do on Jenkins. You can see it in the "Build->Switches" section of the thredds5.0 configuration page.