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