Added kotlin DSL buildscripts for common and buildSrc

This commit is contained in:
Anthony Cicchetti 2018-09-03 13:12:01 -04:00
parent eb32d38002
commit e2aed98ebd
7 changed files with 59 additions and 81 deletions

6
.idea/kotlinScripting.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinScriptingSettings">
<option name="autoReloadEnabled" value="true" />
</component>
</project>

View file

@ -1,36 +0,0 @@
buildscript {
ext.kotlin_version = '1.2.60'
ext.android_gradle_plugin_version = '3.1.3'
repositories {
jcenter()
google()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
jcenter()
google()
}
apply plugin: 'java'
apply plugin: 'kotlin'
dependencies {
implementation "com.android.tools.build:gradle:$android_gradle_plugin_version"
implementation "com.android.tools.build:gradle-api:$android_gradle_plugin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}

18
buildSrc/build.gradle.kts Normal file
View file

@ -0,0 +1,18 @@
plugins {
java
kotlin("jvm") version "1.2.61"
}
repositories {
jcenter()
google()
}
val android_gradle_plugin_version = "3.1.3"
val kotlin_version = "1.2.61"
dependencies {
implementation("com.android.tools.build:gradle:$android_gradle_plugin_version")
implementation("com.android.tools.build:gradle-api:$android_gradle_plugin_version")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version")
}

View file

@ -1,7 +1,7 @@
package com.anthonycicchetti.financetracker
object DependencyVersions {
const val Kotlin = "1.2.60"
const val Kotlin = "1.2.61"
const val Jupiter = "5.2.0"
const val Jackson = "2.9.6"

View file

@ -1,43 +0,0 @@
import com.anthonycicchetti.financetracker.DependencyVersions
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependencyVersions.Kotlin}"
}
}
plugins {
id 'java-library'
id 'kotlin'
}
group 'online.anthonycicchetti'
version '0.1.0'
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
api "com.fasterxml.jackson.module:jackson-module-kotlin:${DependencyVersions.Jackson}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${DependencyVersions.Jupiter}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${DependencyVersions.Jupiter}"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
test {
useJUnitPlatform()
}

33
common/build.gradle.kts Normal file
View file

@ -0,0 +1,33 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.anthonycicchetti.financetracker.DependencyVersions
plugins {
`java-library`
kotlin("jvm")
}
group = "com.anthonycicchetti.financetracker"
version = "0.1.0"
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
api("com.fasterxml.jackson.module:jackson-module-kotlin:${DependencyVersions.Jackson}")
testImplementation("org.junit.jupiter:junit-jupiter-api:${DependencyVersions.Jupiter}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${DependencyVersions.Jupiter}")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.named<Test>("test"){
useJUnitPlatform()
}

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists