forked from toedter/hal-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
86 lines (67 loc) · 1.81 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
plugins {
id "com.github.node-gradle.node" version "7.0.2"
id 'org.asciidoctor.jvm.convert' version '4.0.3'
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/milestone' }
}
apply plugin: 'java'
node {
version = '20.16.0'
download = true
workDir = file("$projectDir/build/node")
}
yarn_install.inputs.file new File(projectDir, "package.json")
yarn_install.inputs.file new File(projectDir, "yarn.lock")
yarn_install.outputs.dir new File(projectDir, "node_modules")
yarn_build.inputs.dir new File(projectDir, "src")
yarn_build.outputs.dir new File(projectDir, "dist")
yarn_build.dependsOn yarn_install, yarn_lint //, yarn_test
//task clean() {
// doFirst {
// delete "dist"
// delete "build"
// }
//}
// task build
build.dependsOn yarn_build
version = '1.2.2'
configurations {
docs
}
dependencies {
docs "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.7"
}
asciidoctor {
configurations "docs"
sourceDir "doc"
attributes 'version': "${project.version}"
baseDirFollowsSourceFile()
outputOptions {
backends "spring-html"
}
}
tasks.register('doc') {
dependsOn asciidoctor
doLast {
copy {
from "$projectDir/dist/hal-explorer"
into "$projectDir/build/docs/gh-pages/snapshot/hal-explorer"
}
copy {
from "$projectDir/test-data"
into "$projectDir/build/docs/gh-pages/snapshot/hal-explorer/examples"
filter { line -> line.replaceAll('http://localhost:3000', 'https://toedter.github.io/hal-explorer/snapshot/hal-explorer/examples') }
}
copy {
from "$projectDir/doc/img/"
into "$projectDir/build/docs/asciidoc/img/"
}
copy {
from "$projectDir/build/docs/asciidoc"
into "$projectDir/build/docs/gh-pages/snapshot/reference-doc"
}
}
}