Skip to content

Commit

Permalink
Upgrading libs. Android is working, need to do the rest.
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Jun 27, 2024
1 parent 777d19f commit 65728ba
Show file tree
Hide file tree
Showing 14 changed files with 423 additions and 382 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ yarn.lock

# Mac
.DS_Store

.kotlin
120 changes: 0 additions & 120 deletions app/build.gradle

This file was deleted.

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

android {
compileSdk = Integer.parseInt(libs.versions.android.compile.sdk.get())

namespace = "com.handstandsam.shoppingapp"

defaultConfig {
applicationId = "com.handstandsam.shoppingapp"
minSdk = Integer.parseInt(libs.versions.android.min.sdk.get())
targetSdk = Integer.parseInt(libs.versions.android.target.sdk.get())
versionCode = 1
versionName = "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

testOptions {
execution = "ANDROIDX_TEST_ORCHESTRATOR"
animationsDisabled = true
}

// variantFilter { variant ->
// setIgnore(!variant.name.toLowerCase().endsWith("debug"))
// }

lint {
baseline = file("lint-baseline.xml")
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

buildTypes {
release {
// minifyEnabled = false
// proguardFiles = [getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro']
}
}

buildFeatures {
compose = true
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}

dependencies {
implementation(project(":compose-ui"))

implementation(project(":models"))
implementation(project(":mock-data"))
implementation(project(":shopping-cart"))

// AndroidX Libraries
implementation(libs.androidx.appcompat.v7)
implementation(libs.androidx.material)
implementation(libs.androidx.lifecycle.runtime.ktx)

// Networking)
implementation(libs.glide)
implementation(libs.okhttp)
implementation(project(":networking"))
debugImplementation(libs.okhttp.logging.interceptor)

// Kotlin)
implementation(libs.kotlin.coroutines)
implementation(libs.kotlin.coroutines.android)

//Flavor Modules)
implementation(project(":app-flavor-inmemory"))
// implementation( project(":app-flavor-mockserver"))
// implementation( project(":app-flavor-liveserver"))

//Logging
implementation(libs.timber)

// Compose
// implementation( libs.androidx.compose.compiler)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.androidx.compose.animation)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.activity.compose)
implementation(libs.accompanist.coil)
implementation(libs.coil.compose)
implementation(libs.landscapist.coil)
implementation(libs.androidx.lifecycle.runtime.ktx)

//JVM Tests Only
testImplementation(libs.junit)

androidTestImplementation(libs.androidx.espresso)
androidTestImplementation(libs.androidx.espresso.contrib)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.testrunner)
androidTestImplementation(project(":app-test-suite"))
}

dependencyGuard {
configuration("debugRuntimeClasspath") {
modules = true
}
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /Users/handstandtech/dev/android-sdk-mac_x86/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
18 changes: 12 additions & 6 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ buildscript {
mavenCentral()
google()
gradlePluginPortal()
maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
maven { url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
// maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
// maven { url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
// classpath(libs.kotlin.gradle.plugin)
classpath(libs.sqldelight.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath("com.handstandsam:convention-plugins")
classpath("com.handstandsam.kmp4free:kmp4free:0.1.0")
classpath(libs.jetbrains.compose.gradle.plugin)
// classpath(libs.plugins.compose.compiler)
// classpath("com.handstandsam.kmp4free:kmp4free:0.1.0")
// classpath(libs.jetbrains.compose)
// classpath(libs.plugins.jetbrains.compose) apply false
// classpath(libs.plugins.compose.compiler) apply false

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle.kts files
Expand All @@ -22,6 +26,8 @@ buildscript {

plugins {
alias(libs.plugins.dependency.guard)
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.compose.compiler) apply false
}

dependencyGuard {
Expand All @@ -34,7 +40,7 @@ allprojects {
repositories {
google()
mavenCentral()
maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
// maven { url = "https://maven.pkg.jetbrains.space/public/p/compose/dev" }
}
}

Expand Down
12 changes: 6 additions & 6 deletions compose-ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.compose.compose
//import org.jetbrains.compose.compose

plugins {
kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
id("org.jetbrains.compose")
alias(libs.plugins.kotlin.multiplatform) // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
alias(libs.plugins.compose.compiler)
}

kotlin {
Expand All @@ -11,9 +11,9 @@ kotlin {
}
val jvmMain by sourceSets.getting {
dependencies {
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.foundation)
implementation(libs.androidx.compose.ui)

implementation(project(":models"))
implementation(project(":mock-data"))
Expand Down
54 changes: 25 additions & 29 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
id("org.jetbrains.compose")
// alias(libs.plugins.kotlin.multiplatform)
kotlin("jvm")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.jetbrains.compose)
application
}

kotlin {
jvm {
withJava()
}
sourceSets {
named("jvmMain") {
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":compose-ui"))
implementation(project(":mock-data"))
implementation(project(":models"))
implementation(project(":networking"))
implementation(project(":shopping-cart"))
}
}
}
dependencies {
implementation(compose.desktop.currentOs)
implementation(project(":compose-ui"))
implementation(project(":mock-data"))
implementation(project(":models"))
implementation(project(":networking"))
implementation(project(":shopping-cart"))
}

compose.desktop {
application {
mainClass = "com.handstandsam.shoppingapp.compose.MainKt"

nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "ShoppingApp Desktop"
packageVersion = "1.0.0"
}
}
}
//compose.desktop {
//}


application {
mainClass = "com.handstandsam.shoppingapp.compose.MainKt"

// nativeDistributions {
// targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
// packageName = "ShoppingApp Desktop"
// packageVersion = "1.0.0"
// }
}
Loading

0 comments on commit 65728ba

Please sign in to comment.