-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
163 lines (140 loc) · 4.04 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
plugins {
id "checkstyle"
id 'com.github.node-gradle.node' version '3.0.1'
id "eclipse"
id "io.spring.nohttp" version "0.0.7"
id "io.spring.javaformat"
id "java"
id "maven-publish"
}
group = 'io.spring.asciidoctor.backends'
description = 'Spring Asciidoctor Backends'
apply from: "$rootDir/gradle/publish-maven.gradle"
def generatedGem = "$buildDir/generated-resources/gem"
def generatedAssets = "$buildDir/generated-resources/assets"
def mavenProjectRepository = "$buildDir/maven-repository"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
java {
withJavadocJar()
withSourcesJar()
}
sourceSets {
main {
output.dir(generatedAssets, builtBy: "gulp")
output.dir(generatedGem, builtBy: "gem")
}
test {
output.dir(mavenProjectRepository, builtBy: ["publishMavenPublicationToProjectRepository", "unzipMavenBinary"])
}
}
configurations {
mavenBinary
}
repositories {
mavenCentral()
}
dependencies {
checkstyle("io.spring.javaformat:spring-javaformat-checkstyle:$springJavaFormatVersion")
compileOnly("org.asciidoctor:asciidoctorj:$asciidoctorjVersion")
compileOnly("org.asciidoctor:asciidoctorj-pdf:$asciidoctorjPdfVersion")
testImplementation("com.google.guava:guava:30.1-jre")
testImplementation("org.apache.pdfbox:pdfbox:2.0.23")
testImplementation("org.asciidoctor:asciidoctorj:$asciidoctorjVersion")
testImplementation("org.asciidoctor:asciidoctorj-pdf:$asciidoctorjPdfVersion")
testImplementation("org.assertj:assertj-core:3.11.1")
testImplementation("org.jsoup:jsoup:1.13.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")
testImplementation("org.seleniumhq.selenium:selenium-chrome-driver:3.141.59")
testImplementation("org.seleniumhq.selenium:selenium-remote-driver:3.141.59")
testImplementation("org.slf4j:slf4j-simple:1.7.30")
testImplementation("org.testcontainers:junit-jupiter:1.15.2")
testImplementation("org.testcontainers:selenium:1.15.2")
testImplementation("org.apache.maven:maven-embedder:3.6.2");
testImplementation("org.apache.maven.shared:maven-invoker:3.1.0")
testImplementation("org.testcontainers:junit-jupiter:1.15.2")
testImplementation gradleTestKit()
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
mavenBinary("org.apache.maven:apache-maven:3.6.2:bin@zip")
}
node {
version = '20.9.0'
download = true
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-parameters'
}
nohttp {
source.exclude "node_modules/**"
source.exclude "src/test/maven/target/**"
source.exclude "src/test/gradle/build/**"
}
test {
useJUnitPlatform()
}
task convertTestAsciidoc(type: JavaExec) {
classpath = sourceSets.test.runtimeClasspath
main = 'io.spring.asciidoctor.backend.testsupport.TestSpringHtmlConverter'
}
task gulp(type: NpmTask) {
dependsOn("npm_install")
inputs.dir("src/main/css")
inputs.dir("src/main/img")
inputs.dir("src/main/js")
inputs.file("postcss.config.js")
outputs.dir(generatedAssets)
args = ["run", "build", "--output=${generatedAssets}"]
}
task dev(type: NpmTask) {
dependsOn("convertTestAsciidoc")
args = ["run", "dev"]
}
task gem(type: Sync) {
dependsOn("gulp")
inputs.dir("src/main/ruby")
inputs.dir("src/main/gemspec")
outputs.dir(generatedGem)
destinationDir = file(generatedGem)
from("src/main/ruby/") {
into("gems/spring-asciidoctor-backends-0.0.0/")
}
from("src/main/gemspec/") {
into("specifications/")
}
from(generatedAssets) {
into("gems/spring-asciidoctor-backends-0.0.0/data/assets")
}
}
task prettierFormat(type: NpmTask) {
inputs.dir("src")
outputs.dir("src")
args = ["run", "format"]
}
task prettierCheckFormat(type: NpmTask) {
inputs.dir("src")
args = ["run", "checkFormat"]
}
task unzipMavenBinary(type: Copy) {
configurations.mavenBinary.asFileTree.each { mavenZip ->
from(zipTree(mavenZip))
}
into "$buildDir/maven-binary"
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
checkFormat.dependsOn prettierCheckFormat
format.dependsOn prettierFormat
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
maven {
name "project"
url file(mavenProjectRepository).toURI()
}
}
}