diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 7899f30..5e8b638 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,6 +11,7 @@ diff --git a/.idea/modules.xml b/.idea/modules.xml index 0e72ba0..cf4ce52 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -4,6 +4,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index a097298..adb9283 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,9 +1,16 @@ +import com.anthonycicchetti.financetracker.DependencyVersions + apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' +repositories { + google() + jcenter() +} + android { signingConfigs { } @@ -31,12 +38,17 @@ android { dependencies { implementation project(':common') implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${DependencyVersions.Kotlin}" + implementation "org.jetbrains.kotlin:kotlin-reflect:${DependencyVersions.Kotlin}" + + testImplementation "org.junit.jupiter:junit-jupiter-api:${DependencyVersions.Jupiter}" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${DependencyVersions.Jupiter}" + implementation 'com.android.support:design:27.1.0' implementation 'androidx.appcompat:appcompat:1.0.0-beta01' implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.2' implementation 'com.google.android.material:material:1.0.0-beta01' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.0-alpha3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha3' + androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' } diff --git a/app/src/test/java/online/anthonycicchetti/financetracker/ExampleUnitTest.kt b/app/src/test/java/online/anthonycicchetti/financetracker/ExampleUnitTest.kt index fc354c7..40615fc 100644 --- a/app/src/test/java/online/anthonycicchetti/financetracker/ExampleUnitTest.kt +++ b/app/src/test/java/online/anthonycicchetti/financetracker/ExampleUnitTest.kt @@ -1,8 +1,8 @@ package online.anthonycicchetti.financetracker -import org.junit.Test - -import org.junit.Assert.* +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertThrows +import org.junit.jupiter.api.Test /** * Example local unit test, which will execute on the development machine (host). diff --git a/build.gradle b/build.gradle index 3b1c14e..d7a9dd4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.2.51' + ext.kotlin_version = '1.2.60' repositories { google() jcenter() @@ -15,38 +15,6 @@ buildscript { } } -allprojects { - repositories { - google() - jcenter() - } - - ext.kotlin_version = '1.2.51' -} - -subprojects.findAll { it.name.equalsIgnoreCase("common") or it.name.equalsIgnoreCase("server")}.each { p -> - configure(p) { - apply plugin: 'kotlin' - - dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"){ - because 'This is the latest version of kotlin?' - } - - implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"){ - because 'This is required by Jackson' - } - - testImplementation 'org.junit.jupiter:junit-jupiter-api:5.2.0' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.2.0' - } - - test { - useJUnitPlatform() - } - } -} - task clean(type: Delete) { delete rootProject.buildDir } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000..c4453c6 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,36 @@ +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" + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyVersions.kt b/buildSrc/src/main/kotlin/DependencyVersions.kt new file mode 100644 index 0000000..3c7332a --- /dev/null +++ b/buildSrc/src/main/kotlin/DependencyVersions.kt @@ -0,0 +1,12 @@ +package com.anthonycicchetti.financetracker + +object DependencyVersions { + const val Kotlin = "1.2.60" + const val Jupiter = "5.2.0" + + const val Jackson = "2.9.6" + + object Server { + const val Capsule = "1.0.2" + } +} diff --git a/common/build.gradle b/common/build.gradle index 853a778..aa67161 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,9 +1,11 @@ +import com.anthonycicchetti.financetracker.DependencyVersions + buildscript { repositories { mavenCentral() } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependencyVersions.Kotlin}" } } @@ -15,10 +17,15 @@ apply plugin: 'kotlin' repositories { mavenCentral() + google() + jcenter() } dependencies { - api 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.+' + 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 { @@ -27,3 +34,7 @@ compileKotlin { compileTestKotlin { kotlinOptions.jvmTarget = "1.8" } + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index d0bfef7..e37c10d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,7 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -org.gradle.configureondemand=false \ No newline at end of file +org.gradle.configureondemand=false + +# Makes gradle run builds in parallel whenever possible +org.gradle.parallel=true \ No newline at end of file diff --git a/server/build.gradle b/server/build.gradle index dfe2ed6..89dfc58 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -1,9 +1,11 @@ +import com.anthonycicchetti.financetracker.DependencyVersions + buildscript { repositories { mavenCentral() } dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependencyVersions.Kotlin}" } } @@ -20,11 +22,13 @@ version '0.1.0' mainClassName = 'MainKt' repositories { - mavenCentral() + mavenCentral() + google() + jcenter() } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${DependencyVersions.Kotlin}" implementation project(":common") }