Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Android Gradle Plugin 8.2.2 to 8.3.1 #383

Merged
merged 8 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import net.twisterrob.inventory.android.data.R;

@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
public interface Constants {
String TEST_PROPERTY = "Test Property";
String TEST_PROPERTY_OTHER = TEST_PROPERTY + " Other";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import static net.twisterrob.inventory.android.content.Constants.*;
import static net.twisterrob.inventory.android.content.DatabaseMatchers.*;

@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
@SuppressWarnings({"unused", "TryFinallyCanBeTryWithResources"})
public class DataBaseActor extends TestDatabaseRule {
private final Database appDB;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import net.twisterrob.android.utils.tools.DatabaseTools;
import net.twisterrob.inventory.android.database.test_helpers.R;

@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
// TODO refactor to merge with DataBaseActor
public class DatabaseMatchers {
public static @NonNull Matcher<? super Database> countImages(final Matcher<? super Long> countMatcher) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* It is safe to apply this rule at any time,
* because it won't open the database until the first query on {@link #testDB}.
*/
@VisibleForTesting
@VisibleForTesting(otherwise = VisibleForTesting.NONE)
public class TestDatabaseRule implements TestRule {
protected Database testDB;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.hamcrest.junit.MatcherAssume.*;
import static org.junit.Assume.assumeTrue;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Instrumentation.ActivityResult;
import android.content.Intent;
Expand Down Expand Up @@ -324,6 +325,7 @@ public void cancel() {
pressBackExternalUnsafe();
}

@SuppressLint("UseSdkSuppress") // REPORT false positive, the calling tests should use SdkSuppress, not utilities.
@RequiresApi(api = VERSION_CODES.JELLY_BEAN_MR2)
public void choose(int index) throws UiObjectNotFoundException {
String listId = UiAutomatorExtensions.androidId(ResourceTools.getIDResourceID(null, "resolver_list"));
Expand All @@ -334,6 +336,7 @@ public void choose(int index) throws UiObjectNotFoundException {
AndroidAutomator.acceptAnyPermissions();
}

@SuppressLint("UseSdkSuppress") // REPORT false positive, the calling tests should use SdkSuppress, not utilities.
@RequiresApi(api = VERSION_CODES.JELLY_BEAN_MR2)
public DriveBackupActor chooseDrive() throws UiObjectNotFoundException, NameNotFoundException {
DriveBackupActor drive = new DriveBackupActor();
Expand All @@ -349,6 +352,7 @@ public void dismiss() {
}
}

@SuppressLint("UseSdkSuppress") // REPORT false positive, the calling tests should use SdkSuppress, not utilities.
@RequiresApi(api = VERSION_CODES.JELLY_BEAN_MR2)
public static class DriveBackupActor {
private static final Logger LOG = LoggerFactory.getLogger(DriveBackupActor.class);
Expand Down
10 changes: 8 additions & 2 deletions android/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@
<activity
android:name="net.twisterrob.inventory.android.test.activity.ScopedStorageSaver"
android:label="ScopedStorageSaver"
/>
tools:ignore="MissingClass"
>
<!-- lint:MissingClass workaround for https://github.com/TWiStErRob/net.twisterrob.inventory/issues/309 -->
</activity>

<!--suppress AndroidDomInspection workaround for https://github.com/TWiStErRob/net.twisterrob.inventory/issues/309 -->
<activity
android:name="net.twisterrob.inventory.android.test.activity.CompatibleLauncher"
android:label="CompatibleLauncher"
/>
tools:ignore="MissingClass"
>
<!-- lint:MissingClass workaround for https://github.com/TWiStErRob/net.twisterrob.inventory/issues/309 -->
</activity>

</application>

Expand Down
7 changes: 5 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@
android:name="net.twisterrob.inventory.android.activity.ImageActivity"
android:label="@string/image_title"
android:exported="false"
android:screenOrientation="fullSensor"
android:screenOrientation="fullUser"
android:theme="@style/Theme.AppTheme.FullScreen"
/>
tools:ignore="DiscouragedApi"
>
<!-- lint:DiscouragedApi REPORT false positive, fullUser does not lock fixed orientation. -->
</activity>
<activity
android:name=".activity.data.MoveTargetActivity"
android:label="@string/action_move"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
java-android-source = "11"
java-android-target = "11"
#
agp = "8.2.2"
agp = "8.3.1"
# 23.0.0 + agp
agp-tools = "31.2.2"
agp-tools = "31.3.1"
twisterrob = "0.16" # https://github.com/TWiStErRob/net.twisterrob.gradle/releases
detekt = "1.23.5"
kotlin = "1.9.23"
Expand Down
2 changes: 1 addition & 1 deletion gradle/plugins-inventory/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
// UpgradeTestTask: FileUtils, StdLogger, ILogger
compileOnly(libs.plugin.android.tools.common)
// instrumentation.gradle.kts
compileOnly("com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.3.0")
compileOnly("com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.3.1")
compileOnly("com.google.testing.platform:core-proto:0.0.8-alpha08")
compileOnly("com.google.protobuf:protobuf-java:3.25.3")
// endregion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import org.gradle.kotlin.dsl.get
* @see com.android.build.api.dsl.LibraryExtension
* created by [com.android.build.gradle.internal.plugins.LibraryPlugin.createExtension]
*/
internal val Project.android: CommonExtension<*, *, *, *, *>
internal val Project.android: CommonExtension<*, *, *, *, *, *>
@Suppress("UNCHECKED_CAST")
get() = this.extensions["android"] as CommonExtension<*, *, *, *, *>
get() = this.extensions["android"] as CommonExtension<*, *, *, *, *, *>

/**
* This is useful to emulate the `android` block in a convention plugin
Expand All @@ -25,6 +25,6 @@ internal val Project.android: CommonExtension<*, *, *, *, *>
* @param block the configuration for common Android things.
* Using an [Action] to take advantage of `kotlin-dsl`.
*/
internal fun Project.android(block: Action<CommonExtension<*, *, *, *, *>>) {
internal fun Project.android(block: Action<CommonExtension<*, *, *, *, *, *>>) {
block.execute(android)
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ abstract class UpgradeTestTask : DefaultTask() {
testData.instrumentationRunner.get(),
device
)
testData.instrumentationRunnerArguments.forEach(runner::addInstrumentationArg)
testData.instrumentationRunnerArguments.get().forEach(runner::addInstrumentationArg)
runner.addInstrumentationArg("class", test)
//runner.addInstrumentationArg("annotation", "org.junit.Test")
runner.addInstrumentationArg("upgrade", "true")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion libs
Submodule libs updated 25 files
+26 βˆ’12 .github/workflows/ci-build.yml
+8 βˆ’3 .github/workflows/ci-instrumentation.yml
+18 βˆ’4 .github/workflows/ci.yml
+1 βˆ’0 build.gradle.kts
+8 βˆ’8 gradle/libs.versions.toml
+ βˆ’ gradle/plugins/gradle/wrapper/gradle-wrapper.jar
+2 βˆ’1 gradle/plugins/gradle/wrapper/gradle-wrapper.properties
+17 βˆ’12 gradle/plugins/gradlew
+8 βˆ’0 gradle/plugins/src/main/kotlin/net/twisterrob/libraries/build/android.base.gradle.kts
+3 βˆ’3 gradle/plugins/src/main/kotlin/net/twisterrob/libraries/build/dsl/android.kt
+22 βˆ’0 gradle/plugins/src/main/kotlin/net/twisterrob/libraries/build/instrumentedTestReport.gradle.kts
+7 βˆ’0 gradle/plugins/src/main/kotlin/net/twisterrob/libraries/net.twisterrob.libraries.android.library.gradle.kts
+ βˆ’ gradle/wrapper/gradle-wrapper.jar
+1 βˆ’1 gradle/wrapper/gradle-wrapper.properties
+9 βˆ’8 gradlew
+17 βˆ’74 settings.gradle.kts
+6 βˆ’1 twister-lib-android/capture_image/src/main/AndroidManifest.xml
+2 βˆ’0 ...esso/src/androidTest/java/net/twisterrob/android/test/espresso/EspressoExtensionsTest_onActionMenuView.java
+6 βˆ’2 twister-lib-android/espresso/src/main/java/net/twisterrob/test/junit/AndroidJUnit4WithParameters.java
+2 βˆ’1 ...-lib-android/espresso/src/main/java/net/twisterrob/test/junit/AndroidJUnit4WithParametersRunnerFactory.java
+2 βˆ’0 ...-android/espresso_glide4/src/main/java/com/bumptech/glide/load/engine/EngineJobFactory_animationExecutor.kt
+2 βˆ’0 ...-android/espresso_glide4/src/main/java/com/bumptech/glide/load/engine/EngineJobFactory_diskCacheExecutor.kt
+2 βˆ’0 ...lib-android/espresso_glide4/src/main/java/com/bumptech/glide/load/engine/EngineJobFactory_sourceExecutor.kt
+2 βˆ’0 ...id/espresso_glide4/src/main/java/com/bumptech/glide/load/engine/EngineJobFactory_sourceUnlimitedExecutor.kt
+3 βˆ’0 twister-lib-android/espresso_glide4/src/main/java/com/bumptech/glide/load/engine/idleExecutors.kt
Loading