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

Publish Gradle Module Metadata with Variants #3683

Closed
wants to merge 31 commits into from

Commits on Jun 28, 2023

  1. Configuration menu
    Copy the full SHA
    cf4d7a1 View commit details
    Browse the repository at this point in the history
  2. Add integration test for resolving Guava with Gradle

    - only using POM metadata (Gradle 5)
    - using Gradle Module Metadata (Gradle 6)
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    31c2026 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3db90c4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6437197 View commit details
    Browse the repository at this point in the history
  5. Fixed typos

    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    e643f3f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f9fb5c5 View commit details
    Browse the repository at this point in the history
  7. Use correct version for parents

    The 'android' and 'jre' variant each have their own parent and they
    should use that one in Gradle Module Metadata.
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    905909c View commit details
    Browse the repository at this point in the history
  8. Fix typo in classpath name.

    This causes integration tests to fail. The first failure:
    
    Execution failed for task ':androidJava6RuntimeClasspathJava:testClasspath'.
    > Expected: [failureaccess-1.0.1.jar, guava-HEAD-android-SNAPSHOT.jar]
      Actual:   [checker-compat-qual-2.5.5.jar, error_prone_annotations-2.3.4.jar, failureaccess-1.0.1.jar, guava-HEAD-android-SNAPSHOT.jar, j2objc-annotations-1.3.jar, jsr305-3.0.2.jar]
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    7a2f0a0 View commit details
    Browse the repository at this point in the history
  9. Also fix typo when looking up configuration.

    This makes the test pass again, this time because it's testing what we
    want :)
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    8191fc3 View commit details
    Browse the repository at this point in the history
  10. Satisfy our autoformatters.

    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    179136b View commit details
    Browse the repository at this point in the history
  11. Fail if any test run fails.

    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    41dbc97 View commit details
    Browse the repository at this point in the history
  12. Conservatively keep most deps on the runtime classpath.

    As of this commit, we'll remove only j2objc-annotations. The other
    artifacts contain at least some annotations with RUNTIME visibility
    (IIRC).
    
    (Even this change could theoretically affect users who assume that they
    can read CLASS-retention annotations (of which j2objc-annotations has
    some) from bytecode and find them in the runtime classpath. But that
    seems unlikely, especially for j2objc annotations.)
    
    We may consider being more aggressive in the future.
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    c5e364f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0346bc3 View commit details
    Browse the repository at this point in the history
  14. Make Android projects always select a 'android' variant by default

    This is done by setting 'com.android.build.api.attributes.BuildTypeAttr'
    to 'jre' in the 'jre' variants. Which indicates that these variants
    are unsuited for the usual Android build types (release, debug, ...).
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    ad2ca91 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    536a5a3 View commit details
    Browse the repository at this point in the history
  16. Add test cases for selecting a different variant via constraint

    This shows that version constraints can be used to:
    - Select the 'jre' variant in an Android project
    - Select the 'android' variant in a Java project, even if the jvm
      target version is 8+
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    941ff66 View commit details
    Browse the repository at this point in the history
  17. Use 'org.gradle.jvm.environment' attribute

    This attribute is supported by Gradle 7 and AGP 7
    
    See:
    - gradle/gradle#15430
    - https://issuetracker.google.com/issues/179488433
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    9eb9996 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    cf7d4c1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    8c5e9d3 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    8e01521 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    e07bcf1 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    4ea61e9 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    7300d68 View commit details
    Browse the repository at this point in the history
  24. Use Gradle 7.0 final

    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    2180a04 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    4758c9c View commit details
    Browse the repository at this point in the history
  26. Do not run Gradle integration test on Java 8

    The Android Gradle Plugin 7.0.0 requires Java 11
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    eae386c View commit details
    Browse the repository at this point in the history
  27. All variants are now targeting Java 8 or higher

    The support for Java versions < 8 in the Android variants has been
    removed. Jre and Android can now be distinguished by the
    'org.gradle.jvm.environment' attribute only. The dependencies are also
    more similar now which allows some simplification. In particular
    the removal of the 'checker-compat-qual' dependency in the Android
    variants.
    jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    4d05df4 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    0d00efa View commit details
    Browse the repository at this point in the history
  29. Bump plugin versions.

    cpovirk authored and jjohannes committed Jun 28, 2023
    Configuration menu
    Copy the full SHA
    c14d55a View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    5f54f4d View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    985d143 View commit details
    Browse the repository at this point in the history