Gradle and IntelliJ build tooling used in Slack's Android repo
APACHE-2.0 License
Bot releases are hidden (Show)
-Pslack.compose.android.enableLiveLiterals=true
.
.github/actions/**
to default never skip filters.affected_projects.txt
and allow non-existent files as a value. This makes it easy to gracefully fall back in CI.6.4.1
.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.
Happy Pi day!
Test
tasks are now configured more consistently across CI and local, so there should be more cache hits.globalCiUnitTest
task to the root project to ease running ciUnitTest
tasks across all subprojects.SlackProperties
for controlling max parallelism and forkEvery
options in Test
tasks.ciLint
task to every project that depends on all lint tasks in that project. This is intended to be the inverselint
task in Android projects, which only runs the default variant's lint task.globalCiLint
task to the root project to ease running ciLint
tasks across all subprojects.SlackProperties
for controlling which variants should be linted.lint.xml
is the right place for this kind of logic.Published by ZacSweers over 1 year ago
slack.lint.severity.errorRuleIds
Gradle property to specify lint rule IDs that should always be error severity.Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.5.9...0.5.10
checkDependencies
is no longer enabled by default.slack.lint.baseline-file-name
property. Defaults to lint-baseline.xml
.ImplicitSamInstance
lint not being enabled.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.
sortDependencies
toml version is present, and you can have it download+create executable binaries via ./gradlew downloadDependenciesSorter
.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>)
}
}
1.8.10
and AGP 7.4.1
.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
.slack.gradle.config.bugsnag.enabled
gradle property to true.slack.gradle.config.bugsnag.enabledBranchPattern
gradle property. For example: slack.gradle.config.bugsnag.enabledBranchPattern=main|release_.*
.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.Published by ZacSweers almost 2 years ago
3.3.0
.Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.4.0...0.4.1
Published by ZacSweers almost 2 years ago
compilerOptions
API now.Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.8...0.4.0
Published by ZacSweers almost 2 years ago
android.packagingOptions.jniLibs.pickFirst
for AGP 8.x compatibility, as the returned type by jniLibs
changed from JniLibsPackagingOptions
to JniLibsPackaging
.Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.5...0.3.6
Published by ZacSweers almost 2 years ago
compileCiUnitTest
lifecycle task to just compile (but not run!) unit tests that are run by ciUnitTest
.Full Changelog: https://github.com/slackhq/slack-gradle-plugin/compare/0.3.4...0.3.5