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'
|
2022-07-27 21:40:24 +02:00
|
|
|
id 'org.asciidoctor.jvm.convert' version '3.1.0'
|
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"
|
|
|
|
|
2022-04-26 00:32:03 +02:00
|
|
|
// Testing Exit Codes in JUnit
|
2022-01-11 13:46:05 +01:00
|
|
|
// https://todd.ginsberg.com/post/testing-system-exit/
|
2022-04-26 00:32:03 +02:00
|
|
|
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'
|
|
|
|
|
2022-04-11 12:12:19 +02:00
|
|
|
application {
|
|
|
|
mainClass = mainClassName
|
|
|
|
}
|
|
|
|
|
2022-01-11 13:46:05 +01:00
|
|
|
jar {
|
2022-04-11 12:12:57 +02:00
|
|
|
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']
|
|
|
|
}
|
|
|
|
}
|