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