Skip to content

Commit 9fad0c7

Browse files
authored
Merge pull request #239 from TheCodeMonks/Refactor-app
Migrate from `groovy` to `kts` #182
2 parents 26ae940 + b01839d commit 9fad0c7

File tree

13 files changed

+270
-205
lines changed

13 files changed

+270
-205
lines changed

.github/workflows/android_build.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
name: Android Build
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
28

3-
on: pull_request
49

510
jobs:
611
build:
@@ -10,14 +15,26 @@ jobs:
1015
steps:
1116
- uses: actions/checkout@v1
1217

13-
- name: Set Up JDK
18+
- name: 🧱 Set Up JDK
1419
uses: actions/setup-java@v1
1520
with:
16-
java-version: 1.8
17-
21+
java-version: 11
1822

19-
- name: Run Tests
23+
- name: 🧪 Run Tests
2024
run: ./gradlew test
2125

22-
- name: Build Project
23-
run: ./gradlew assemble
26+
- name: 🛠 Build Project with Spotless Check
27+
run: ./gradlew spotlessCheck assemble lintDebug --stacktrace
28+
29+
- name: ⏳ Build with Gradle
30+
run: ./gradlew build
31+
32+
- name: 🏗 Build APK
33+
run: bash ./gradlew assembleDebug --stacktrace
34+
35+
- name: 🚀 Upload APK 📱
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: app
39+
path: app/build/outputs/apk/debug/app-debug.apk
40+
retention-days: 3

.github/workflows/lint.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.idea/deploymentTargetDropDown.xml

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 0 additions & 135 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
*
3+
* *
4+
* * * MIT License
5+
* * *
6+
* * * Copyright (c) 2020 Spikey Sanju
7+
* * *
8+
* * * Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* * * of this software and associated documentation files (the "Software"), to deal
10+
* * * in the Software without restriction, including without limitation the rights
11+
* * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* * * copies of the Software, and to permit persons to whom the Software is
13+
* * * furnished to do so, subject to the following conditions:
14+
* * *
15+
* * * The above copyright notice and this permission notice shall be included in all
16+
* * * copies or substantial portions of the Software.
17+
* * *
18+
* * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
* * * SOFTWARE.
25+
* *
26+
*
27+
*
28+
*/
29+
30+
plugins {
31+
id("com.android.application")
32+
id("kotlin-android")
33+
id("kotlin-kapt")
34+
id("androidx.navigation.safeargs.kotlin")
35+
id("dagger.hilt.android.plugin")
36+
}
37+
38+
android {
39+
compileSdk = 31
40+
buildToolsVersion = "30.0.3"
41+
42+
defaultConfig {
43+
applicationId = "thecodemonks.org.nottzapp"
44+
minSdk = 21
45+
targetSdk = 31
46+
versionCode = 1
47+
versionName = "1.4.0"
48+
49+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
50+
vectorDrawables {
51+
useSupportLibrary = true
52+
}
53+
}
54+
55+
lint {
56+
checkReleaseBuilds = false
57+
abortOnError = true
58+
}
59+
60+
buildFeatures {
61+
viewBinding = true
62+
}
63+
64+
buildTypes {
65+
release {
66+
isMinifyEnabled = true
67+
isShrinkResources = true
68+
proguardFiles(
69+
getDefaultProguardFile("proguard-android.txt"),
70+
"proguard-rules.pro"
71+
)
72+
}
73+
}
74+
75+
compileOptions {
76+
sourceCompatibility = JavaVersion.VERSION_11
77+
targetCompatibility = JavaVersion.VERSION_11
78+
}
79+
80+
kotlinOptions {
81+
jvmTarget = "11"
82+
}
83+
}
84+
85+
dependencies {
86+
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.31")
87+
implementation("androidx.core:core-ktx:1.7.0")
88+
implementation("androidx.appcompat:appcompat:1.3.1")
89+
implementation("com.google.android.material:material:1.4.0")
90+
implementation("androidx.constraintlayout:constraintlayout:2.1.1")
91+
implementation("androidx.legacy:legacy-support-v4:1.0.0")
92+
testImplementation("junit:junit:4.13.2")
93+
androidTestImplementation("androidx.test.ext:junit:1.1.3")
94+
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
95+
96+
// Architectural Components
97+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
98+
99+
// Room
100+
implementation("androidx.room:room-runtime:2.3.0")
101+
kapt("androidx.room:room-compiler:2.3.0")
102+
kapt("org.xerial:sqlite-jdbc:3.36.0.3")
103+
104+
// Kotlin Extensions and Coroutines support for Room
105+
implementation("androidx.room:room-ktx:2.3.0")
106+
107+
// Coroutines
108+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
109+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2-native-mt")
110+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.2-native-mt")
111+
112+
// Coroutine Lifecycle Scopes
113+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
114+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1")
115+
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")
116+
117+
// activity & fragment ktx
118+
implementation("androidx.fragment:fragment-ktx:1.3.6")
119+
implementation("androidx.activity:activity-ktx:1.4.0-rc01")
120+
implementation("androidx.appcompat:appcompat:1.4.0-beta01")
121+
122+
// Navigation Components
123+
implementation("androidx.navigation:navigation-fragment-ktx:2.3.5")
124+
implementation("androidx.navigation:navigation-ui-ktx:2.3.5")
125+
126+
// material design
127+
implementation("com.google.android.material:material:1.4.0")
128+
implementation("androidx.recyclerview:recyclerview:1.2.1")
129+
130+
// Preference DataStore
131+
implementation("androidx.datastore:datastore-preferences:1.0.0")
132+
133+
// Lottie Animation Library
134+
implementation("com.airbnb.android:lottie:4.2.0")
135+
136+
// Hilt
137+
implementation("com.google.dagger:hilt-android:2.39.1")
138+
kapt("com.google.dagger:hilt-android-compiler:2.39.1")
139+
kapt("androidx.hilt:hilt-compiler:1.0.0")
140+
}

app/proguard-rules.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html
@@ -18,4 +18,4 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)