Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Rally] Updates to alpha04 snapshot
Change-Id: Ib802e3759cc0af18beccec699c11588546a5d2c5
  • Loading branch information
JoseAlcerreca committed Sep 25, 2020
commit 94e6b6f8d98d764df0b283f9c3c36bd94d294f7f
12 changes: 11 additions & 1 deletion Rally/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ android {
}

buildFeatures {
compose true
// We turn off the Compose feature for now, due to using Compose SNAPSHOTs where the
// Compose compiler artifact has changed artifact group/name.
// Instead we add the compiler manually below in the dependencies {}. Also see
// the root build.gradle for info on how to apply the plugin.
// TODO: remove this once we upgrade to an AGP version which uses the new artifact details

// compose true
}

composeOptions {
Expand All @@ -80,6 +86,10 @@ dependencies {
implementation Libs.Kotlin.stdlib
implementation Libs.Coroutines.android

// Temporary workaround (see above)
// TODO: remove Compose.compiler once we upgrade to an AGP version which uses the new artifact details
kotlinCompilerPlugin Libs.AndroidX.Compose.compiler

implementation Libs.AndroidX.coreKtx
implementation Libs.AndroidX.appcompat
implementation Libs.AndroidX.Navigation.fragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.example.compose.rally

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.foundation.Box
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Scaffold
import androidx.compose.runtime.Composable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package com.example.compose.rally.ui.components

import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.Stack
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
Expand All @@ -45,7 +45,7 @@ fun <T> StatementBody(
rows: @Composable (T) -> Unit
) {
ScrollableColumn {
Stack(Modifier.padding(16.dp)) {
Box(Modifier.padding(16.dp)) {
val accountsProportion = items.extractProportions { amounts(it) }
val circleColors = items.map { colors(it) }
AnimatedCircle(
Expand Down
19 changes: 18 additions & 1 deletion Rally/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,24 @@ subprojects {
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
// Create a configuration which allows us to intercept the JARs, and add them to
// Kotlin Compiler freeCompilerArgs. This is needed because we can't currently use the
// built-in `compose` feature in AGP, since it depends on the old Compose Compiler artifacts.
// TODO: Remove this once AGP uses the new Compose Compiler artifact name
def compilerPluginConfig = project.configurations.create("kotlinCompilerPlugin")

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { compile ->

compile.dependsOn(compilerPluginConfig)
compile.doFirst {
if (!compilerPluginConfig.isEmpty()) {
// Add the compiler plugin JARs using the -Xplugin flag
compile.kotlinOptions.freeCompilerArgs +=
"-Xplugin=${compilerPluginConfig.files.first()}"
// Need to turn on the IR compiler too
compile.kotlinOptions.useIR = true
}
}
kotlinOptions {
// Treat all Kotlin warnings as errors
allWarningsAsErrors = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ object Libs {
const val coreKtx = "androidx.core:core-ktx:1.5.0-alpha02"

object Compose {
const val snapshot = ""
const val version = "1.0.0-alpha03"
const val snapshot = "6860046"
const val version = "1.0.0-SNAPSHOT"

const val compiler = "androidx.compose.compiler:compiler:$version"
const val core = "androidx.compose.ui:ui:$version"
const val foundation = "androidx.compose.foundation:foundation:$version"
const val layout = "androidx.compose.foundation:foundation-layout:$version"
Expand Down