Skip to content

Commit

Permalink
Migrate to gradle kotlin DSL and do some misc. upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrynos committed Oct 1, 2023
1 parent de42341 commit bf56d12
Show file tree
Hide file tree
Showing 20 changed files with 340 additions and 377 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/compiler.xml
/.idea/gradle.xml
/.idea/jarRepositories.xml
/.idea/misc.xml
/.idea/vcs.xml
.DS_Store
/build
/captures
Expand Down
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 1 addition & 21 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 0 additions & 122 deletions app/build.gradle

This file was deleted.

122 changes: 122 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
* _____ _ _ _ _ _
* / ___| | (_) | | (_) | |
* \ `--.| |__ ___ _ __ _ __ _ _ __ __ _| | _ ___| |_
* `--. \ '_ \ / _ \| '_ \| '_ \| | '_ \ / _` | | | / __| __|
* /\__/ / | | | (_) | |_) | |_) | | | | | (_| | |___| \__ \ |_
* \____/|_| |_|\___/| .__/| .__/|_|_| |_|\__, \_____/_|___/\__|
* | | | | __/ |
* |_| |_| |___/
*
* Copyright (C) 2021-2022 Sebastian Göls
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License only
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
id("com.google.devtools.ksp")
}

android {
namespace = "pl.edu.pjwstk.s999844.shoppinglist"
compileSdk = 34

defaultConfig {
applicationId = "pl.edu.pjwstk.s999844.shoppinglist"
minSdk = 25
targetSdk = 34
versionCode = 17
versionName = "v1.15.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

vectorDrawables {
useSupportLibrary = true
}
javaCompileOptions {
annotationProcessorOptions {
argument("room.incremental", "true")
argument("room.schemaLocation", "$projectDir/schemas")
}
}
}
applicationVariants.all {
resValue("string", "versionName", versionName)
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
viewBinding = true
dataBinding = true
}
dataBinding.enable = true
viewBinding.enable = true
composeOptions {
kotlinCompilerExtensionVersion = "1.4.3"
}
lint {
abortOnError = true
warningsAsErrors = true
checkAllWarnings = true
showAll = true
htmlReport = true
}
}

dependencies {
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")

val androidxNavigationVersion = "2.7.3"
implementation("androidx.navigation:navigation-fragment-ktx:$androidxNavigationVersion")
implementation("androidx.navigation:navigation-ui-ktx:$androidxNavigationVersion")

val roomVersion = "2.5.2"
implementation("androidx.room:room-runtime:$roomVersion")
annotationProcessor("androidx.room:room-compiler:$roomVersion")
ksp("androidx.room:room-compiler:$roomVersion")

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.9.0")
// TODO - migrate to material3
// implementation("androidx.compose.material3:material3")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

implementation("androidx.activity:activity-compose:1.7.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
}
14 changes: 10 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,19 @@
~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/appName"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/Theme.ShoppingList">
android:theme="@style/Theme.ShoppingList"
tools:targetApi="31">
<activity
android:name=".activities.AddItemActivity"
android:exported="true"
Expand All @@ -34,9 +40,9 @@
<category android:name="android.intent.category.BROWSABLE" />

<data
android:scheme="@string/shareScheme"
android:host="@string/shareHost"
android:pathPrefix="@string/sharePath" />
android:pathPrefix="@string/sharePath"
android:scheme="@string/shareScheme" />
</intent-filter>
</activity>
<activity
Expand Down
Binary file removed app/src/main/ic_launcher-playstore.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.Spinner
import pl.edu.pjwstk.s999844.shoppinglist.BuildConfig
import pl.edu.pjwstk.s999844.shoppinglist.R
import pl.edu.pjwstk.s999844.shoppinglist.adapters.DescriptiveSettingSpinnerAdapter
import pl.edu.pjwstk.s999844.shoppinglist.adapters.SpinnerItemSelectedListener
Expand All @@ -43,13 +42,13 @@ class OptionsActivity : AbstractShoppingActivity() {
companion object {
private const val RELEASES_PAGE_LINK = "https://github.com/Abrynos/ShoppingList/releases"

private const val CURRENT_RELEASE_LINK = "$RELEASES_PAGE_LINK/tag/${BuildConfig.VERSION_NAME}"
private const val LATEST_RELEASE_LINK = "$RELEASES_PAGE_LINK/latest"

private val CURRENT_RELEASE_URI: Uri = Uri.parse(CURRENT_RELEASE_LINK)
private val LATEST_RELEASE_URI: Uri = Uri.parse(LATEST_RELEASE_LINK)
}

private val currentReleaseLink: String by lazy { "$RELEASES_PAGE_LINK/tag/${getString(R.string.versionName)}" }
private val currentReleaseUri: Uri by lazy { Uri.parse(currentReleaseLink) }

private val binding by viewBinding(ActivityOptionsBinding::inflate)

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -94,7 +93,7 @@ class OptionsActivity : AbstractShoppingActivity() {
}

@Suppress("UNUSED_PARAMETER")
fun onClickCurrentVersion(view: View) = openUriInBrowser(CURRENT_RELEASE_URI)
fun onClickCurrentVersion(view: View) = openUriInBrowser(currentReleaseUri)

@Suppress("UNUSED_PARAMETER")
fun onClickLatestRelease(view: View) = openUriInBrowser(LATEST_RELEASE_URI)
Expand Down
Loading

0 comments on commit bf56d12

Please sign in to comment.