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 | payapiVersion = gitVersion() |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 13 | def details = versionDetails() |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 14 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 15 | def payapiStartClass = "com.supwisdom.dlpay.PayApiApplicationKt" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 16 | |
| 17 | println("Build version: $payapiVersion") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 18 | |
| 19 | bootJar { |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 20 | mainClassName = payapiStartClass |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 21 | manifest { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 22 | attributes("Payapi-Version": payapiVersion, |
| 23 | "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] | 24 | } |
| 25 | } |
| 26 | |
| 27 | jar { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 28 | baseName = "payapi" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 29 | } |
| 30 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 31 | compileKotlin { |
| 32 | kotlinOptions { |
| 33 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 34 | jvmTarget = jdkVersion |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | compileTestKotlin { |
| 39 | kotlinOptions { |
| 40 | freeCompilerArgs = ["-Xjsr305=strict"] |
| 41 | jvmTarget = jdkVersion |
| 42 | } |
Tang Cheng | 468da54 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 43 | } |
| 44 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 45 | docker { |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 46 | def imageVersion |
Xia Kaixiang | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 47 | if (details.gitHashFull.startsWith(details.lastTag) || !details.isCleanTag) { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 48 | imageVersion = "dev" |
Tang Cheng | 1b74524 | 2019-07-25 09:28:16 +0800 | [diff] [blame] | 49 | } else { |
| 50 | imageVersion = details.lastTag |
| 51 | } |
Xia Kaixiang | 910ebfa | 2019-10-12 17:48:43 +0800 | [diff] [blame] | 52 | println("Docker image tag : " + imageVersion) |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 53 | name "harbor.supwisdom.com/dali/payapi:" + imageVersion |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 54 | println(jar.archivePath) |
| 55 | files jar.archivePath |
| 56 | } |
| 57 | |
| 58 | docker.dependsOn(jar) |
| 59 | |
| 60 | dependencies { |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 61 | implementation project(":payapi-common") |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 62 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 63 | implementation "org.springframework.boot:spring-boot-starter-web" |
| 64 | implementation "org.springframework.boot:spring-boot-starter-security" |
| 65 | implementation "org.springframework.boot:spring-boot-starter-cache" |
| 66 | implementation "org.springframework.boot:spring-boot-autoconfigure" |
| 67 | implementation "org.springframework.security:spring-security-oauth2-jose" |
| 68 | implementation "org.springframework.security:spring-security-oauth2-client" |
| 69 | implementation "org.springframework.security:spring-security-oauth2-jose" |
Tang Cheng | 07b36f1 | 2019-12-16 11:41:58 +0800 | [diff] [blame] | 70 | implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 71 | implementation "org.springframework.boot:spring-boot-starter-thymeleaf" |
| 72 | implementation "org.springframework.session:spring-session-data-redis" |
| 73 | implementation "org.springframework.boot:spring-boot-starter-cache" |
| 74 | implementation "org.springframework.kafka:spring-kafka" |
| 75 | implementation "org.springframework.social:spring-social-web:${springSocialVersion}" |
| 76 | implementation "org.springframework.kafka:spring-kafka:${springKafkaVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 77 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 78 | implementation "org.springframework.cloud:spring-cloud-starter" |
| 79 | implementation "org.springframework.cloud:spring-cloud-starter-consul-discovery" |
| 80 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix" |
| 81 | implementation "org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard" |
| 82 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 83 | runtime("org.springframework.boot:spring-boot-devtools") |
| 84 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 85 | implementation "org.thymeleaf.extras:thymeleaf-extras-springsecurity5" |
Tang Cheng | e0537a7 | 2019-07-13 12:52:07 +0800 | [diff] [blame] | 86 | implementation 'org.bitbucket.b_c:jose4j:0.6.5' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 87 | implementation 'com.github.penggle:kaptcha:2.3.2' |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 88 | implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19' |
| 89 | implementation group: 'javax.servlet', name: 'jstl', version: '1.2' |
| 90 | implementation group: 'taglibs', name: 'standard', version: '1.1.2' |
qiaowei | dc92a3b | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 91 | implementation files('libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar') |
Xia Kaixiang | 6c9365e | 2019-07-31 15:44:51 +0800 | [diff] [blame] | 92 | implementation 'commons-beanutils:commons-beanutils:1.9.3' |
Xia Kaixiang | 651763c | 2020-02-17 18:00:03 +0800 | [diff] [blame] | 93 | implementation 'com.eatthepath:java-otp:0.1.0' |
Tang Cheng | 13911f9 | 2019-07-10 09:38:32 +0800 | [diff] [blame] | 94 | implementation project(':payapi-common') |
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 "org.apache.commons:commons-lang3:${lang3Version}" |
| 97 | implementation "net.javacrumbs.shedlock:shedlock-spring:${shedlockVersion}" |
| 98 | implementation "net.javacrumbs.shedlock:shedlock-provider-redis-spring:${shedlockVersion}" |
qiaowei | 38b4616 | 2019-09-09 16:35:58 +0800 | [diff] [blame] | 99 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 100 | implementation "org.bitbucket.b_c:jose4j:${jose4jVersion}" |
| 101 | implementation files("libs/masmgc.sdk.sms-0.0.1-SNAPSHOT.jar") |
| 102 | implementation "commons-beanutils:commons-beanutils:${beanutilsVersion}" |
qiaowei | 1657eef | 2019-07-22 17:50:33 +0800 | [diff] [blame] | 103 | /*支付宝SDK*/ |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 104 | implementation "com.alipay.sdk:alipay-sdk-java:${alipaySDKVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 105 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 106 | implementation "com.github.penggle:kaptcha:${kaptchaVersion}" |
| 107 | implementation "com.sun.jersey:jersey-client:${jerseyClientVersion}" |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 108 | |
Tang Cheng | e7d3a0e | 2019-07-08 16:27:33 +0800 | [diff] [blame] | 109 | } |
| 110 | |
kaixiang.xia | 051c7d7 | 2020-07-08 14:46:17 +0800 | [diff] [blame^] | 111 | tasks.withType(JavaCompile) { |
| 112 | options.encoding = "UTF-8" |
Tang Cheng | 4f2bfd0 | 2019-09-12 11:29:48 +0800 | [diff] [blame] | 113 | } |
| 114 | |