Skip to content

Gradle tasks

Cezary Kluczyński edited this page Mar 26, 2023 · 9 revisions

This page lists custom Gradle tasks, or tasks which usage is hard to remember.

codeGen

Task for generating scaffold code. After running the task, code will not compile and has to be corrected by hand, but some time could be saved this way. Two following parameters can be passed:

  • -PsourceEntityName - entity from which files will be copied.
  • -PtargetEntityName - entity to create.
  • -PscaffoldType (optional) - type of code to copy. Could be endpoint or etl. Default to endpoint.

Example usage:

gradle -PsourceEntityName=Comics -PtargetEntityName=ComicStrip -PscaffoldType=endpoint codeGen

dockerize

Task that create docker image of a given version locally. Syntax:

./gradlew server:dockerize --version=2022-12

After that, a docker push is required (with right privileges of course):

docker push cezarykluczynski/stapi:2022-12
docker push cezarykluczynski/stapi:latest

publish

This is more of a note to myself (@cezarykluczynski) on how to publish Java clients.

GPG keys expire every two years, so a new key could be needed:

gpg --gen-key

Get KEY_ID:

gpg --list-keys

Publish key:

# gpg --keyserver keyserver.ubuntu.com --send-keys KEY_ID_HERE

Generate secring.gpg:

gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg

Have ~/.gradle/gradle.properties with the following content:

ossrhUsername=cezary.kluczynski
ossrhPassword=PASSWORD
signing.keyId=LAST_8_CHARS_OF_KEY_ID
signing.password=GPG_KEY_PASSPHRASE
signing.secretKeyRingFile=FULL_PATH_TO_SECRING

Run gradle task:

gradle :client:clean publish

Go to https://oss.sonatype.org/ using ossrhUsername and ossrhPassword, to the Staging Repositories section, and refresh.

Pick the repository with gradle-nexus-publish-plugin/1.x.x user-agent, drop others. Make sure new client version is there in content tab.

Click "Close" on top. Wait for evaluation to finish. Click "Release" on top.

In case of troubles, follow this guide.

Clone this wiki locally