Status Update
Comments
[Deleted User] <[Deleted User]>
nt...@gmail.com <nt...@gmail.com> #2
We are currently using AGP internal task types to flag memory-intensive tasks to enforce a reduced parallelism at execution time. I've raised this separately (with a lot more detail) as a feature request (
ja...@gmail.com <ja...@gmail.com> #4
Another use case that we have is to reactively respond to the creation of APKs and AABs. The new AGP APIs allow us to connect out tasks into the artifact pipeline via wiredWith
but the best we can come up with to receive the completed artifact is to wire in toTransform
. This A) does not guarantee that we will receive the final artifact as more transforms may be applied after our task is called, and B) requires us to copy the input property file/dir to our tasks output property file/dir in order to not break the build cache.
The reactive behavior of the above is the complicating factor.
A non-reactive approach could simply depend upon the task name and then look for a hardcoded path in the build directory (which is still sort of gross, since the build output paths are not documented as public API and change from time to time).
Another approach would be to wire a custom task to consume the output of the build via the built artifacts loader feeding an input property. However, this approach cannot be applied reactively. Either the custom task is included in the build and causes the creation of the binary artifact, or it is not included in the build and never gets invoked.
al...@android.com <al...@android.com>
[Deleted User] <[Deleted User]> #6
We didn't provide a task wiring helper for that case as there's only one thing to wire, but I can see how the inconsistency can be misleading
mp...@gmail.com <mp...@gmail.com> #7
WRT variant.artifacts.get(SingleArtifact.APK))
, if the task is included in the build it will cause the creation of the artifact. Our build is currently defined to reactively perform some actions (predominantly some fancy reporting) only if work is actually performed.
We had previously been pushing our build to wire in to task outputs by locating tasks by type and referencing output properties as inputs to tasks registered via task finalizes
or dependsOn
relationships. This started getting more and more fragile as the AGP APIs migration proceeded/matured. I'm to the point now where I think the notion of reactive execution is hostile to the direction/expectations of both Gradle and AGP and want to start moving away from it, yet our build as it currently stands does rely on this behavior.
I bring up this up as a gap only because I don't know if I'll be able to completely refactor our CI pipeline's expectations in time for Gradle 8+.
ch...@google.com <ch...@google.com> #8
ch...@google.com <ch...@google.com> #12
That last one (
al...@android.com <al...@android.com> #14
And one question:
We have some convention plugin code which is applied to many project module. It uses the components extension's onVariants
callback to reactively trigger some data capture but needs to know whether or not minification has been enabled for the build type, configured by a separate convention plugin. We have code similar to the following:
project.plugins.withId("com.android.application") { plugin ->
val extension = project.extensions.getByType(ApplicationAndroidComponentsExtension::class.java)
val android = project.extensions.getByType(ApplicationExtension::class.java)
extension.onVariants { variant ->
...
if (android.buildTypes.getByName(variant.buildType!!).isMinifyEnabled) {
...
}
ApplicationExtension
feels like more of an input API for AGP and not something we should be programmatically querying within the onVariants
callback. Given the exposure of other configuration values (e.g. variant.pseudoLocalesEnabled
as Property<Boolean>
), should isMinifyEnabled
also be exposed?
Description
Version used: 24.2.0
Theme used: Theme.AppCompat.Light.NoActionBar
Devices/Android versions reproduced on: Nexus 6/ Android 6.0.1
With 24.2.0, when an ImageView is inside a CollapsingToolbarLayout, with fitsSystemWindows=true, it leaves a gap around the top and sides of the image rather than scaling to fit the space.
Screenshots included for:
Version 24.2.0, fitsSystemWindows=true (the problem)
Version 24.2.0, fitsSystemWindows=false
Version 24.1.1, fitsSystemWindows=true (correct)
Excerpt of xml in question:
<android.support.design.widget.CoordinatorLayout
xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="false">
<ImageView
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="208dp"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax"/>
<View style="@style/ScrimTop"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/Toolbar"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.SwipeRefreshLayout ...>
...
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabNavigate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
app:layout_anchor="@id/appBar"
app:layout_anchorGravity="bottom|right"
app:srcCompat="@drawable/ic_directions_car_24dp"/>
</android.support.design.widget.CoordinatorLayout>