This repository was archived by the owner on Jun 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
102 lines (82 loc) · 2.66 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
102 lines (82 loc) · 2.66 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//PLEASE DONT REMOVE SWAGGER2MARKUP, THIS IS JUST WAITING FOR NEXT RELEASE TO BE USED
//import io.github.swagger2markup.tasks.Swagger2MarkupTask
buildscript {
dependencies {
classpath("io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3")
classpath("io.github.swagger2markup:swagger2markup-import-files-ext:1.3.3")
}
}
plugins {
`java-library`
id("org.asciidoctor.jvm.convert") version "3.3.2"
// id("org.asciidoctor.jvm.gems") version "3.3.1"
}
apply(plugin = "io.github.swagger2markup")
tasks.withType<io.github.swagger2markup.tasks.Swagger2MarkupTask> {
swaggerInput = "${projectDir}/src/docs/openapi/swagger2.json"
outputDir = file("${projectDir}/src/docs/asciidoc/openapi/")
config = mapOf(
"swagger2markup.extensions.dynamicPaths.contentPath" to file("asciidoc/extensions/paths").absolutePath
)
}
repositories {
mavenCentral()
}
dependencies {
//implementation("io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3") //waiting for new release that supports
// asciidoctorGems("rubygems:rouge:3.26.0")
}
tasks {
"asciidoctor"(org.asciidoctor.gradle.jvm.AsciidoctorTask::class) {
//dependsOn convertSwagger2markup
logDocuments = true
baseDirFollowsSourceDir()
sources(delegateClosureOf<PatternSet> {
include("encore-documentation.adoc")
include("openapi.adoc")
})
resources {
from("${projectDir}/src/") {
include("img/**")
}
from("${projectDir}/src/") {
include("js/**", "css/**", "examples/**")
}
}
attributes(
mapOf(
"allow-uri-read" to "",
// use provided highlighter
"source-highlighter" to "highlight.js",
"highlightjsdir" to "js/highlight",
"highlightjs-theme" to "darcula",
"stylesheet" to "css/clean.css"
)
)
doLast {
file("${outputDir}/encore-documentation.html").renameTo(file("${outputDir}/index.html"))
}
}
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = "7.2"
}
/*
asciidoctor {
baseDirFollowsSourceFile()
attributes \
'build-gradle': file('build.gradle'),
'sourcedir': project.sourceSets.main.java.srcDirs[0],
'endpoint-url': 'http://example.org',
'imagesdir': 'images',
'toc': 'left',
'icons': 'font',
'setanchors': '',
'idprefix': '',
'idseparator': '-',
'docinfo': 'shared'
doLast {
file("${outputDir}/encore-documentation.html").rename('index.html')
}
}