Gradle Check Unused Dependencies

Posted on  by 



The Gradle plugin that finds unused dependencies, declared and transitive is com.github.nullstress.dependency-analysis But its latest version 1.0.3 is created 23 December 2014. After that there aren't any updates. N.B: Many of our engineers are being confused about this plugin as they updated only the version number, nothing else. The preceding example shows three key concepts to Gradle dependency management: configurations (compile), dependencies (org.springframework:spring-core:3.0.5), and repositories (mavenCentral). A “configuration” is a named grouping of dependencies. A Gradle build can have zero or more of them. A “repository” is a source of dependencies.

Our testsuite on Cloud Build was taking about ten minutes to run 700+ Java and 410+ JavaScript tests with every merge to master, so we considered using Kaniko cache to save the dependencies into a Docker image, but it felt that we might end up with stale dependencies, given that sanity checking the contents of a docker image is a nontrivial task. So, inspired by the cache implementation in Github Actions, we decided to save and restore our gradle and npm dependencies ($HOME/.gradle and $HOME/.npm) into GCS, by adding two additional steps to our cloudbuild.yaml:

Unused

To make this work, we created a persistent volume mapped to /home/cache to store the cached dependencies between build steps.

./save-cache and ./restore-cache are quite straightforward:

We compressed both folders into .tgz files, and you may have noticed the additional timestamp. This helps to avoid accumulating unused dependencies, for example if we change versions of gradle or individual libraries.

Gradle Check Unused Dependencies Java

If the timestamp is missing or the cache is too old, we skip the restore-cache step and recreate the whole thing from scratch.

This process saved us 2 minutes of execution time per build, and it helped us reassess the size of our container images (saved 30s) and how many steps we could run in parallel (around 3 minutes per build). In the end, we could reduce from ten minutes to almost five, but your mileage may vary. Let us know your own results at @koliseoapi.

1.6.24 #

  • Remove unused test dependency.
  • Update Dart SDK constraint in example.

1.6.23 #

1.6.22 #

  • Switch to guava-android dependency instead of full guava.

1.6.21 #

1.6.20 #

1.6.19 #

  • Android implementation does path queries in the background thread rather than UI thread.

1.6.18 #

  • Keep handling deprecated Android v1 classes for backward compatibility.

1.6.17 #

  • Update Windows endorsement verison again, to pick up the fix forweb compilation in projects that include path_provider.

1.6.16 #

1.6.15 #

  • Endorse Windows implementation.
  • Remove the need to call disablePathProviderPlatformOverride in tests

1.6.14 #

1.6.13 #

  • Update package:e2e reference to use the local version in the flutter/pluginsrepository.

1.6.12 #

1.6.11 #

  • Updated documentation to reflect the need for changes in testing for federated plugins

1.6.10 #

1.6.9 #

1.6.8 #

1.6.7 #

  • Remove Android dependencies fallback.
  • Require Flutter SDK 1.12.13+hotfix.5 or greater.
  • Fix CocoaPods podspec lint warnings.

1.6.6 #

  • Replace deprecated getFlutterEngine call on Android.

1.6.5 #

1.6.4 #

1.6.3 #

  • Use path_provider_platform_interface in core plugin.

1.6.2 #

Gradle Check Unused Dependencies Python

  • Move package contents into path_provider for platform federation.

1.6.1 #

1.6.0 #

  • Support for retrieving the downloads directory was added.The call for this is getDownloadsDirectory.

1.5.1 #

  • Remove the deprecated author: field from pubspec.yaml
  • Migrate the plugin to the pubspec platforms manifest.
  • Require Flutter SDK 1.10.0 or greater.

1.5.0 #

Gradle Check Unused Dependencies Download

1.4.5 #

1.4.4 #

  • Update driver tests in the example app to e2e tests.

1.4.3 #

  • Update driver tests in the example app to e2e tests.
  • Add missing DartDocs and a lint to prevent further regressions.

1.4.2 #

  • Update and migrate iOS example project by removing flutter_assets, change'English' to 'en', remove extraneous xcconfigs, update to Xcode 11 buildsettings, remove ARCHS, and build pods as libraries instead of frameworks.

1.4.1 #

1.4.0 #

  • Support retrieving storage paths on Android devices with multiple externalstorage options. This adds a new class AndroidEnvironment that shadows thedirectory names from Androids android.os.Environment class.
  • Fixes getLibraryDirectory semantics & tests.

1.3.1 #

1.3.0 #

  • Added iOS-only support for getLibraryDirectory.
  • Update integration tests and example test.
  • Update example app UI to use a ListView show the list of content.
  • Update .gitignore to include Xcode build output folder **/DerivedData/

1.2.2 #

  • Correct the integration test for Android's getApplicationSupportDirectory call.
  • Introduce setMockPathProviderPlatform for API for tests.
  • Adds missing unit and integration tests.

Gradle Dependency Tree

1.2.1 #

1.2.0 #

  • On Android, getApplicationSupportDirectory is now supported using getFilesDir.
  • getExternalStorageDirectory now returns null instead of throwing anexception if no external files directory is available.

1.1.2 #

  • getExternalStorageDirectory now uses getExternalFilesDir on Android.

1.1.1 #

  • Cast error codes as longs in iOS error strings to ensure compatibilitybetween arm32 and arm64.

1.1.0 #

  • Added getApplicationSupportDirectory.
  • Updated documentation for getApplicationDocumentsDirectory to suggestusing getApplicationSupportDirectory on iOS andgetExternalStorageDirectory on Android.
  • Updated documentation for getTemporaryDirectory to suggest using itfor caches of files that do not need to be backed up.
  • Updated integration tests and example to reflect the above changes.

1.0.0 #

0.5.0+1 #

  • Log a more detailed warning at build time about the previous AndroidXmigration.

0.5.0 #

  • Breaking change. Migrate from the deprecated original Android SupportLibrary to AndroidX. This shouldn't result in any functional changes, but itrequires any Android apps using this plugin to alsomigrate if they'reusing the original support library.

0.4.1 #

  • Updated Gradle tooling to match Android Studio 3.1.2.

0.4.0 #

  • Breaking change. Set SDK constraints to match the Flutter beta release.

0.3.1 #

  • Simplified and upgraded Android project template to Android SDK 27.
  • Updated package description.

0.3.0 #

  • Breaking change. Upgraded to Gradle 4.1 and Android Studio Gradle plugin3.0.1. Older Flutter projects need to upgrade their Gradle setup as well inorder to use this version of the plugin. Instructions can be foundhere.

0.2.2 #

0.2.1+1 #

0.2.1 #

  • Add function to determine external storage directory.

0.2.0 #

  • Upgrade to new plugin registration. (https://groups.google.com/forum/#!topic/flutter-dev/zba1Ynf2OKM)

Gradle Check Unused Dependencies Applications

0.1.3 #

0.1.2 #

Gradle Check Unused Dependencies List

0.1.1 #

0.1.0 #





Coments are closed