Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplatform: a new beginning #56

Merged
merged 19 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 0 additions & 70 deletions app/build.gradle

This file was deleted.

74 changes: 74 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
plugins {
id("com.android.application")
kotlin("android")
id("kotlin-android")
}

android {
compileSdk = 33

defaultConfig {
applicationId = "com.katiearose.sobriety"
minSdk = 21
targetSdk = 33
versionCode = 18
versionName = "v7.0.0"
setProperty("archivesBaseName", "Sobriety $versionName")
}

buildTypes {
release {
isDebuggable = false
isMinifyEnabled = true
isShrinkResources = true
proguardFiles += getDefaultProguardFile("proguard-android.txt")
proguardFiles += file("proguard-rules.pro")
}

debug {
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
proguardFiles += getDefaultProguardFile("proguard-android.txt")
proguardFiles += file("proguard-rules.pro")
versionNameSuffix = "debug"
isJniDebuggable = false
isRenderscriptDebuggable = false
//signingConfig = signingConfigs.debug
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
viewBinding = true
}
namespace = "com.katiearose.sobriety"
}

dependencies {

implementation(project(":shared"))
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("com.google.android.material:material:1.7.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.preference:preference-ktx:1.2.0")
//required for AndroidX Preference library
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.5.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs") {
version {
strictly ("1.2.0") //2.0.0 requires gradle 7.4.0-alpha10
}
}
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
54 changes: 36 additions & 18 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Keep `Companion` object fields of serializable classes.
# This avoids serializer lookup through `getDeclaredClasses` as done for named companion objects.
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1> {
static <1>$Companion Companion;
}

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Keep `serializer()` on companion objects (both default and named) of serializable classes.
-if @kotlinx.serialization.Serializable class ** {
static **$* *;
}
-keepclassmembers class <2>$<3> {
kotlinx.serialization.KSerializer serializer(...);
}

# Keep `INSTANCE.serializer()` of serializable objects.
-if @kotlinx.serialization.Serializable class ** {
public static ** INSTANCE;
}
-keepclassmembers class <1> {
public static <1> INSTANCE;
kotlinx.serialization.KSerializer serializer(...);
}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# @Serializable and @Polymorphic are used at runtime for polymorphic serialization.
-keepattributes RuntimeVisibleAnnotations,AnnotationDefault

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
# Serializer for classes with named companion objects are retrieved using `getDeclaredClasses`.
# If you have any, uncomment and replace classes with those containing named companion objects.
#-keepattributes InnerClasses # Needed for `getDeclaredClasses`.
#-if @kotlinx.serialization.Serializable class
#com.example.myapplication.HasNamedCompanion, # <-- List serializable classes with named companions.
#com.example.myapplication.HasNamedCompanion2
#{
# static **$* *;
#}
#-keepnames class <1>$$serializer { # -keepnames suffices; class is kept when serializer() is kept.
# static <1>$$serializer INSTANCE;
#}
24 changes: 24 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,30 @@
android:roundIcon="@mipmap/sobriety_round"
android:supportsRtl="true"
android:theme="@style/Theme.Sobriety">
<activity
android:name=".activities.Milestones"
android:exported="false"
android:label="@string/milestones">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activities.Savings"
android:exported="false"
android:label="@string/savings">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activities.DailyNotes"
android:exported="false"
android:label="@string/daily_notes">
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
<activity
android:name=".activities.Settings"
android:exported="false"
Expand Down
73 changes: 0 additions & 73 deletions app/src/main/java/com/katiearose/sobriety/Addiction.kt

This file was deleted.