-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
78 lines (63 loc) · 2.21 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Kotlin application project to get you started.
*/
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id 'org.jetbrains.kotlin.jvm' version '1.4.30'
// Apply the application plugin to add support for building a CLI application.
id 'application'
// shadow plugin to create fat jar
id 'com.github.johnrengelman.shadow' version '6.1.0'
}
compileKotlin {
kotlinOptions.useIR = true
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Align versions of all Kotlin components
implementation platform('org.jetbrains.kotlin:kotlin-bom')
// Use the Kotlin JDK 8 standard library.
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
implementation 'io.swagger.parser.v3:swagger-parser:2.0.24'
implementation 'com.github.spullara.mustache.java:compiler:0.9.7'
implementation 'info.picocli:picocli:4.6.1'
// implementation 'org.slf4j:slf4j-nop:1.7.30'
// implementation 'org.slf4j:jul-to-slf4j:1.7.30'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.commonmark:commonmark:0.17.1'
implementation 'org.commonmark:commonmark-ext-gfm-tables:0.17.1'
// Use the Kotlin test library.
testImplementation 'org.jetbrains.kotlin:kotlin-test'
// Use the Kotlin JUnit integration.
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit'
}
application {
// Define the main class for the application.
mainClassName = 'sohoffice.swaggerdown.AppKt'
}
task sample() {
description "Generate petstore sample"
dependsOn ["shadowJar"]
doLast {
println "Delete petstore sample"
File f = new File("${projectDir}/src/test/resources/petstore.md")
f.delete()
println description
new ByteArrayOutputStream().withStream { os ->
exec {
executable "java"
args "-jar", "build/libs/swagger-down-all.jar", "src/test/resources/petstore.json"
standardOutput = os
}
new FileOutputStream(f).withStream { fout ->
fout.write(os.toByteArray())
}
}
}
}