Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 1 | plugins { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 2 | id "java" |
| 3 | id "org.springframework.boot" |
| 4 | id "org.jetbrains.kotlin.jvm" |
| 5 | id "org.jetbrains.kotlin.plugin.jpa" |
| 6 | id "org.jetbrains.kotlin.plugin.spring" |
| 7 | id "com.palantir.docker" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 8 | } |
| 9 | |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 10 | apply plugin: 'io.spring.dependency-management' |
| 11 | apply plugin: 'kotlin' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 12 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 13 | def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 14 | |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 15 | println("Build version: $buildVersion") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 16 | |
| 17 | bootJar { |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 18 | enabled = true |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 19 | mainClassName = payapiStartClass |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 20 | manifest { |
Tang Cheng | f36d725 | 2019-12-17 14:14:50 +0800 | [diff] [blame] | 21 | attributes("Payapi-Version": buildVersion, |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 22 | "Payapi-Buildtime": buildTime) |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 23 | } |
| 24 | } |
| 25 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 26 | compileKotlin { |
| 27 | kotlinOptions { |
| 28 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 29 | jvmTarget = jdkVersion |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | compileTestKotlin { |
| 34 | kotlinOptions { |
| 35 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 36 | jvmTarget = jdkVersion |
| 37 | } |
Tang Cheng | 468da54 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 38 | } |
| 39 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 40 | docker { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 41 | def imageVersion |
Xia Kaixiang | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 42 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 43 | imageVersion = "dev" |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 44 | } else { |
| 45 | imageVersion = details.lastTag |
| 46 | } |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 47 | println("Docker image tag : ${imageVersion}") |
| 48 | name "${dockerRegistry}/payapi:${imageVersion}" |
| 49 | println(jar.archiveFile.get()) |
| 50 | files jar.archiveFile.get() |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | docker.dependsOn(jar) |
| 54 | |
Tang Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame^] | 55 | configurations { |
| 56 | developmentOnly |
| 57 | runtimeClasspath { |
| 58 | extendsFrom developmentOnly |
| 59 | } |
| 60 | } |
| 61 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 62 | dependencies { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 63 | implementation project(":payapi-common") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 64 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 65 | implementation "org.springframework.boot:spring-boot-starter-web" |
| 66 | implementation "org.springframework.boot:spring-boot-starter-security" |
| 67 | implementation "org.springframework.boot:spring-boot-starter-cache" |
| 68 | implementation "org.springframework.boot:spring-boot-autoconfigure" |
| 69 | implementation "org.springframework.security:spring-security-oauth2-jose" |
| 70 | implementation "org.springframework.security:spring-security-oauth2-client" |
| 71 | implementation "org.springframework.security:spring-security-oauth2-jose" |
Tang Cheng | 07b36f1 | 2019-12-16 11:41:58 +0800 | [diff] [blame] | 72 | implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 73 | implementation "org.springframework.boot:spring-boot-starter-thymeleaf" |
| 74 | implementation "org.springframework.session:spring-session-data-redis" |
| 75 | implementation "org.springframework.boot:spring-boot-starter-cache" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 76 | implementation "org.springframework.social:spring-social-web:${springSocialVersion}" |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 77 | implementation "org.apache.kafka:kafka-streams" |
| 78 | implementation "org.springframework.kafka:spring-kafka" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 79 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 80 | implementation "org.springframework.cloud:spring-cloud-starter" |
| 81 | implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery" |
| 82 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix" |
| 83 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard" |
| 84 | |
Tang Cheng | e403290 | 2019-12-19 12:38:08 +0800 | [diff] [blame^] | 85 | developmentOnly("org.springframework.boot:spring-boot-devtools") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 86 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 87 | implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 88 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 89 | implementation "org.apache.commons:commons-lang3:${lang3Version}" |
| 90 | implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}" |
| 91 | implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}" |
qiaowei | 38b4616 | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 92 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 93 | implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}" |
| 94 | implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar") |
| 95 | implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}" |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 96 | /*支付宝SDK*/ |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 97 | implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 98 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 99 | implementation "com.github.penggle:kaptcha:${kaptchaVersion}" |
| 100 | implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 101 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 102 | } |
| 103 | |