-
Notifications
You must be signed in to change notification settings - Fork 414
/
build.gradle
86 lines (76 loc) · 3.24 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
plugins {
id 'java'
}
group 'info.picocli'
description 'Picocli Code Generation - Tools to generate documentation, configuration, source code and other files from a picocli model.'
version "$projectVersion"
ext.moduleName = 'info.picocli.codegen'
if (!JavaVersion.current().isJava9Compatible()) {
sourceCompatibility = 1.6
targetCompatibility = 1.6
} else { // from Java 9 and up
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
dependencies {
api rootProject
}
//task generateGraalReflectionConfig(type: JavaExec) {
// mainClass = 'picocli.codegen.aot.graalvm.ReflectionConfigGenerator'
// classpath = sourceSets.main.runtimeClasspath
// def outputFile = "${rootProject.projectDir}/src/main/resources/META-INF/native-image/info.picocli/picocli/reflect-config.json"
// args = ["--output=$outputFile", 'picocli.AutoComplete$App']
//
// doLast {
// logger.info(":picocli-codegen:generateGraalReflectionConfig Generating $outputFile")
// }
//}
//generateGraalReflectionConfig.dependsOn(compileJava)
//jar.dependsOn(generateGraalReflectionConfig)
jar {
manifest {
attributes 'Specification-Title' : 'Picocli Code Generation',
'Specification-Vendor' : 'Remko Popma',
'Specification-Version' : archiveVersion.get(),
'Implementation-Title' : 'Picocli Code Generation',
'Implementation-Vendor' : 'Remko Popma',
'Implementation-Version': archiveVersion.get()
}
}
task generateManpageAsciiDoc(type: JavaExec) {
dependsOn(classes)
group = "Documentation"
description = "Generate AsciiDoc manpage"
classpath(configurations.compileClasspath, configurations.annotationProcessor, sourceSets.main.runtimeClasspath)
mainClass = 'picocli.codegen.docgen.manpage.ManPageGenerator'
outputs.dir("${project.buildDir}/picocli-generated-docs")
args 'picocli.codegen.docgen.manpage.ManPageGenerator$App',
'picocli.codegen.aot.graalvm.DynamicProxyConfigGenerator$App',
'picocli.codegen.aot.graalvm.ReflectionConfigGenerator$App',
'picocli.codegen.aot.graalvm.ResourceConfigGenerator$App',
'picocli.AutoComplete$App', // the command line app
'picocli.AutoComplete$GenerateCompletion', // generate completion subcommand
"--outdir=${project.buildDir}/picocli-generated-docs", "-v" //, "--template-dir=src/docs/mantemplates"
doLast {
ant.replaceregexp(match: "completion script for generate-completion", replace: "completion script for the root command of this command", flags: 'g', byline: true, encoding: 'UTF8') {
fileset(dir: 'build/picocli-generated-docs', includes: 'generate-completion.adoc')
}
}
}
apply plugin: 'org.asciidoctor.jvm.convert'
asciidoctor {
dependsOn(generateManpageAsciiDoc)
sourceDir = file("${project.buildDir}/picocli-generated-docs")
outputDir = file("${project.buildDir}/docs")
logDocuments = true
outputOptions {
backends = ['manpage', 'html5']
}
}
javadoc.dependsOn('asciidoctor')
ext {
PUBLISH_GROUP_ID = group
PUBLISH_ARTIFACT_ID = project.name
PUBLISH_VERSION = "$projectVersion"
}
apply from: "${rootProject.projectDir}/gradle/publish-mavencentral.gradle"