aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
blob: 21440a0e32686d6d802b022f5779953baaf33717 (plain) (blame)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.3'
    }
}
plugins {
    id 'com.github.ben-manes.versions' version '0.28.0'
    id 'org.springframework.boot' version '2.3.0.RELEASE' apply false
    id 'org.asciidoctor.convert' version '2.4.0'
}

repositories {
    mavenCentral()
    jcenter()
    google()
}
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
    imports {
        mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
    }
    applyMavenExclusions = false
}

dependencyUpdates.resolutionStrategy {
    componentSelection { rules ->
        rules.all { ComponentSelection selection ->
            boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'pr', 'b'].any { qualifier ->
                selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
            }
            if (rejected) {
                selection.reject('Release candidate')
            }
        }
    }
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.github.swagger2markup'

task yarn(type: Exec) {
    inputs.file('yarn.lock')
    outputs.file('yarn.lock')
    if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
        commandLine 'cmd', '/c', 'yarn'
    } else {
        commandLine 'yarn'
    }
}

task yarnCompile(type: Exec) {
    inputs.files(fileTree('node_modules'))
    inputs.files(fileTree('src'))
    inputs.file('webpack.config.js')
    outputs.dir('src/main/resources/static')
    if (DefaultNativePlatform.getCurrentOperatingSystem().isWindows()) {
        commandLine 'cmd', '/c', 'yarn', 'compile'
    } else {
        commandLine 'yarn', 'compile'
    }
}

ext {
    swaggerOutputDir = file("${buildDir}/swagger")
    docsOutputDir = file("${buildDir}/docs")
}

test {
    systemProperty 'io.springfox.staticdocs.outputDir', swaggerOutputDir
    outputs.dir swaggerOutputDir
    systemProperty 'spring.profiles.active', "${springProfile}"
}

convertSwagger2markup {
    dependsOn test
    swaggerInput "${swaggerOutputDir}/swagger.json"
    outputDir swaggerOutputDir
    config = [
            'swagger2markup.markupLanguage': 'ASCIIDOC',
            'swagger2markup.pathsGroupedBy': 'TAGS'
    ]
}
task asciidocIndex(type: Copy) {
    from 'src/docs'
    into swaggerOutputDir
    include '*.adoc'
}
asciidoctor {
    dependsOn convertSwagger2markup
    dependsOn asciidocIndex
    sourceDir = swaggerOutputDir
    sources {
        include 'index.adoc', 'overview.adoc', 'definitions.adoc', 'paths.adoc'
    }
    attributes = [
            doctype    : 'book',
            toc        : 'left',
            toclevels  : '3',
            numbered   : '',
            sectlinks  : '',
            sectanchors: '',
            hardbreaks : '',
            src        : swaggerOutputDir,
            generated  : docsOutputDir
    ]
    outputDir = docsOutputDir
}

dependencies {
    compile ('org.springframework.boot:spring-boot-starter-cache')
    compile ('org.springframework.boot:spring-boot-starter-security')
    compile ('org.springframework.boot:spring-boot-starter-jdbc')
    compile ("org.springframework.boot:spring-boot-starter-security")
    compile ("org.springframework.boot:spring-boot-starter-web")
    compile ("org.springframework.boot:spring-boot-starter-json")
    compile ("org.springframework.boot:spring-boot-starter-actuator")
    compile ('org.springframework.boot:spring-boot-devtools')
    runtime ("org.springframework.boot:spring-boot-properties-migrator")

    compile 'org.flywaydb:flyway-core:6.4.3'
    compile 'com.github.ben-manes.caffeine:caffeine:2.8.4'

    compile "javax.inject:javax.inject:1"
    compile 'com.google.code.findbugs:jsr305:3.0.2'
    compile 'javax.validation:validation-api:2.0.1.Final'

    compile "org.apache.commons:commons-lang3:3.10"
    compile "org.apache.commons:commons-collections4:4.4"
    compile 'org.apache.commons:commons-email:1.5'
    compile 'org.apache.commons:commons-text:1.8'
    compile "org.apache.commons:commons-imaging:1.0-alpha1"

    compile "commons-codec:commons-codec:1.14"
    compile "commons-io:commons-io:2.7"
    
    compile 'org.ocpsoft.prettytime:prettytime:4.0.5.Final'
    compile 'com.twelvemonkeys.imageio:imageio-jpeg:3.5'
    compile 'org.imgscalr:imgscalr-lib:4.2'

    compile "javax.xml.bind:jaxb-api:2.3.1"
    runtime 'org.glassfish.jaxb:jaxb-runtime:2.3.3'

    compileOnly 'io.springfox:springfox-core:2.9.2'

    compile 'org.apache.commons:commons-email:1.5'
    compile 'com.github.scribejava:scribejava-apis:6.9.0'
    compile 'com.github.pengrad:java-telegram-bot-api:4.9.0'
    compile 'org.imgscalr:imgscalr-lib:4.2'
    compile 'org.twitter4j:twitter4j-core:4.0.7'

    compile 'rocks.xmpp:xmpp-core-client:0.8.2'
    compile 'rocks.xmpp:xmpp-extensions-client:0.8.2'

    compile 'com.rometools:rome:1.13.1'
    compile 'com.rometools:rome-modules:1.13.1'

    runtime 'org.mariadb.jdbc:mariadb-java-client:2.6.0'
    runtime 'net.java.dev.jna:jna:5.5.0'
    runtime 'net.java.dev.jna:jna-platform:5.5.0'
    runtime 'com.h2database:h2:1.4.200'

    compile 'io.pebbletemplates:pebble-spring5:3.1.3'
    compile 'com.atlassian.commonmark:commonmark:0.15.1'
    compile 'com.atlassian.commonmark:commonmark-ext-autolink:0.15.1'
    compile 'org.tomitribe:tomitribe-http-signatures:1.4'
    compile 'com.google.api-client:google-api-client:1.30.9'
    compile "com.kotcrab.remark:remark:1.2.0"

    compile 'io.jsonwebtoken:jjwt-api:0.11.1'
    runtime 'io.jsonwebtoken:jjwt-jackson:0.11.1'
    runtime 'io.jsonwebtoken:jjwt-impl:0.11.1'
    compile 'com.nimbusds:nimbus-jose-jwt:8.19'

    testCompile("org.springframework.boot:spring-boot-starter-test")
    testCompile('net.sourceforge.htmlunit:htmlunit:2.41.0')
    testCompile('org.springframework.security:spring-security-test')
    testCompile("ch.vorburger.mariaDB4j:mariaDB4j:2.4.0")

    testCompile 'io.springfox:springfox-swagger2:2.9.2'
    testCompile 'org.bouncycastle:bcpkix-jdk15on:1.65'
}

bootJar {
    launchScript()
}

bootRun {
    sourceResources sourceSets.main
}

yarnCompile.dependsOn 'yarn'
processResources.dependsOn 'yarnCompile'

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11