Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 1 | import java.text.SimpleDateFormat |
| 2 | |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 3 | plugins { |
| 4 | id 'java' |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 5 | id 'org.springframework.boot' version '2.2.2.RELEASE' |
| 6 | id 'io.spring.dependency-management' version '1.0.8.RELEASE' |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 7 | id 'org.jetbrains.kotlin.jvm' version '1.3.31' |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 8 | id 'org.jetbrains.kotlin.plugin.spring' version '1.3.31' apply false |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 9 | id 'org.jetbrains.kotlin.plugin.jpa' version '1.3.31' apply false |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 10 | id 'com.gradle.build-scan' version '2.0.2' |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 11 | id "com.palantir.git-version" version "0.12.0-rc2" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 12 | id 'com.palantir.docker' version '0.22.1' apply false |
Tang Cheng | 2273131 | 2019-07-12 11:19:30 +0800 | [diff] [blame] | 13 | } |
| 14 | |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 15 | bootJar { |
| 16 | enabled = false |
| 17 | } |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 18 | |
Tang Cheng | 9eb1bea | 2019-07-08 09:15:47 +0800 | [diff] [blame] | 19 | allprojects { |
| 20 | repositories { |
| 21 | jcenter() |
| 22 | mavenCentral() |
| 23 | } |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 24 | ext { |
| 25 | set('junit_jupiter_version', "5.5.2") |
| 26 | set("junit_platform_version", "1.5.2") |
| 27 | set("mockitoVersion", "3.1.0") |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 28 | set("dockerRegistry", "harbor.supwisdom.com/dali") |
| 29 | set("buildTime", new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())) |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 30 | } |
Tang Cheng | 31a5b2a | 2019-11-25 22:01:48 +0800 | [diff] [blame] | 31 | |
Tang Cheng | 31a5b2a | 2019-11-25 22:01:48 +0800 | [diff] [blame] | 32 | apply plugin: 'java' |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 33 | apply plugin: 'io.spring.dependency-management' |
| 34 | |
Tang Cheng | 4c0ea6a | 2019-12-18 12:26:50 +0800 | [diff] [blame] | 35 | group = 'com.supwisdom' |
Tang Cheng | db7c2b5 | 2019-12-18 12:29:26 +0800 | [diff] [blame] | 36 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 37 | sourceCompatibility = JavaVersion.VERSION_1_8 |
| 38 | targetCompatibility = JavaVersion.VERSION_1_8 |
| 39 | |
| 40 | compileKotlin { |
| 41 | kotlinOptions { |
| 42 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 43 | jvmTarget = jdkVersion |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | compileTestKotlin { |
| 48 | kotlinOptions { |
| 49 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 50 | jvmTarget = jdkVersion |
| 51 | } |
| 52 | } |
| 53 | |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 54 | sourceSets { |
| 55 | main.java.srcDirs += "src/main/java" |
| 56 | } |
| 57 | |
Tang Cheng | 7b01546 | 2019-12-17 14:08:26 +0800 | [diff] [blame] | 58 | version = '1' |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 59 | ext { |
| 60 | details = versionDetails() |
Tang Cheng | 7b01546 | 2019-12-17 14:08:26 +0800 | [diff] [blame] | 61 | buildVersion = gitVersion() |
Tang Cheng | 31a5b2a | 2019-11-25 22:01:48 +0800 | [diff] [blame] | 62 | } |
Xia Kaixiang | 95e8848 | 2019-04-08 17:56:29 +0800 | [diff] [blame] | 63 | } |
Tang Cheng | 40993e1 | 2019-07-08 16:38:51 +0800 | [diff] [blame] | 64 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 65 | |
| 66 | subprojects { |
| 67 | |
| 68 | ext { |
| 69 | set('springCloudVersion', "Hoxton.RELEASE") |
| 70 | } |
| 71 | |
| 72 | dependencies { |
| 73 | ext { |
| 74 | slf4jVersion = '1.7.26' |
| 75 | beanutilsVersion = '1.9.3' |
| 76 | codecVersion = '1.13' |
| 77 | lang3Version = '3.9' |
| 78 | commonCodecVersion = '1.12' |
| 79 | lombokVersion = '1.18.8' |
| 80 | javaELVersion = '3.0.0' |
| 81 | shedlockVersion = '2.5.0' |
| 82 | jose4jVersion = '0.6.5' |
| 83 | jcabiManifestsVersion = '1.1' |
| 84 | kotlnLogVersion = '1.6.26' |
| 85 | slf4jVersion = '1.7.26' |
| 86 | gsonVersion = '2.8.5' |
| 87 | dbcpVersion = '1.4' |
| 88 | log4jVersion = '1.2.17' |
| 89 | alibabFastjsonVerison = '1.2.60' |
| 90 | beanutilsVersion = '1.9.3' |
| 91 | alipaySDKVersion = '3.7.110.ALL' |
| 92 | lombokVersion = '1.18.8' |
| 93 | resetAssuredVersion = '3.3.0' |
| 94 | hamcrestVersion = '2.1' |
| 95 | mockkVersion = '1.9.3' |
| 96 | commonNetVersion = '3.6' |
| 97 | kaptchaVersion = '2.3.2' |
| 98 | jerseyClientVersion = '1.19' |
| 99 | javaxWSRSVersion = '2.1.1' |
| 100 | dom4jVersion = '2.1.1' |
Tang Cheng | 9e4d0e3 | 2019-12-20 23:32:52 +0800 | [diff] [blame^] | 101 | javaxServletVersion = '4.0.1' |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 102 | springSocialVersion = '1.1.6.RELEASE' |
| 103 | springKafkaVersion = '2.2.8.RELEASE' |
| 104 | postgresVersion = '42.2.5' |
| 105 | } |
| 106 | implementation "org.jetbrains.kotlin:kotlin-reflect" |
| 107 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" |
| 108 | |
Tang Cheng | 1d56584 | 2019-12-18 20:33:41 +0800 | [diff] [blame] | 109 | implementation "org.springframework.boot:spring-boot-starter" |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 110 | implementation "org.springframework.boot:spring-boot-starter-data-jpa" |
| 111 | implementation "org.springframework.boot:spring-boot-starter-data-redis" |
| 112 | implementation "org.springframework.boot:spring-boot-starter-validation" |
| 113 | |
| 114 | implementation "javax.validation:validation-api" |
| 115 | implementation "com.jcabi:jcabi-manifests:${jcabiManifestsVersion}" |
| 116 | implementation "org.slf4j:slf4j-parent:${slf4jVersion}" |
| 117 | implementation "org.slf4j:slf4j-api:${slf4jVersion}" |
| 118 | implementation "org.postgresql:postgresql:${postgresVersion}" |
| 119 | implementation "io.github.microutils:kotlin-logging:${kotlnLogVersion}" |
| 120 | implementation "org.slf4j:slf4j-parent:${slf4jVersion}" |
| 121 | implementation "com.google.code.gson:gson:${gsonVersion}" |
| 122 | implementation "commons-dbcp:commons-dbcp:${dbcpVersion}" |
| 123 | implementation "commons-codec:commons-codec:${commonCodecVersion}" |
| 124 | implementation "log4j:log4j:${log4jVersion}" |
| 125 | implementation "com.alibaba:fastjson:${alibabFastjsonVerison}" |
| 126 | implementation "com.fasterxml.jackson.module:jackson-module-kotlin" |
| 127 | |
| 128 | |
| 129 | annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" |
| 130 | annotationProcessor "org.projectlombok:lombok:${lombokVersion}" |
| 131 | compileOnly "org.projectlombok:lombok:${lombokVersion}" |
| 132 | |
| 133 | // implementation "javax.el:javax.el-api:${javaELVersion}" |
| 134 | // implementation "javax.servlet:javax.servlet-api:4.0.1" |
| 135 | // testImplementation 'org.springframework:spring-test' |
| 136 | // testImplementation 'org.springframework.boot:spring-boot-test' |
| 137 | // implementation "javax.servlet:jstl:1.2" |
| 138 | // implementation "taglibs:standard:1.1.2" |
Tang Cheng | 9e4d0e3 | 2019-12-20 23:32:52 +0800 | [diff] [blame^] | 139 | |
| 140 | testImplementation("org.springframework.boot:spring-boot-starter-test") { |
| 141 | exclude group: "junit", module: "junit" |
| 142 | } |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 143 | testImplementation "org.junit.jupiter:junit-jupiter-api:${junit_jupiter_version}" |
| 144 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" |
| 145 | testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" |
Tang Cheng | 9e4d0e3 | 2019-12-20 23:32:52 +0800 | [diff] [blame^] | 146 | testRuntimeOnly("org.junit.vintage:junit-vintage-engine:${junit_jupiter_version}") |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 147 | testImplementation "io.mockk:mockk:${mockkVersion}" |
| 148 | testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}" |
| 149 | testImplementation "io.rest-assured:rest-assured:${resetAssuredVersion}" |
| 150 | testImplementation "io.rest-assured:spring-mock-mvc:${resetAssuredVersion}" |
| 151 | } |
| 152 | |
| 153 | test { |
| 154 | useJUnitPlatform() |
| 155 | testLogging { |
| 156 | events "passed", "skipped", "failed" |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | dependencyManagement { |
| 161 | imports { |
| 162 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" |
| 163 | } |
| 164 | } |
Tang Cheng | 8beabcd | 2019-07-12 11:48:01 +0800 | [diff] [blame] | 165 | } |
| 166 | |
Tang Cheng | 91ca277 | 2019-12-16 08:59:52 +0800 | [diff] [blame] | 167 | |