当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 42

风咏 / duic
暂停

forked from ZY / duic
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build.gradle 6.09 KB
一键复制 编辑 原始数据 按行查看 历史
buildscript {
ext {
kotlinVersion = "1.3.11"
springVersion = "5.1.4.RELEASE"
springBootVersion = "2.1.2.RELEASE"
jacksonVersion = "2.9.7"
reactorVersion = "3.2.3.RELEASE"
liquibaseVersion = "3.6.2"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "com.bmuschko:gradle-docker-plugin:3.2.1"
}
}
plugins {
id "net.researchgate.release" version "2.6.0"
id "com.moowork.node" version "1.2.0"
id "net.ltgt.apt" version "0.10"
id "com.github.hierynomus.license" version "0.14.0"
}
apply plugin: "java"
apply plugin: "maven"
apply plugin: "idea"
apply plugin: "jacoco"
apply plugin: "kotlin"
apply plugin: "kotlin-spring"
apply plugin: "org.springframework.boot"
apply plugin: "com.github.hierynomus.license"
apply plugin: "com.bmuschko.docker-remote-api"
group "io.zhudy.duic"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "org.jetbrains.kotlin:kotlin-reflect"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.0"
compile "com.github.ben-manes.caffeine:caffeine:2.6.2"
compile "io.github.resilience4j:resilience4j-ratelimiter:0.13.2"
compile "io.github.resilience4j:resilience4j-reactor:0.13.2"
compile("org.springframework.boot:spring-boot-starter-webflux:$springBootVersion") {
exclude module: "hibernate-validator"
exclude module: "nio-multipart-parser"
}
compile "org.mongodb:mongodb-driver-reactivestreams:1.10.0"
compile "org.springframework:spring-jdbc:$springVersion"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"
compile "com.auth0:java-jwt:3.3.0"
compile "org.springframework.security:spring-security-crypto:5.0.4.RELEASE"
compile "org.liquibase:liquibase-core:$liquibaseVersion"
compile "com.zaxxer:HikariCP:3.3.0"
compile("mysql:mysql-connector-java:8.0.14") {
exclude module: "protobuf-java"
}
compile "org.postgresql:postgresql:42.2.2"
testCompile "org.springframework.boot:spring-boot-starter-test:$springBootVersion"
testCompile "io.projectreactor:reactor-test:$reactorVersion"
apt "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion"
}
[compileJava, compileTestJava, javadoc]*.options*.encoding = "UTF-8"
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileJava.dependsOn(processResources)
bootJar {
manifest {
attributes "Implementation-Title": "duic", "Implementation-Version": project.version
}
}
license {
headerURI = com.hierynomus.gradle.license.LicenseBasePlugin.class.getClassLoader().getResource("headers/Apache-2.0").toURI()
mapping([
"vue": "XML_STYLE"
])
excludes([
"db/migration/**"
])
ext {
year = "2017-${Calendar.getInstance().get(Calendar.YEAR)}"
author = "the original author or authors"
}
}
task licenseFormatWeb(type: com.hierynomus.gradle.license.tasks.LicenseFormat) {
group = "license"
source = fileTree(project.projectDir).include(
"buildSrc/*.js",
"src/main/web/**/*.vue",
"src/main/web/**/*.html",
"src/main/web/**/*.js"
)
}
licenseFormat.dependsOn licenseFormatWeb
tasks.withType(com.hierynomus.gradle.license.tasks.LicenseCheck) {
it.enabled = false
}
test {
testLogging {
exceptionFormat "full"
}
exclude "**/Oracle*RepositoryTests*"
}
jacoco {
toolVersion = '0.7.9'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
html.destination file("${buildDir}/jacocoHtml")
}
}
jacocoTestReport.dependsOn test
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
node {
version = "8.9.4"
yarnVersion = "1.7.0"
download = true
}
task buildAdmin(type: YarnTask, dependsOn: yarn) {
group = "node"
args = ["run", "build"]
}
task copyAdminFiles(type: Copy, dependsOn: buildAdmin) {
group = "node"
from "dist"
include "**/**"
into "${project.buildDir}/resources/main/public-web-resources"
}
bootJar.dependsOn copyAdminFiles
task copyDockerJar(type: Copy, dependsOn: build) {
group = "docker"
from jar.archivePath.path
into "${project.buildDir}/docker"
rename { String fileName ->
fileName.replace("-${project.version}", "")
}
}
task createDockerfile(type: com.bmuschko.gradle.docker.tasks.image.Dockerfile, dependsOn: copyDockerJar) {
group = "docker"
def jarName = "${project.name}.jar".toString()
destFile = project.file("${project.buildDir}/docker/Dockerfile")
from "openjdk:8u171-jre-slim-stretch"
maintainer "Kevin Zou <kevinz@weghst.com>"
copyFile(jarName, "/app/$jarName".toString())
workingDir("/app")
volume("/app/logs")
environmentVariable("TZ", "Asia/Shanghai") // 默认时区设置为东8区
environmentVariable([
JVM_OPTS : "-Xms1g -Xmx1g -XX:MetaspaceSize=128m",
JAVA_OPTS: "-server -XX:+UseG1GC \$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=logs/ -XX:+PrintGCDateStamps -verbose:gc -XX:+PrintGCDetails -Xloggc:logs/gc.log"
])
environmentVariable("DUIC_OPTS", "-Dspring.profiles.active=mongodb")
exposePort(7777)
defaultCommand("sh", "-c", "java \$JAVA_OPTS \$DUIC_OPTS -jar $jarName")
}
task buildImage(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage, dependsOn: createDockerfile) {
group = "docker"
inputDir = createDockerfile.destFile.parentFile
tags = ["zhudyos/${project.name}:${project.version}".toString(), "zhudyos/${project.name}:latest".toString()]
}
task copyRelease(type: Copy) {
from jar.archivePath.path
into "${project.buildDir}/releases"
}
Kotlin
1
https://gitee.com/fysoft2006/duic.git
git@gitee.com:fysoft2006/duic.git
fysoft2006
duic
duic
master

搜索帮助