aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-08 21:38:27 +0300
committerGravatar Vitaly Takmazov2018-11-08 21:38:27 +0300
commit7aaa3f9a29c280f01c677c918932620be45cdbd7 (patch)
tree39947b2c889afd08f9c73ba54fab91159d2af258 /build.gradle
parent3ea9770d0d43fbe45449ac4531ec4b0a374d98ea (diff)
Merge everything into single Spring Boot application
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle191
1 files changed, 166 insertions, 25 deletions
diff --git a/build.gradle b/build.gradle
index cd9b4946..f64af2ca 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,42 +14,183 @@ plugins {
id("org.asciidoctor.convert") version "1.5.9.2" apply false
}
-allprojects {
- repositories {
- mavenCentral()
- jcenter()
- maven { url "https://jitpack.io" }
- maven { url "https://repository.apache.org/content/repositories/snapshots/" }
- maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
+repositories {
+ mavenCentral()
+ jcenter()
+ maven { url "https://jitpack.io" }
+ maven { url "https://repository.apache.org/content/repositories/snapshots/" }
+ maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
+}
+apply plugin: 'io.spring.dependency-management'
+dependencyManagement {
+ imports {
+ mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
}
- apply plugin: 'io.spring.dependency-management'
- dependencyManagement {
- imports {
- mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
+ applyMavenExclusions = false
+}
+
+apply plugin: 'com.github.ben-manes.versions'
+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')
+ }
}
- applyMavenExclusions = false
}
+}
+apply plugin: 'java'
+apply plugin: 'org.springframework.boot'
+apply plugin: 'com.moowork.node'
+apply plugin: 'io.github.swagger2markup'
+apply plugin: 'org.asciidoctor.convert'
- apply plugin: 'com.github.ben-manes.versions'
- 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')
- }
- }
- }
+task compileFrontend(type: YarnTask) {
+ inputs.files(fileTree('node_modules'))
+ inputs.files(fileTree('src'))
+ inputs.file('package.json')
+ inputs.file('webpack.config.js')
+ outputs.dir('src/main/resources/static')
+ args = ['run', 'compile']
+}
+
+ext {
+ swaggerOutputDir = file("${buildDir}/swagger")
+ docsOutputDir = file("${buildDir}/docs")
+}
+
+test {
+ systemProperty 'io.springfox.staticdocs.outputDir', swaggerOutputDir
+ outputs.dir swaggerOutputDir
+}
+
+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
+}
+
+configurations {
+ compile.exclude module: 'spring-boot-starter-tomcat'
}
+
+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-undertow")
+ compile ("org.springframework.boot:spring-boot-starter-websocket")
+ compile ("org.springframework.boot:spring-boot-starter-json")
+ compile ('org.springframework.boot:spring-boot-devtools')
+
+ compile "org.apache.commons:commons-lang3:3.8.1"
+ compile "org.apache.commons:commons-collections4:4.2"
+ compile 'org.apache.commons:commons-text:1.6'
+ compile "commons-codec:commons-codec:1.11"
+ compile "commons-io:commons-io:2.6"
+
+ compile 'com.google.code.findbugs:jsr305:3.0.2'
+ compile 'org.ocpsoft.prettytime:prettytime:4.0.2.Final'
+ compile 'org.imgscalr:imgscalr-lib:4.2'
+ compile "org.apache.commons:commons-imaging:1.0-SNAPSHOT"
+ runtime "commons-fileupload:commons-fileupload:1.3.3"
+ compile 'com.github.ben-manes.caffeine:caffeine:2.6.2'
+
+ compile "javax.inject:javax.inject:1"
+ compile "javax.xml.bind:jaxb-api:2.3.1"
+ compile 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
+
+ compileOnly 'io.springfox:springfox-core:2.9.2'
+
+ compile 'org.apache.commons:commons-email:1.5'
+ compile 'com.github.scribejava:scribejava-apis:6.0.0'
+ compile 'com.github.pengrad:java-telegram-bot-api:4.1.0'
+ compile 'com.twelvemonkeys.imageio:imageio-jpeg:3.4.1'
+ compile 'org.imgscalr:imgscalr-lib:4.2'
+ compile 'org.twitter4j:twitter4j-core:4.0.7'
+
+ compile 'xpp3:xpp3:1.1.4c'
+
+ compile 'rocks.xmpp:xmpp-core-client:0.8.1-SNAPSHOT'
+ compile 'rocks.xmpp:xmpp-extensions-client:0.8.1-SNAPSHOT'
+
+ compile "javax.inject:javax.inject:1"
+
+ compile 'com.rometools:rome:1.11.1'
+ compile 'com.rometools:rome-modules:1.11.1'
+
+ compile 'org.flywaydb:flyway-core:5.2.1'
+
+ runtime 'org.mariadb.jdbc:mariadb-java-client:2.3.0'
+ runtime 'com.h2database:h2:1.4.196'
+ runtime "commons-fileupload:commons-fileupload:1.3.3"
+
+ compile 'com.github.ooxi:serialized-php-parser:0.5.0'
+ compile 'io.pebbletemplates:pebble-spring5:3.0.5'
+ compile 'com.atlassian.commonmark:commonmark:0.11.0'
+ compile 'com.atlassian.commonmark:commonmark-ext-autolink:0.11.0'
+ compile 'org.tomitribe:tomitribe-http-signatures:1.1'
+
+ testCompile("org.springframework.boot:spring-boot-starter-test")
+ testCompile('net.sourceforge.htmlunit:htmlunit:2.33')
+ testCompile('org.springframework.security:spring-security-test')
+
+ testCompile 'io.springfox:springfox-swagger2:2.9.2'
+}
+
+bootJar {
+ launchScript()
+}
+
+bootRun {
+ sourceResources sourceSets.main
+}
+
+bootRun.dependsOn ':generateDebugKey'
+compileFrontend.dependsOn 'yarn'
+processResources.dependsOn 'compileFrontend'
+
class GenKey extends DefaultTask {
@OutputFile
String keystore
+
@TaskAction
def generate() {
- ant.genkey(alias:"1", keystore:keystore.toString(), storetype:"PKCS12", keyalg:"RSA", storepass:"secret", dname:"CN=localhost", keysize:2048)
+ ant.genkey(alias: "1", keystore: keystore.toString(), storetype: "PKCS12", keyalg: "RSA", storepass: "secret", dname: "CN=localhost", keysize: 2048)
}
}