foundry

Gradle and IntelliJ build tooling used in Slack's Android repo

APACHE-2.0 License

Stars
427

Bot releases are hidden (Show)

foundry -

Published by ZacSweers over 1 year ago

foundry -

Published by ZacSweers over 1 year ago

  • [Skippy] Improve pattern configuration.
    1. Make the default patterns public. This allows consumers to more
      easily reuse them when customizing their own.
    2. Use sets for the type to better enforce uniqueness requirements.
    3. Add github actions to never-skip defaults.
    4. Add excludePatterns to allow finer-grained control. This runs after
      include filtering so that users can manually exclude certain files that
      may otherwise be captured in an inclusion filter and is difficult to
      describe in a simple glob pattern. GitHub action does similar controls
      for CI matrices.
  • [Skippy] Allow relative (from the project root) to affected_projects.txt and allow non-existent files as a value. This makes it easy to gracefully fall back in CI.
  • [Skippy] Fix logging path matchers missing toString() impls.
  • [SKippy] Log verbosely in debug mode when skipping task deps.
  • Update oshi to 6.4.1.
foundry -

Published by ZacSweers over 1 year ago

Project Skippy

This release introduces an experimental new computeAffectedProjects task for computing affected projects based on an input of changed files. The goal of this is to statically detect which unit test, lint, and androidTest checks can be safely skipped in CI on pull requests.

Example usage

./gradlew computeAffectedProjects --changed-files changed_files.txt

Where changed_files.txt is resolved against the root repo directory and contains a newline-delimited list of changed files (usually inferred from a PR).

A simple example of how to produce such a file with the gh CLI:

gh pr view ${{ github.event.number }} --json files -q '.files[].path' > changed_files.txt

One would run this task first as a preflight task, then run subsequent builds with the slack.avoidance.affectedProjectsFile Gradle property pointing to its output file location (printed at the end of the task).

./gradlew ... -Pslack.avoidance.affectedProjectsFile=/Users/zacsweers/dev/slack/slack-android-ng/build/skippy/affected_projects.txt

The globalCiLint, globalCiUnitTest, and aggregateAndroidTestApks tasks all support reading this property and will avoid adding dependencies on tasks in projects that are not present in this set.

The ComputeAffectedProjectsTask task has some sensible defaults, but can be configured further in the root projects like so.

tasks.named<ComputeAffectedProjectsTask>("computeAffectedProjects") {
  // Glob patterns of files to include in computing
  includePatterns.addAll(
    "**/*.kt",
    "**/*.java",
  )
  // Glob patterns of files that, if changed, should result in not skipping anything in the build
  neverSkipPatterns.addAll(
    "**/*.versions.toml",
    "gradle/wrapper/**",
  )
}

Debug logging can be enabled via the slack.debug=true Gradle property. This will output timings, logs, and diagnostics for the task.

The configurations used to determine the build graph can be customized via comma-separated list to the slack.avoidance.affected-project-configurations property.

foundry -

Published by ZacSweers over 1 year ago

Happy Ted Lasso season 3 premier day!

  • Fix: Remove UseContainerSupport jvm arg from unit tests as this appears to only work on Linux.
foundry -

Published by ZacSweers over 1 year ago

Happy Pi day!

  • Refactor how unit tests are configured.
    • Test tasks are now configured more consistently across CI and local, so there should be more cache hits.
    • Add a new globalCiUnitTest task to the root project to ease running ciUnitTest tasks across all subprojects.
    • Add new properties to SlackProperties for controlling max parallelism and forkEvery options in Test tasks.
  • Refactor how lint tasks are configured.
    • Add a new ciLint task to every project that depends on all lint tasks in that project. This is intended to be the inverse
      behavior of the built-in lint task in Android projects, which only runs the default variant's lint task.
    • Add a new globalCiLint task to the root project to ease running ciLint tasks across all subprojects.
    • Add new properties to SlackProperties for controlling which variants should be linted.
  • Revert "Add lintErrorRuleIds property". lint.xml is the right place for this kind of logic.
foundry - 0.5.10

Published by ZacSweers over 1 year ago

  • Reduce noisy JNA load failures logging. Still have not gotten to the root cause, but at least this will reduce the log noise.
  • Add a new slack.lint.severity.errorRuleIds Gradle property to specify lint rule IDs that should always be error severity.

What's Changed

Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.5.9...0.5.10

foundry -

Published by ZacSweers over 1 year ago

  • Gracefully handle JNA load failures in thermals logging.
foundry -

Published by ZacSweers over 1 year ago

  • Enhancement: Remove kotlin-dsl from the plugin. If you were indirectly relying on its APIs from this plugin, you'll need to add that dependency separately.
  • Enhancement: Better support fully modularized lints
    • checkDependencies is no longer enabled by default.
    • Make the baseline file name configurable via slack.lint.baseline-file-name property. Defaults to lint-baseline.xml.
  • Fix: ImplicitSamInstance lint not being enabled.
foundry -

