Skip to content

Commit

Permalink
error remains in building.(Compose is in alpha stage)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shabinder committed Feb 8, 2021
1 parent 6d4a33e commit 14eeee1
Show file tree
Hide file tree
Showing 24 changed files with 140 additions and 102 deletions.
32 changes: 28 additions & 4 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import org.jetbrains.compose.compose

plugins {
id("org.jetbrains.compose")
id("com.android.application")
kotlin("android")
id("org.jetbrains.compose")
}

group = "com.shabinder"
Expand Down Expand Up @@ -46,6 +46,25 @@ android {
exclude(group = "androidx.compose.ui")
}
}
// Remove After upgrading dependency
configurations.all {
resolutionStrategy.eachDependency {
if (requested.group.contains("org.jetbrains.compose")) {
useVersion("0.3.0-build146")
because("wait for decompose to upgrade too")
}
}
}
buildFeatures {
compose = true
}
packagingOptions {
exclude("META-INF/*")
}
composeOptions {
kotlinCompilerVersion = Versions.kotlinVersion
//kotlinCompilerExtensionVersion = Versions.compose
}
kotlinOptions {
jvmTarget = "1.8"
useIR = true
Expand All @@ -54,25 +73,28 @@ android {
dependencies {
implementation(compose.material)
implementation(compose.materialIconsExtended)

implementation(project(":common:database"))
implementation(project(":common:compose-ui"))
implementation(project(":common:dependency-injection"))
implementation(project(":common:data-models"))
implementation(Androidx.appCompat)
/*
implementation(Androidx.coroutines)
implementation(Androidx.core)
implementation(Androidx.palette)
//implementation(JetBrains.Compose.materialIcon)
*/

//Compose-Navigation
implementation(Androidx.composeNavigation)
//implementation(Androidx.composeNavigation)

implementation(Koin.android)
implementation(Koin.androidViewModel)

//DECOMPOSE
implementation(Decompose.decompose)
implementation(Decompose.extensionsCompose)
/*
//Lifecycle
Versions.androidLifecycle.let{
Expand All @@ -87,6 +109,7 @@ dependencies {
implementation("dev.chrisbanes.accompanist:accompanist-coil:$it")
implementation("dev.chrisbanes.accompanist:accompanist-insets:$it")
}
*/

Extras.Android.apply {
implementation(appUpdator)
Expand All @@ -112,7 +135,8 @@ dependencies {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
freeCompilerArgs = listOf("-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check",
freeCompilerArgs = listOf("-Xallow-jvm-ir-dependencies","-Xallow-unstable-dependencies",
"-Xskip-prerelease-check",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.shabinder.android

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.ui.platform.setContent
import com.arkivanov.decompose.ComponentContext
import androidx.compose.ui.platform.setContent
import com.arkivanov.decompose.extensions.compose.jetbrains.rootComponent
import com.arkivanov.mvikotlin.logging.store.LoggingStoreFactory
import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory
Expand Down
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ allprojects {
maven(url = "https://kotlin.bintray.com/kotlinx/")
maven(url = "https://kotlin.bintray.com/kotlin-js-wrappers/")
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
flatDir {
dirs("fuzzywuzzy")
}
}
}
buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
classpath(JetBrains.Kotlin.gradlePlugin)
}
}

Expand All @@ -30,4 +27,4 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
"-Xuse-experimental=kotlinx.coroutines.TheAnnotationYouWantToDisable"
)
}
}
}
6 changes: 2 additions & 4 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ plugins {

group = "com.shabinder"
version = "2.1"

buildscript{
repositories {
// TODO: remove after new build is published
Expand All @@ -17,12 +16,11 @@ buildscript{
}

dependencies {
classpath("com.android.tools.build:gradle:4.0.2")
classpath("com.android.tools.build:gradle:4.0.1")
classpath(JetBrains.Compose.gradlePlugin)
classpath(JetBrains.Kotlin.gradlePlugin)
}
}

repositories {
maven(url = "https://jitpack.io")
jcenter()
Expand All @@ -32,7 +30,7 @@ repositories {
}

dependencies {
implementation("com.android.tools.build:gradle:4.0.2")
implementation("com.android.tools.build:gradle:4.0.1")
implementation(JetBrains.Compose.gradlePlugin)
implementation(JetBrains.Kotlin.gradlePlugin)
implementation(JetBrains.Kotlin.serialization)
Expand Down
19 changes: 14 additions & 5 deletions buildSrc/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

object Versions {
const val versionName = "2.2"
const val kotlinVersion = "1.4.30"
const val kotlinVersion = "1.4.21-2"

const val coroutinesVersion = "1.4.2"
const val composeVersion = "1.0.0-alpha11"
const val compose = "1.0.0-alpha11"
const val coilVersion = "0.4.1"
//DI
const val kodein = "7.2.0"
const val koin = "3.0.1-alpha-1"
const val koin = "3.0.0-alpha-4"

//Logger
const val kermit = "0.1.8"
Expand Down Expand Up @@ -46,6 +46,16 @@ object Androidx{

const val junit = "androidx.test.ext:junit:1.1.2"
const val expresso = "androidx.test.espresso:espresso-core:3.3.0"

object Compose{
const val materialIcon = "androidx.compose.material:material-icons-extended:${Versions.compose}"
const val ui = "androidx.compose.ui:ui:${Versions.compose}"
const val uiGraphics = "androidx.compose.ui:ui-graphics:${Versions.compose}"
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.compose}"
const val foundationLayout = "androidx.compose.foundation:foundation-layout:${Versions.compose}"
const val material = "androidx.compose.material:material:${Versions.compose}"
const val runtimeLiveData = "androidx.compose.runtime:runtime-livedata:${Versions.compose}"
}
}
object JetBrains {
object Kotlin {
Expand All @@ -58,9 +68,8 @@ object JetBrains {

object Compose {
// __LATEST_COMPOSE_RELEASE_VERSION__
private const val VERSION = "0.3.0-build149"
private const val VERSION = "0.3.0-build146"
const val gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$VERSION"
const val materialIcon = "androidx.compose.material:material-icons-extended:${Versions.composeVersion}"
}
}
object Decompose {
Expand Down
8 changes: 3 additions & 5 deletions buildSrc/src/main/kotlin/android-setup.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//import gradle.kotlin.dsl.accessors._2e8a70bdda5e56ec477a6ff432ddf9d7.android

plugins {
id("com.android.library")
}
Expand All @@ -12,10 +10,10 @@ android {
targetSdkVersion(Versions.targetSdkVersion)
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.composeVersion
/*composeOptions {
kotlinCompilerExtensionVersion = Versions.compose
kotlinCompilerVersion = Versions.kotlinVersion
}
}*/

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
11 changes: 6 additions & 5 deletions common/compose-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ import org.jetbrains.compose.compose
plugins {
id("multiplatform-compose-setup")
id("android-setup")
id("kotlin-parcelize")
}

kotlin {
sourceSets {
commonMain {
dependencies {
implementation(compose.materialIconsExtended)
//implementation(compose.materialIconsExtended)
implementation("org.jetbrains.compose.material:material-icons-extended:0.3.0-build150")
implementation(project(":common:dependency-injection"))
implementation(project(":common:data-models"))
implementation(project(":common:database"))
//implementation(MVIKotlin.rx)
implementation(SqlDelight.coroutineExtensions)
implementation(MVIKotlin.coroutines)
implementation(MVIKotlin.mvikotlin)
//implementation(MVIKotlin.mvikotlinExtensionsReaktive)
//implementation(Badoo.Reaktive.reaktive)
implementation(Decompose.decompose)
implementation(Decompose.extensionsCompose)

Expand All @@ -34,7 +33,9 @@ kotlin {

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xallow-jvm-ir-dependencies", "-Xskip-prerelease-check",
useIR = true
freeCompilerArgs = listOf("-Xallow-jvm-ir-dependencies",
"-Xallow-unstable-dependencies","-Xskip-prerelease-check",
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi",
"-Xuse-experimental=kotlinx.coroutines.TheAnnotationYouWantToDisable"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ package com.shabinder.common.ui
import androidx.compose.foundation.Image
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.vectorResource

@Composable
actual fun DownloadImageTick(modifier: Modifier){
actual fun DownloadImageTick(){
Image(
vectorResource(R.drawable.ic_tick),
"Download Done",
modifier
painterResource(R.drawable.ic_tick),
"Download Done"
)
}

@Composable
actual fun DownloadImageError(modifier: Modifier){
actual fun DownloadImageError(){
Image(
vectorResource(R.drawable.ic_error),
"Error! Cant Download this track",
modifier
painterResource(R.drawable.ic_error),
"Error! Cant Download this track"
)
}

@Composable
actual fun DownloadImageArrow(modifier: Modifier){
Image(
vectorResource(R.drawable.ic_arrow),
painterResource(R.drawable.ic_arrow),
"Start Download",
modifier
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fun DownloadAllButton(onClick: () -> Unit, modifier: Modifier = Modifier) {
ExtendedFloatingActionButton(
text = { Text("Download All") },
onClick = onClick,
icon = { Icon(imageVector = DownloadAllImage(),"Download All Button",tint = Color.Black) },
icon = { Icon(imageVector = DownloadAllImage(),"Download All Button",tint = Color(0xFF000000)) },
backgroundColor = colorAccent,
modifier = modifier
)
Expand Down
Loading

0 comments on commit 14eeee1

Please sign in to comment.