Xia Kaixiang | 0e37c14 | 2019-07-11 18:14:34 +0800 | [diff] [blame] | 1 | plugins { |
| 2 | id 'java' |
| 3 | id 'org.springframework.boot' version '2.1.6.RELEASE' |
| 4 | id 'org.jetbrains.kotlin.jvm' version '1.3.31' |
| 5 | id 'org.jetbrains.kotlin.plugin.spring' version '1.3.31' |
| 6 | id "com.palantir.git-version" version "0.12.0-rc2" |
| 7 | id 'com.palantir.docker' version '0.22.1' |
| 8 | } |
| 9 | |
| 10 | apply plugin: 'java' |
| 11 | apply plugin: 'io.spring.dependency-management' |
| 12 | |
| 13 | payapiVersion = gitVersion() |
| 14 | |
| 15 | group = rootProject.group |
| 16 | version = '1' |
| 17 | sourceCompatibility = jdkVersion |
| 18 | def startClass = 'com.supwisdom.agent.YnrccAgentApplication' |
| 19 | |
| 20 | println("Build version: $payapiVersion") |
| 21 | |
| 22 | bootJar { |
| 23 | mainClassName = startClass |
| 24 | manifest { |
| 25 | attributes('YnrccAgent-Version': payapiVersion) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | jar { |
| 30 | baseName = 'YnrccAgent' |
| 31 | } |
| 32 | |
| 33 | docker { |
| 34 | name 'harbor.supwisdom.com/dali/ynrcc:' + version |
| 35 | println(jar.archivePath) |
| 36 | files jar.archivePath |
| 37 | } |
| 38 | |
| 39 | docker.dependsOn(jar) |
| 40 | |
| 41 | dependencies { |
| 42 | |
| 43 | implementation 'org.springframework.boot:spring-boot-starter-web' |
| 44 | implementation 'org.springframework.boot:spring-boot-autoconfigure' |
| 45 | implementation 'commons-codec:commons-codec:1.12' |
| 46 | implementation 'com.jcabi:jcabi-manifests:1.1' |
| 47 | implementation 'org.slf4j:slf4j-parent:1.7.26' |
| 48 | implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' |
| 49 | implementation group: 'com.sun.jersey', name: 'jersey-client', version: '1.19' |
| 50 | implementation group: 'javax.servlet', name: 'jstl', version: '1.2' |
| 51 | implementation group: 'taglibs', name: 'standard', version: '1.1.2' |
| 52 | implementation group: 'commons-codec', name: 'commons-codec', version: '1.6' |
| 53 | implementation 'org.dom4j:dom4j:2.1.1' |
| 54 | |
| 55 | testImplementation 'org.springframework.boot:spring-boot-starter-test' |
| 56 | testImplementation 'io.rest-assured:rest-assured:3.3.0' |
| 57 | testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0' |
| 58 | testImplementation 'org.hamcrest:hamcrest:2.1' |
| 59 | } |
| 60 | |
| 61 | compileKotlin { |
| 62 | kotlinOptions { |
| 63 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 64 | jvmTarget = jdkVersion |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | compileTestKotlin { |
| 69 | kotlinOptions { |
| 70 | freeCompilerArgs = ['-Xjsr305=strict'] |
| 71 | jvmTarget = jdkVersion |
| 72 | } |
| 73 | } |