diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index c4fa499..adc26be 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -6,7 +6,7 @@
-
+
-
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 36b702d..99b225f 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,9 +1,44 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index fd0a087..9a1824f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,54 +1,54 @@
-import com.anthonycicchetti.financetracker.DependencyVersions
-
plugins {
- id 'com.android.application'
- id 'kotlin-android'
- id 'kotlin-android-extensions'
+ id 'com.android.application'
+ id 'kotlin-android'
+ id 'kotlin-android-extensions'
}
repositories {
- google()
- jcenter()
+ google()
+ jcenter()
}
android {
- signingConfigs {
- }
- compileSdkVersion 28
- defaultConfig {
- applicationId "online.anthonycicchetti.financetracker"
- minSdkVersion 24
- targetSdkVersion 28
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfigs {
}
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
+ compileSdkVersion 28
+ defaultConfig {
+ applicationId "online.anthonycicchetti.financetracker"
+ minSdkVersion 24
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+ buildToolsVersion '28.0.3'
}
dependencies {
- implementation project(':common')
- implementation fileTree(include: ['*.jar'], dir: 'libs')
-
- 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:${DependencyVersions.Android.SupportLibrary}"
- implementation 'androidx.appcompat:appcompat:1.0.0'
- implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.3'
- implementation 'com.google.android.material:material:1.0.0'
- androidTestImplementation 'androidx.test:runner:1.1.0'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
+ implementation project(':common')
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
+ implementation(Libs.kotlin_stdlib_jdk8)
+ implementation(Libs.kotlin_reflect)
+ testImplementation(Libs.junit_jupiter_api)
+ testRuntimeOnly(Libs.junit_jupiter_engine)
+ implementation(Libs.material)
+ implementation(Libs.appcompat)
+ implementation(Libs.constraintlayout_solver)
+ androidTestImplementation(Libs.androidx_test_core)
+ androidTestImplementation(Libs.androidx_test_runner)
+ androidTestImplementation(Libs.espresso_core)
}
+
+//tasks.named("clean") {
+// delete(rootProject.buildDir)
+//}
diff --git a/app/gradle.properties b/app/gradle.properties
index fbbd9f8..e756d53 100644
--- a/app/gradle.properties
+++ b/app/gradle.properties
@@ -1 +1,3 @@
-org.gradle.configureondemand=false
\ No newline at end of file
+org.gradle.configureondemand=false
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/app/src/androidTest/java/online/anthonycicchetti/financetracker/ExampleInstrumentedTest.kt b/app/src/androidTest/java/online/anthonycicchetti/financetracker/ExampleInstrumentedTest.kt
index cb4c2b3..1a2c0ba 100644
--- a/app/src/androidTest/java/online/anthonycicchetti/financetracker/ExampleInstrumentedTest.kt
+++ b/app/src/androidTest/java/online/anthonycicchetti/financetracker/ExampleInstrumentedTest.kt
@@ -1,7 +1,7 @@
package online.anthonycicchetti.financetracker
-import android.support.test.InstrumentationRegistry
-import android.support.test.runner.AndroidJUnit4
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
@@ -18,7 +18,7 @@ class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
- val appContext = InstrumentationRegistry.getTargetContext()
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("online.anthonycicchetti.financetracker", appContext.packageName)
}
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 706eea4..c7d8348 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -11,16 +11,17 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:appComponentFactory">
+
+ android:name=".MainActivity"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme.NoActionBar">
-
+
-
+
-
\ No newline at end of file
+
diff --git a/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt b/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt
index c579c61..77e7490 100644
--- a/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt
+++ b/app/src/main/java/online/anthonycicchetti/financetracker/MainActivity.kt
@@ -20,8 +20,17 @@ class MainActivity : AppCompatActivity() {
setSupportActionBar(toolbar)
fab.setOnClickListener { view ->
- Snackbar.make(view, Transaction(Money(3020), category = "Transportation", location = "Arian's", timestamp = "Jan 01, 2018 00:00").toString(), Snackbar.LENGTH_LONG)
- .setAction("Action", null).show()
+ Snackbar.make(
+ view,
+ Transaction(
+ Money(3020),
+ category = "Transportation",
+ location = "Arian's",
+ timestamp = "Jan 01, 2018 00:00"
+ ).toString(),
+ Snackbar.LENGTH_LONG
+ )
+ .setAction("Action", null).show()
}
}
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
index c7bd21d..6348baa 100644
--- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -1,34 +1,34 @@
+ xmlns:aapt="http://schemas.android.com/aapt"
+ android:width="108dp"
+ android:height="108dp"
+ android:viewportHeight="108"
+ android:viewportWidth="108">
+ android:fillType="evenOdd"
+ android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
+ android:strokeColor="#00000000"
+ android:strokeWidth="1">
+ android:endX="78.5885"
+ android:endY="90.9159"
+ android:startX="48.7653"
+ android:startY="61.0927"
+ android:type="linear">
+ android:color="#44000000"
+ android:offset="0.0"/>
+ android:color="#00000000"
+ android:offset="1.0"/>
+ android:fillColor="#FFFFFF"
+ android:fillType="nonZero"
+ android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
+ android:strokeColor="#00000000"
+ android:strokeWidth="1"/>
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
index d5fccc5..e86851d 100644
--- a/app/src/main/res/drawable/ic_launcher_background.xml
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -1,170 +1,170 @@
+ android:width="108dp"
+ android:height="108dp"
+ android:viewportHeight="108"
+ android:viewportWidth="108">
+ android:fillColor="#26A69A"
+ android:pathData="M0,0h108v108h-108z"/>
+ android:fillColor="#00000000"
+ android:pathData="M9,0L9,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,0L19,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M29,0L29,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M39,0L39,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M49,0L49,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M59,0L59,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M69,0L69,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M79,0L79,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M89,0L89,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M99,0L99,108"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,9L108,9"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,19L108,19"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,29L108,29"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,39L108,39"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,49L108,49"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,59L108,59"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,69L108,69"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,79L108,79"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,89L108,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M0,99L108,99"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,29L89,29"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,39L89,39"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,49L89,49"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,59L89,59"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,69L89,69"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M19,79L89,79"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M29,19L29,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M39,19L39,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M49,19L49,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M59,19L59,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M69,19L69,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
+ android:fillColor="#00000000"
+ android:pathData="M79,19L79,89"
+ android:strokeColor="#33FFFFFF"
+ android:strokeWidth="0.8"/>
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index d148497..d56640b 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,33 +1,33 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="online.anthonycicchetti.financetracker.MainActivity">
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+ android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:background="?attr/colorPrimary"
+ app:popupTheme="@style/AppTheme.PopupOverlay"/>
-
+
-
+
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index 10f562a..815e499 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -1,17 +1,17 @@
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior"
+ tools:context="online.anthonycicchetti.financetracker.MainActivity"
+ tools:showIn="@layout/activity_main">
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Hello World!"/>
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
index 7057fb3..0837552 100644
--- a/app/src/main/res/menu/menu_main.xml
+++ b/app/src/main/res/menu/menu_main.xml
@@ -1,10 +1,10 @@
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index eca70cf..bbd3e02 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index eca70cf..bbd3e02 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -1,5 +1,5 @@
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 545b9c6..177cefc 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -13,8 +13,8 @@
- true
-
+
-
+
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index d020545..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,21 +0,0 @@
-import com.anthonycicchetti.financetracker.DependencyVersions
-
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- repositories {
- google()
- jcenter()
- }
- dependencies {
- classpath "com.android.tools.build:gradle:${DependencyVersions.Android.Gradle}"
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependencyVersions.Kotlin}"
-
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..bd6d915
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,19 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath(Libs.com_android_tools_build_gradle)
+ classpath(Libs.kotlin_gradle_plugin)
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+plugins {
+ id("jmfayard.github.io.gradle-kotlin-dsl-libs") version "0.2.6" // $ ./gradlew syncLibs
+}
\ No newline at end of file
diff --git a/buildSrc/.gitignore b/buildSrc/.gitignore
new file mode 100644
index 0000000..ea958e5
--- /dev/null
+++ b/buildSrc/.gitignore
@@ -0,0 +1,3 @@
+
+.gradle/
+build/
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index abcb847..15e0d14 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
- kotlin("jvm") version "1.2.61"
+ kotlin("jvm") version "1.3.0"
}
repositories {
@@ -10,8 +10,8 @@ repositories {
google()
}
-val android_gradle_plugin_version = "3.1.3"
-val kotlin_version = "1.2.61"
+val android_gradle_plugin_version = "3.2.1"
+val kotlin_version = "1.3.0"
dependencies {
implementation("com.android.tools.build:gradle:$android_gradle_plugin_version")
@@ -23,4 +23,4 @@ tasks.withType {
kotlinOptions {
jvmTarget = "1.8"
}
-}
\ No newline at end of file
+}
diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts
new file mode 100644
index 0000000..e69de29
diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt
new file mode 100644
index 0000000..bb0de64
--- /dev/null
+++ b/buildSrc/src/main/kotlin/Libs.kt
@@ -0,0 +1,94 @@
+import kotlin.String
+
+/**
+ * Generated by [gradle-kotlin-dsl-libs](https://github.com/jmfayard/gradle-kotlin-dsl-libs)
+ *
+ * Run again
+ * `$ ./gradlew syncLibs`
+ * to update this file */
+object Libs {
+ /**
+ * [appcompat website](http://developer.android.com/tools/extras/support-library.html) */
+ const val appcompat: String = "androidx.appcompat:appcompat:" + Versions.appcompat
+
+ /**
+ * [constraintlayout-solver website](http://tools.android.com) */
+ const val constraintlayout_solver: String =
+ "androidx.constraintlayout:constraintlayout-solver:" + Versions.constraintlayout_solver
+
+ /**
+ * [espresso-core website](https://developer.android.com/testing) */
+ const val espresso_core: String =
+ "androidx.test.espresso:espresso-core:" + Versions.espresso_core
+
+ /**
+ * [core website](https://developer.android.com/testing) */
+ const val androidx_test_core: String = "androidx.test:core:" + Versions.androidx_test_core
+
+ /**
+ * [runner website](https://developer.android.com/testing) */
+ const val androidx_test_runner: String = "androidx.test:runner:" + Versions.androidx_test_runner
+
+ /**
+ * [aapt2 website](https://developer.android.com/studio) */
+ const val aapt2: String = "com.android.tools.build:aapt2:" + Versions.aapt2
+
+ const val com_android_tools_build_gradle: String =
+ "com.android.tools.build:gradle:" + Versions.com_android_tools_build_gradle
+
+ /**
+ * [lint-gradle website](https://developer.android.com/studio) */
+ const val lint_gradle: String = "com.android.tools.lint:lint-gradle:" + Versions.lint_gradle
+
+ /**
+ * [jackson-module-kotlin website](https://github.com/FasterXML/jackson-module-kotlin) */
+ const val jackson_module_kotlin: String =
+ "com.fasterxml.jackson.module:jackson-module-kotlin:" + Versions.jackson_module_kotlin
+
+ const val shadow: String = "com.github.jengelman.gradle.plugins:shadow:" + Versions.shadow
+
+ const val com_github_johnrengelman_shadow_gradle_plugin: String =
+ "com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:" + Versions.com_github_johnrengelman_shadow_gradle_plugin
+
+ /**
+ * [material website](http://developer.android.com/tools/extras/support-library.html) */
+ const val material: String = "com.google.android.material:material:" + Versions.material
+
+ const val jmfayard_github_io_gradle_kotlin_dsl_libs_gradle_plugin: String =
+ "jmfayard.github.io.gradle-kotlin-dsl-libs:jmfayard.github.io.gradle-kotlin-dsl-libs.gradle.plugin:" + Versions.jmfayard_github_io_gradle_kotlin_dsl_libs_gradle_plugin
+
+ /**
+ * [kotlin-android-extensions website](https://kotlinlang.org/) */
+ const val kotlin_android_extensions: String =
+ "org.jetbrains.kotlin:kotlin-android-extensions:" + Versions.org_jetbrains_kotlin
+
+ /**
+ * [kotlin-gradle-plugin website](https://kotlinlang.org/) */
+ const val kotlin_gradle_plugin: String =
+ "org.jetbrains.kotlin:kotlin-gradle-plugin:" + Versions.org_jetbrains_kotlin
+
+ /**
+ * [kotlin-reflect website](https://kotlinlang.org/) */
+ const val kotlin_reflect: String =
+ "org.jetbrains.kotlin:kotlin-reflect:" + Versions.org_jetbrains_kotlin
+
+ /**
+ * [kotlin-scripting-compiler-embeddable website](https://kotlinlang.org/) */
+ const val kotlin_scripting_compiler_embeddable: String =
+ "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:" + Versions.org_jetbrains_kotlin
+
+ /**
+ * [kotlin-stdlib-jdk8 website](https://kotlinlang.org/) */
+ const val kotlin_stdlib_jdk8: String =
+ "org.jetbrains.kotlin:kotlin-stdlib-jdk8:" + Versions.org_jetbrains_kotlin
+
+ /**
+ * [junit-jupiter-api website](http://junit.org/junit5/) */
+ const val junit_jupiter_api: String =
+ "org.junit.jupiter:junit-jupiter-api:" + Versions.org_junit_jupiter
+
+ /**
+ * [junit-jupiter-engine website](http://junit.org/junit5/) */
+ const val junit_jupiter_engine: String =
+ "org.junit.jupiter:junit-jupiter-engine:" + Versions.org_junit_jupiter
+}
diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt
new file mode 100644
index 0000000..80ec513
--- /dev/null
+++ b/buildSrc/src/main/kotlin/Versions.kt
@@ -0,0 +1,54 @@
+import kotlin.String
+
+/**
+ * Find which updates are available by running
+ * `$ ./gradlew syncLibs`
+ * This will only update the comments.
+ *
+ * YOU are responsible for updating manually the dependency version. */
+object Versions {
+ const val appcompat: String = "1.0.0"
+
+ const val constraintlayout_solver: String = "1.1.3"
+
+ const val espresso_core: String = "3.1.0"
+
+ const val androidx_test_core: String = "1.0.0"
+
+ const val androidx_test_runner: String = "1.1.0"
+
+ const val aapt2: String = "3.2.1-4818971"
+
+ const val com_android_tools_build_gradle: String = "3.2.1"
+
+ const val lint_gradle: String = "26.2.1"
+
+ const val jackson_module_kotlin: String = "2.9.7"
+
+ const val shadow: String = "4.0.2"
+
+ const val com_github_johnrengelman_shadow_gradle_plugin: String = "4.0.2"
+
+ const val material: String = "1.0.0"
+
+ const val jmfayard_github_io_gradle_kotlin_dsl_libs_gradle_plugin: String = "0.2.6"
+
+ const val org_jetbrains_kotlin: String = "1.3.0"
+
+ const val org_junit_jupiter: String = "5.3.1"
+
+ /**
+ *
+ * To update Gradle, edit the wrapper file at path:
+ * ./gradle/wrapper/gradle-wrapper.properties
+ */
+ object Gradle {
+ const val runningVersion: String = "4.10.2"
+
+ const val currentVersion: String = "4.10.2"
+
+ const val nightlyVersion: String = "5.1-20181103000035+0000"
+
+ const val releaseCandidate: String = "5.0-rc-1"
+ }
+}
diff --git a/buildSrc/src/main/kotlin/com/anthonycicchetti/financetracker/DependencyVersions.kt b/buildSrc/src/main/kotlin/com/anthonycicchetti/financetracker/DependencyVersions.kt
deleted file mode 100644
index 7f66c4b..0000000
--- a/buildSrc/src/main/kotlin/com/anthonycicchetti/financetracker/DependencyVersions.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.anthonycicchetti.financetracker
-
-object DependencyVersions {
- const val Kotlin = "1.2.70"
- const val Jupiter = "5.2.0"
-
- const val Jackson = "2.9.6"
-
- object Server {
- const val Capsule = "1.0.2"
- }
-
- object Android {
- const val SupportLibrary = "28.0.0"
- const val Gradle = "3.2.0"
- }
-}
diff --git a/common/build.gradle.kts b/common/build.gradle.kts
index f5c90be..770be43 100644
--- a/common/build.gradle.kts
+++ b/common/build.gradle.kts
@@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-import com.anthonycicchetti.financetracker.DependencyVersions
plugins {
`java-library`
@@ -16,10 +15,11 @@ repositories {
}
dependencies {
- api("com.fasterxml.jackson.module:jackson-module-kotlin:${DependencyVersions.Jackson}")
+ api(Libs.jackson_module_kotlin)
+ api(Libs.kotlin_reflect)
- testImplementation("org.junit.jupiter:junit-jupiter-api:${DependencyVersions.Jupiter}")
- testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${DependencyVersions.Jupiter}")
+ testImplementation(Libs.junit_jupiter_api)
+ testRuntimeOnly(Libs.junit_jupiter_engine)
}
tasks.withType {
@@ -28,6 +28,10 @@ tasks.withType {
}
}
-tasks.named("test"){
+tasks.named("test") {
useJUnitPlatform()
-}
\ No newline at end of file
+}
+
+tasks.named("clean") {
+ delete(rootProject.buildDir)
+}
diff --git a/common/src/main/kotlin/Money.kt b/common/src/main/kotlin/Money.kt
index 89f26c4..5571566 100644
--- a/common/src/main/kotlin/Money.kt
+++ b/common/src/main/kotlin/Money.kt
@@ -29,11 +29,15 @@ data class Money(@JsonValue private val cents: Int) {
val dollarSplit = splitString.get(0).split('$')
return if (dollarSplit.get(0) == "-") {
- fromDollarsAndCents(dollars = dollarSplit.get(1).toInt().unaryMinus(),
- cents = cents)
+ fromDollarsAndCents(
+ dollars = dollarSplit.get(1).toInt().unaryMinus(),
+ cents = cents
+ )
} else {
- fromDollarsAndCents(dollars = dollarSplit.get(1).toInt(),
- cents = cents)
+ fromDollarsAndCents(
+ dollars = dollarSplit.get(1).toInt(),
+ cents = cents
+ )
}
}
}
diff --git a/common/src/main/kotlin/Transaction.kt b/common/src/main/kotlin/Transaction.kt
index 2238e42..cc0e99c 100644
--- a/common/src/main/kotlin/Transaction.kt
+++ b/common/src/main/kotlin/Transaction.kt
@@ -1,10 +1,12 @@
import com.fasterxml.jackson.module.kotlin.*
-data class Transaction(val cost: Money,
- val category: String,
- val subcategory: String = "",
- val location: String,
- val timestamp: String) {
+data class Transaction(
+ val cost: Money,
+ val category: String,
+ val subcategory: String = "",
+ val location: String,
+ val timestamp: String
+) {
fun serialize(): String {
val mapper = jacksonObjectMapper().registerModule(KotlinModule())
return mapper.writeValueAsString(this)
diff --git a/gradle.properties b/gradle.properties
index e37c10d..e437a0b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -12,6 +12,5 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
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/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 1353677..5ca3858 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradlew b/gradlew
index cccdd3d..af6708f 100755
--- a/gradlew
+++ b/gradlew
@@ -28,7 +28,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
+DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
diff --git a/gradlew.bat b/gradlew.bat
index f955316..6d57edc 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
+set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
diff --git a/server/build.gradle b/server/build.gradle
deleted file mode 100644
index 731f41f..0000000
--- a/server/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-import com.anthonycicchetti.financetracker.DependencyVersions
-
-buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${DependencyVersions.Kotlin}"
- }
-}
-
-plugins {
- id "us.kirchmeier.capsule" version '1.0.2'
- id 'application'
- id 'kotlin'
-}
-
-
-group 'online.anthonycicchetti'
-version '0.1.0'
-
-mainClassName = 'MainKt'
-
-repositories {
- mavenCentral()
- google()
- jcenter()
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${DependencyVersions.Kotlin}"
- implementation project(":common")
-}
-
-compileKotlin {
- kotlinOptions.jvmTarget = "1.8"
-}
-compileTestKotlin {
- kotlinOptions.jvmTarget = "1.8"
-}
-
-task fatCapsule(type: FatCapsule) {
- applicationClass 'MainKt'
-}
\ No newline at end of file
diff --git a/server/build.gradle.kts b/server/build.gradle.kts
new file mode 100644
index 0000000..475b35f
--- /dev/null
+++ b/server/build.gradle.kts
@@ -0,0 +1,53 @@
+import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+
+buildscript {
+ repositories {
+ mavenCentral()
+ jcenter()
+ }
+ dependencies {
+ classpath(Libs.kotlin_gradle_plugin)
+ classpath(Libs.shadow)
+ }
+}
+
+plugins {
+ id("com.github.johnrengelman.shadow") version "4.0.2"
+ id("application")
+ id("kotlin")
+}
+
+
+application {
+ group = "com.anthonyciccheti"
+ version = "0.1.0"
+ mainClassName = "MainKt"
+}
+
+repositories {
+ mavenCentral()
+ google()
+ jcenter()
+}
+
+dependencies {
+ implementation(Libs.kotlin_stdlib_jdk8)
+ implementation(project(":common"))
+}
+
+tasks.withType {
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+}
+
+tasks.withType {
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+}
+
+tasks.named("clean") {
+ delete(rootProject.buildDir)
+}
+
diff --git a/server/settings.gradle b/server/settings.gradle
deleted file mode 100644
index c9d3ca4..0000000
--- a/server/settings.gradle
+++ /dev/null
@@ -1,2 +0,0 @@
-rootProject.name = 'server'
-
diff --git a/server/settings.gradle.kts b/server/settings.gradle.kts
new file mode 100644
index 0000000..ff38642
--- /dev/null
+++ b/server/settings.gradle.kts
@@ -0,0 +1,2 @@
+rootProject.name = "server"
+
diff --git a/server/src/main/kotlin/Main.kt b/server/src/main/kotlin/Main.kt
index a89c953..16f4778 100644
--- a/server/src/main/kotlin/Main.kt
+++ b/server/src/main/kotlin/Main.kt
@@ -1,10 +1,19 @@
fun main(args: Array) {
- println(Transaction(Money(3020), category = "Transportation", location = "Arian's", timestamp = "Jan 01, 2018 00:00"))
+ println(
+ Transaction(
+ Money(3020),
+ category = "Transportation",
+ location = "Arian's",
+ timestamp = "Jan 01, 2018 00:00"
+ )
+ )
- val t = Transaction.fromJSON("{\"cost\": 2168," +
- " \"category\": \"Transportation\"," +
- " \"location\": \"Arian's\"," +
- " \"timestamp\": \"Jan 01, 2018 00:00\"}")
+ val t = Transaction.fromJSON(
+ "{\"cost\": 2168," +
+ " \"category\": \"Transportation\"," +
+ " \"location\": \"Arian's\"," +
+ " \"timestamp\": \"Jan 01, 2018 00:00\"}"
+ )
println(t)