Status Update
Comments
il...@google.com <il...@google.com> #2
Thanks for your detailed post.
However, benchmark build type is under configured: at least isProfileable is not set to true for existing build type, probably there's more.
We should set isProfileable = true
by default when overriding an existing benchmark build type.
This issue is not about some specific configuration flag, but the general approach of dealing with external configuration. As a developer adopting baseline profiles, it seems extremely risky to me using a custom configuration due to how it's applied under the hood and the fact it may break default configuration.
I agree that is not great but this is a little tricky to do. For custom baseline profile build types we override all the properties. For benchmark I left it open to configure but it's mostly about these 2 properties:
isMinifyEnabled
isShrinkResources
I don't have a way to see if the user is setting them before overriding, so for this reason, I'd prefer not to. I agree with you that some other properties could be set by default to make this easier, i.e.:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
The reason why I mentioned the release signing config in the beginning is because I want to use debug signing config.
In the specific of your issue, i.e. using a debug certificate can you override the benchmark and baseline profile setting? You should be able to do something like:
android {
buildTypes {
release { ... }
debug { ... }
benchmarkRelease {
...
signingConfig signingConfigs.debug
}
nonMinifiedRelease {
...
signingConfig signingConfigs.debug
}
}
}
ja...@gmail.com <ja...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Marcello Albano <
Link:
Added override for debuggable and profileable for benchmark builds in bpgp
Expand for full commit details
Added override for debuggable and profileable for benchmark builds in bpgp
Test: ./gradlew :benchmark:benchmark-baseline-profile-gradle-plugin:test
Bug: 369213505
Relnote: "isProfileable is always overridden in benchmark builds,
and isDebuggable is also now always overridden in both benchmark and
nonMinified (baseline profile capture) builds."
Change-Id: I487fa71083921682173f04fcbb477be5baf165f8
Files:
- M
benchmark/baseline-profile-gradle-plugin/src/main/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPlugin.kt
- M
benchmark/baseline-profile-gradle-plugin/src/test/kotlin/androidx/baselineprofile/gradle/apptarget/BaselineProfileAppTargetPluginTest.kt
Hash: 1906bbe52ba7ccb9ca0e1c1d6de33e7c91b5c6f0
Date: Fri Oct 11 10:07:06 2024
ub...@gmail.com <ub...@gmail.com> #4
I've landed a change that will set the following properties also when the benchmark build type already exists:
isJniDebuggable = false
isDebuggable = false
isProfileable = true
As well as the following for agp 8.0:
isDebuggable = false
I'm going ahead and closing this - if you've further questions please answer here and will reopen. Thanks.
ja...@gmail.com <ja...@gmail.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-baseline-profile-gradle-plugin:1.4.0-alpha04
ub...@gmail.com <ub...@gmail.com> #6
Since release signing config is used by default instead of debug
is not mentioned in release notes - maybe this is a bug?
Cause the last time I found it mentioned in the release notes was in version 1.1
signingConfig.debug is used as the default signing config (
) b/153583269
So, if the switch to the release one indeed happened - maybe it's an issue?
il...@google.com <il...@google.com>
al...@google.com <al...@google.com> #8
se...@google.com <se...@google.com> #9
ap...@google.com <ap...@google.com> #10
Branch: androidx-master-dev
commit 2f634eec2143acd6a4ea19a375a6e3877cdcc2ed
Author: Ian Lake <ilake@google.com>
Date: Tue Mar 19 10:14:07 2019
Convert @ContentView to constructor annotation
As layout IDs are non-final in library modules
(and in the future, app modules), change
@ContentView to only be a marker annotation for
a constructor which developers can call with
a specific layout ID.
Fixes: 128352521
Fixes: 127531658
Test: updated tests
Change-Id: I15e2edee8cbd68180991f89fbc3b04e12c961ede
M activity/api/1.0.0-alpha06.txt
M activity/api/current.txt
M activity/src/androidTest/java/androidx/activity/ContentViewTest.kt
M activity/src/main/java/androidx/activity/ComponentActivity.java
M annotations/api/1.1.0-beta01.txt
M annotations/api/current.txt
M annotations/src/main/java/androidx/annotation/ContentView.java
M appcompat/api/1.1.0-alpha04.txt
M appcompat/api/current.txt
M appcompat/src/main/java/androidx/appcompat/app/AppCompatActivity.java
M fragment/api/1.1.0-alpha06.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentFactoryTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentTransactionTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentViewTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/NestedInflatedFragmentTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/StrictFragment.kt
M fragment/src/androidTest/java/androidx/fragment/app/StrictViewFragment.kt
M fragment/src/androidTest/java/androidx/fragment/app/test/FragmentTestActivity.kt
M fragment/src/androidTest/java/androidx/fragment/app/test/LoaderActivity.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentActivity.java
M testutils/src/main/java/androidx/testutils/RecreatedActivity.kt
il...@google.com <il...@google.com> #11
@ContentView(R.layout.main)
class MainFragment : Fragment() {
}
becomes
class MainFragment : Fragment(R.layout.main) {
}
While the default FragmentFactory (and AppComponentFactory for Activities on API 28+) still require a no-argument constructor, Fragment and ComponentActivity/FragmentActivity/AppCompatActivity allow your no-argument constructor or custom constructor to call up to a second constructor which takes a @LayoutRes int of the layout you want to inflate. That second constructor is annotated with @ContentView and will be used for future Tools integrations.
zh...@gmail.com <zh...@gmail.com> #12
------
Is it to deliberately kill code such as:
and
?
il...@google.com <il...@google.com> #13
ta...@gmail.com <ta...@gmail.com> #14
il...@google.com <il...@google.com> #15
"This should generally be called from your constructor that takes no parameters, as is required for API 27 and lower or when using the default AppComponentFactory."
Description
Version used: Version 1.0.0-alpha04
Since `R.layout` is non-final in library projects, we can't use the `@ContentView` annotation.