- 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.
推薦閱讀
- DevOps:軟件架構師行動指南
- Deploying Node.js
- UML和模式應用(原書第3版)
- Python數(shù)據(jù)分析基礎
- 垃圾回收的算法與實現(xiàn)
- 跟老齊學Python:輕松入門
- 新編Premiere Pro CC從入門到精通
- Big Data Analytics
- Spring Boot Cookbook
- Selenium Testing Tools Cookbook(Second Edition)
- 分布式數(shù)據(jù)庫原理、架構與實踐
- 單片機原理及應用技術
- Python預測之美:數(shù)據(jù)分析與算法實戰(zhàn)(雙色)
- R語言實戰(zhàn)(第2版)
- Java核心技術速學版(第3版)