- 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.
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- Google Flutter Mobile Development Quick Start Guide
- 編寫高質量代碼:改善C程序代碼的125個建議
- Functional Programming in JavaScript
- 區塊鏈:以太坊DApp開發實戰
- Java:High-Performance Apps with Java 9
- R語言與網絡輿情處理
- Swift 4 Protocol-Oriented Programming(Third Edition)
- Hands-On Nuxt.js Web Development
- Kotlin Programming By Example
- Python一行流:像專家一樣寫代碼
- Learning Bootstrap 4(Second Edition)
- HTML5移動前端開發基礎與實戰(微課版)
- Android技術內幕(系統卷)
- 微信小程序開發邊做邊學(微課視頻版)