Published by ZacSweers over 1 year ago

  • Fix: MergeFileTask.kt was accidentally removed during a previous release.
  • Fix: Add jna-platform dependency to align with the jna dependency version.
foundry -

Published by ZacSweers over 1 year ago

  • Fix: LocTask is now compatible with Gradle 8.0 and has the correct task dependencies when Ksp, Kapt, etc are running.

  • Fix: LocTask is now compatible with remote build cache.

  • Enhancement: ModScore now supports KSP.

  • Enhancement: Binary download tasks (KtfmtDownloadTask, DetektDownloadTask, etc) now have prettier and more reliable download progress indications.

    https://user-images.githubusercontent.com/1361086/218535483-10e2a10d-838a-4c22-9810-0308601631fd.mov

  • Enhancement: UpdateRobolectricJarsTask now uses Gradle workers to parallelize downloads. On gigabit wifi, this takes the task runtime down from ~21sec to ~13sec.

  • Enhancement: The boolean SLACK_FORCE_REDOWNLOAD_ROBOLECTRIC_JARS env variable can be used to force UpdateRobolectricJarsTask to redownload jars even if already downloaded.

  • Behavior change: Mod score must now be opted in to via the slack.gradle.config.modscore.enabled=true gradle property.

  • Enhancement: Mod score can be disabled per-project via the slack.gradle.config.modscore.ignore=true gradle property.

foundry -

Published by ZacSweers over 1 year ago

  • New: Integrate gradle-dependency-sorter as another formatter. This automatically apply if the sortDependencies toml version is present, and you can have it download+create executable binaries via ./gradlew downloadDependenciesSorter.
  • Enhancement: Improve compose multiplatform support. Now the compose() DSL is moved to slack.features and offers an optional multiplatform parameter to enable the compose multiplatform plugin.
    slack {
      features {
        compose(multiplatform = <true|false>)
      }
    }
    
  • Build against Kotlin 1.8.10 and AGP 7.4.1.
foundry -

Published by ZacSweers over 1 year ago

  • Fix: Unwrap Optional for google-coreLibraryDesugaring dependency before adding it. The Gradle API's lack of type safety strikes again.
foundry -

Published by ZacSweers over 1 year ago

  • New: Introduce a new sgp-monkeypatch-agp artifact. This contains monkeypatches for AGP where we try to fix bugs. This initial version contains a patched MergeFilesTask that sorts files before merging them to ensure deterministic outputs, as we believe this is causing our lint tasks to be non-cacheable across machines. This can be enabled via setting the com.slack.sgp.sort-merge-files system property to true.
  • New: Rework how bugsnag is enabled. Instead of only applying the plugin in release/main builds, we now always apply the plugin and only enable uploads on release/main builds. This allows us to catch issues with the plugin in updates sooner, as before we would not see them on PRs.
    • Uploads can be force-enabled via setting the slack.gradle.config.bugsnag.enabled gradle property to true.
    • Branches that allow uploads can be configured via regexp value on the slack.gradle.config.bugsnag.enabledBranchPattern gradle property. For example: slack.gradle.config.bugsnag.enabledBranchPattern=main|release_.*.
  • New: Source desugar libraries from libs.versions.toml instead of assuming the artifact name. Starting with 1.2.0, desugar JDK libs offers multiple artifacts. Point google-coreLibraryDesugaring in [libraries] to whichever artifact should be used.
  • Fix: Catch and print errors with thermal closes.
  • Misc: Update to JDK 19 and latest AGPs. The plugin itself still targets JVM 11 bytecode. AGP 7.4.0 is now required.
foundry -

Published by ZacSweers almost 2 years ago

  • Enhancement: Change default gradle memory percent in bootstrap from 25% to 50%.
  • Fix: Support the gradle enterprise plugin retry implementation when using Gradle enterprise 3.12+.
foundry - 0.4.1

Published by ZacSweers almost 2 years ago

  • Fix: Remove EitherNet compiler option opt-ins.
  • Update Okio to 3.3.0.

What's Changed

Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.4.0...0.4.1

foundry - 0.4.0

Published by ZacSweers almost 2 years ago

  • Update to Kotlin 1.8.0. This plugin now requires Kotlin 1.8.0 or later as it only configures KGP's new compilerOptions API now.

What's Changed

Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.8...0.4.0

foundry -

Published by ZacSweers almost 2 years ago

  • Add support for AGP 8.0.0-alpha10.
foundry -

Published by ZacSweers almost 2 years ago

  • Fix: Don't apply freeCompilerArguments.
  • Fix: Add missing license information to published POM files.
foundry - 0.3.6

Published by ZacSweers almost 2 years ago

  • Backport android.packagingOptions.jniLibs.pickFirst for AGP 8.x compatibility, as the returned type by jniLibs changed from JniLibsPackagingOptions to JniLibsPackaging.

What's Changed

Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.5...0.3.6

foundry - 0.3.5

Published by ZacSweers almost 2 years ago

  • Introduce compileCiUnitTest lifecycle task to just compile (but not run!) unit tests that are run by ciUnitTest.

What's Changed

Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.4...0.3.5