在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):slackhq/slack-gradle-plugin开源软件地址(OpenSource Url):https://github.com/slackhq/slack-gradle-plugin开源编程语言(OpenSource Language):Kotlin 100.0%开源软件介绍(OpenSource Introduction):slack-gradle-pluginThis repository contains the core Gradle plugin and associated logic used for Slack's Android app. This repo is effectively read-only and does not publish artifacts to Maven Central. We develop these in the open to knowledge-share with the community. As such, our issue tracker is closed and we don't normally accept external PRs, but we welcome your questions in the discussions section of the project! We may later publish some of these components. If you're interested in this, feel free to raise in a discussions post or vote for existing suggestions. HighlightsCommon project configurationThe This includes a whole host of things!
Feature DSLTo ease use and configuration of common features in projects, we expose a slack {
features {
dagger()
moshi(codegen = true)
}
android {
features {
robolectric()
}
}
} A major benefit of this is that we can intelligently configure features and avoid applying costly plugins like Kapt unless they're actually needed for a specific feature, such as Java injections in projects using Dagger. Since this is pure code, we can also propagate deprecated behavior by deprecating the corresponding functions in the DSL. Platform plugins
Thermal throttling captureMacBooks can suffer thermal throttling and result in poor build performance. We built
instrumentation for this to capture these and include them in our build scans to better understand
their impact. We support both Intel and Apple Silicon macs now and contain this implementation in
Better PropertiesGradle's built-in property support is limited and has surprising behavior, so we have our own
system on top of it that has consistent precedence, Dependency Rake
Module Stats (aka "Mod Score")As a part of our modularization efforts, we developed a scoring mechanism for modules that we could
use as a measure of their "modularization". This includes a number of metrics and weighs them in a
formula to compute a score. This includes LoC, language mixtures, and build graph centrality. This
logic is under the Robolectric Jars ManagementRobolectric uses preinstrumented Android API jars that live on maven central. While it can handle
downloading of these automatically, we found this implementation to be brittle and unreliable, so we
built our own version of it that handles downloading these into a local BootstrapWe try to simplify and streamline the bootstrap process for both local development and on CI. This
involves computing optimized JVM arguments for the Gradle and Kotlin daemons (which differ between
CI and local) as well as toe-holds for future customizations. This logic lives in Permission ChecksTo avoid accidentally checking in any new, unexpected manifest permissions, we have a
slack {
android {
app {
permissionAllowlist {
if (name == "externalRelease") {
setAllowlistFile(file("permissionsAllowlist.txt"))
}
}
}
}
} APK Versioning ComputersAGP offers new property-based APIs for computing APK version codes and version names. We use this
to compute information from different inputs (CI build number, git state, etc) and control this
logic in Check dependency versionsSometimes a dependency update may bring with it a surprise update to a transitive dependency that
we also declare. In order to avoid this happening unexpectedly, the AGP HandlersAGP occasionally contains new or breaking API changes that we want to handle gracefully in early
testing. We regularly test against newer preview versions of AGP so we can't just
hardcode in new APIs and expect them to work everywhere. To handle this, we have an Detekt baseliningDetekt is a static analysis tool that we use to check for common issues in our code. We use one
global baseline file for baselined issues (when introducing new checks or updates), but Detekt
doesn't currently support this easily. So, we built Misc toolsThere are a ton of miscellaneous tools, utilities, and glue code for Gradle (and various plugins) sprinkled throughout this project. Usage requirementsSGP expects there to be a The following versions are required to be set the above catalog.
Their docs can be found in
The following plugins are applied by default but can be disabled if you don't need them.
License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论