Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Merge requests
  • !2068

[d8] Enable static and interface method desugaring with D8

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/demon-xxi/j8_only_deps_desugar_fix into master Oct 18, 2018
  • Overview 35
  • Commits 5
  • Pipelines 0
  • Changes 21

Created by: demon-xxi

D8 desugar requires to specify additional Java bytecode that is currently not compiled into DEX bytecode but require to compile other classes into DEX bytecode. For example, if your code uses default and static interface methods, which is a Java 8 language feature, you need to use this flag to specify the path to all of your project's Java bytecode, even if you don't intend to compile all of it into DEX bytecode. That's because d8 requires this information to understand your project's code and resolve calls to the interface methods. More info: https://developer.android.com/studio/command-line/d8#j8

This change adds classpath of all the dependencies when calling D8 step. It enables desugaring only for java and android libraries with java source >= 8. It also explicitly disabled desugaring on any java 7 sources. Which may give some performance wins.

Adding classpath to D8 desugar increases number of dependencies for dex steps on java 8 libraries. While this may degrade build speeds, it does so only for java 8 dependencies. This is necessary step to make those libraries work as well as adds no impact to all the java 7 sources.

Test Plan: All the unit tests working without additional changes. May add few tests later to ensure only java 8 deps are added to dex phase.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/demon-xxi/j8_only_deps_desugar_fix