English subtitles

← Per-Variant Dependency Configurations

Get Embed Code
4 Languages

Showing Revision 3 created 05/24/2016 by Udacity Robot.

  1. The Android griddle plug in creates
    a set of configurations for
  2. each build variant.
  3. This allows us to manage dependencies
    independently for each of our variants.
  4. So we'll have the usual compile and
    run time configurations.
  5. But we'll also have free compile and
    free runtime.
  6. And so on.
  7. The free runtime configuration extends
    the free compile configuration.
  8. Just as compile extends runtime
    when using the Java plugin.
  9. Additionally, free compile configuration
    extends the regular compile
  10. configuration.
  11. Which means our free variance will
    include all of our default dependencies.
  12. In addition to those added
    to the free configurations.
  13. It's probably likely that we would
    want to enable ads in the free version
  14. of our app, but not in the paid.
  15. Utilizing Google's Ad Services requires
    to depend on the Ad Services Library.
  16. However we don't want to unnecessarily
    bloat the paid version of our app
  17. by including a library
    that won't be needed.
  18. To solve this problem we can simply
    declare this dependency only for
  19. the free version of our app.
  20. As you can see here,
  21. we've added a dependency to
    the Google Play ad services.
  22. But we've assigned it to
    the free compile configuration.
  23. That's really there is to declaring
    variant specific dependencies.
  24. But we've included a demo
    in the course repository.
  25. You should check it out.