Coder Social home page Coder Social logo

droidsonroids / android-animation-disabler Goto Github PK

View Code? Open in Web Editor NEW
27.0 27.0 2.0 403 KB

Gradle plugin for disabling animations in global settings before UI tests and reenabling them afterwards

Home Page: http://www.thedroidsonroids.com/blog/setting-animation-scale-for-android-ui-tests/

License: MIT License

Kotlin 100.00%
android android-animation-disabler espresso gradle-plugin hacktoberfest

android-animation-disabler's People

Contributors

jnissi avatar koral-- avatar mateuszkwiecinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

android-animation-disabler's Issues

Gradle Configuration Cache compatibility

When running ./gradlew connectedEnableAnimations --configuration-cache fails with:


Configuration cache is an incubating feature. |  
-- | --
  | Calculating task graph as no configuration cache is available for tasks: sampl:connectedEnableAnimation |  
  | :sample:connectedEnableAnimations |  
  |   |  
  | 11 problems were found storing the configuration cache, 9 of which seem unique. |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'java.io.FileDescriptor', a subtype of 'java.io.FileDescriptor', as these are not supported with the configuration cache. |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: value '/127.0.0.1:62664' failed Java Object Serialization |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: value '/127.0.0.1:5037' failed Java Object Serialization |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'sun.nio.ch.SocketAdaptor', a subtype of 'java.net.Socket', as these are not supported with the configuration cache. |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: value '/127.0.0.1:62663' failed Java Object Serialization |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: value 'localhost/127.0.0.1:8599' failed Java Object Serialization |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:not_yet_implemented:java_serialization |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'sun.nio.ch.ServerSocketAdaptor', a subtype of 'java.net.ServerSocket', as these are not supported with the configuration cache. |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'java.lang.Thread', a subtype of 'java.lang.Thread', as these are not supported with the configuration cache. |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types |  
  | - Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache. |  
  | See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

full build scan: https://scans.gradle.com/s/55p6jox4bkste/console-log?anchor=27

subsequent calls fail with:

1 problem was found reusing the configuration cache.
- Task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`: cannot deserialize object of type 'java.io.FileDescriptor' as these are not supported with the configuration cache.
  See https://docs.gradle.org/7.0.2/userguide/configuration_cache.html#config_cache:requirements:disallowed_types

See the complete report at file:///Users/mateuszkwiecinski/sourcy/android-animation-disabler/build/reports/configuration-cache/9zuzfhnd7gemmbfdgml742e0t-6/configuration-cache-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Could not load the value of field `localAddress` of `sun.nio.ch.SocketChannelImpl` bean found in field `mAdbConnection` of `com.android.ddmlib.internal.DeviceListMonitorTask` bean found in field `mDeviceListMonitorTask` of `com.android.ddmlib.internal.DeviceMonitor` bean found in field `mDeviceMonitor` of `com.android.ddmlib.AndroidDebugBridge` bean found in field `$bridge` of `pl.droidsonroids.gradle.animation.AnimationDisablerPlugin$registerAnimationScaleTask$1$1` bean found in field `action` of `org.gradle.api.internal.AbstractTask$TaskActionWrapper` bean found in field `actions` of task `:sample:connectedEnableAnimations` of type `org.gradle.api.DefaultTask`.
> java.lang.NullPointerException (no error message)

Gradle task names are swapped

Using gradle.plugin.pl.droidsonroids.gradle:android-gradle-animation-disabler:1.0.1.

Looks like the boolean check at AnimationDisablerPlugin.kt#L38 is reversed.

Currently reads:

tasks.create("connected${if (enableAnimations) "Dis" else "En"}ableAnimations") {

But should read:

tasks.create("connected${if (enableAnimations) "En" else "Dis"}ableAnimations") {

Sample not working

Hi, I am clone repository and run sample test and test crashed with this exception,

android.provider.Settings$SettingNotFoundException: window_animation_scale at android.provider.Settings$Global.getInt(Settings.java:6068) at pl.droidsonroids.animationdisabler.ExampleTest.animationScalesSetToZeroDuringTest(ExampleTest.kt:17) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:305) at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:365) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:330) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:78) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:328) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:65) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:292) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:305) at org.junit.runners.ParentRunner.run(ParentRunner.java:412) at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$4.run(ParentRunner.java:330) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:78) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:328) at org.junit.runners.ParentRunner.access$100(ParentRunner.java:65) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:292) at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:305) at org.junit.runners.ParentRunner.run(ParentRunner.java:412) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56) at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:388) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1701)
I attach plugin to another project , but animations didn't disable

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.