sop-java/sop-java-picocli/build.gradle

74 lines
2.1 KiB
Groovy
Raw Normal View History

2022-01-11 13:46:05 +01:00
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
plugins {
id 'application'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
2022-01-11 13:46:05 +01:00
}
dependencies {
2022-04-26 00:33:20 +02:00
// JUnit
2022-01-11 13:46:05 +01:00
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
// Testing Exit Codes in JUnit
2022-01-11 13:46:05 +01:00
// https://todd.ginsberg.com/post/testing-system-exit/
testImplementation "com.ginsberg:junit5-system-exit:$junitSysExitVersion"
2022-04-26 00:33:20 +02:00
// Mocking Components
testImplementation "org.mockito:mockito-core:$mockitoVersion"
2022-01-11 13:46:05 +01:00
2022-04-26 00:34:29 +02:00
// SOP
2022-01-11 13:46:05 +01:00
implementation(project(":sop-java"))
2022-04-26 00:34:29 +02:00
// CLI
implementation "info.picocli:picocli:$picocliVersion"
2022-07-27 21:40:24 +02:00
annotationProcessor "info.picocli:picocli-codegen:$picocliVersion"
2022-04-26 00:34:48 +02:00
// @Nonnull, @Nullable...
implementation "com.google.code.findbugs:jsr305:$jsrVersion"
2022-01-11 13:46:05 +01:00
}
mainClassName = 'sop.cli.picocli.SopCLI'
application {
mainClass = mainClassName
}
2022-01-11 13:46:05 +01:00
jar {
dependsOn(":sop-java:jar")
2022-01-11 13:46:05 +01:00
manifest {
attributes 'Main-Class': "$mainClassName"
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
}
2022-07-27 21:40:24 +02:00
task generateManpageAsciiDoc(type: JavaExec) {
dependsOn(classes)
group = "Documentation"
description = "Generate AsciiDoc manpage"
classpath(configurations.annotationProcessor, sourceSets.main.runtimeClasspath)
systemProperty("user.language", "en")
main 'picocli.codegen.docgen.manpage.ManPageGenerator'
args mainClassName, "--outdir=${project.buildDir}/generated-picocli-docs", "-v" //, "--template-dir=src/docs/mantemplates"
}
apply plugin: 'org.asciidoctor.jvm.convert'
asciidoctor {
dependsOn(generateManpageAsciiDoc)
sourceDir = file("${project.buildDir}/generated-picocli-docs")
outputDir = file("${project.buildDir}/docs")
logDocuments = true
outputOptions {
backends = ['manpage', 'html5']
}
}