官术网_书友最值得收藏!

  • Kotlin Blueprints
  • Ashish Belagali Hardik Trivedi Akshay Chordiya
  • 177字
  • 2021-07-02 21:50:15

Completing the Gradle script

Similarly, we add more dependencies of the pre-requisite components. You can look at them in the complete Gradle script build.gradle:

    group 'com.book'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.1.50'
ext.spring_boot_version = '1.5.7.RELEASE'

repositories {
mavenCentral()
}
dependencies {
// Kotlin-Gradle Plugin
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Opens all the classes - Explained later
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version"
classpath
"org.springframework.boot:
spring-boot-gradle-plugin:
$spring_boot_version"
}
}

apply plugin: 'kotlin'
apply plugin: "kotlin-spring"
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.8

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
// For Exposed library
maven { url "https://dl.bintray.com/kotlin/exposed" }
}

dependencies {
// Kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"

// Spring
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-jdbc'
compile 'org.springframework.boot:spring-boot-devtools'

// Exposed
compile 'org.jetbrains.exposed:exposed:0.8.5'
// For transaction support
compile 'org.jetbrains.exposed:spring-transaction:0.8.5'

// Object Mapping
compile "com.fasterxml.jackson.module:jackson-module-kotlin"
compile "com.github.mayconbordin:postgis-geojson:1.1"

// Database
compile "org.postgresql:postgresql:9.4.1208"
compile "net.postgis:postgis-jdbc:2.2.1"

// Testing

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.springframework.boot:spring-boot-starter-test"
}

compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

Recently the Gradle Team announced support for writing the Gradle script in Kotlin instead of Groovy lang. Read more about it at https://blog.gradle.org/kotlin-meets-gradle.

主站蜘蛛池模板: 永新县| 靖远县| 自贡市| 东乌珠穆沁旗| 西藏| 阳新县| 抚州市| 惠州市| 海安县| 万荣县| 类乌齐县| 湖口县| 鄂伦春自治旗| 阿合奇县| 凤凰县| 邵阳县| 上高县| 大埔区| 浏阳市| 中西区| 丰城市| 巫山县| 新密市| 思南县| 襄垣县| 沙洋县| 香格里拉县| 临漳县| 新野县| 英山县| 屏东市| 漳浦县| 民权县| 桃江县| 潼南县| 三河市| 桐庐县| 正阳县| 内黄县| 威海市| 炎陵县|