Define lphy extension conventions and share the build logic.
The released versions are available in the Maven Central Repository: https://search.maven.org/artifact/io.github.linguaphylo/platforms.
Use Java 17 and overwrite java related tasks to use module-path.
plugins {
id("io.github.linguaphylo.lphy-java") version "0.1.2"
}
- Constrain to Java 17 or higher, and overwrite java related tasks to use module-path.
- Configure
compileJava
task to use module-path to compile classes; - Configure
javadoc
task to use html5 which solves the issue using >= Java 9, and also turn off warnings.
Configure the repositories for maven publishing and proceed signing.
plugins {
id("io.github.linguaphylo.lphy-publish") version "0.1.2"
}
- Configure publishing repositories;
If there are OSSRH properties provided, then publish to the Maven releases repository if version does not end with "SNAPSHOT", otherwise publish to the Maven snapshots repository. If no OSSRH properties, then publish to the local folder "releases" under the build directory.
- Signing the publications defined in the project, if there are signing properties provided.
Then, use the following command to publish, where -P
defines the Gradle properties,
and where the backslash is used to break lines :
./gradlew clean
./gradlew publish \
-Psigning.secretKeyRingFile=/path/to/mysecr.gpg \
-Psigning.password=mypswd -Psigning.keyId=last8chars \
-Possrh.user=myuser -Possrh.pswd=mypswd
The first three properties for signing by GPG. The last two are used to login your JIRA account in Sonatype.
See also lphy developer's note.