mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
fix(build): make slim tests optional
This commit is contained in:
parent
d8a76cf1e7
commit
c089e5ae5a
3 changed files with 19 additions and 15 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -46,7 +46,7 @@ jobs:
|
|||
- name: Run unit tests
|
||||
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 # v2.4.2
|
||||
with:
|
||||
arguments: --no-configuration-cache --stacktrace check
|
||||
arguments: --no-configuration-cache --stacktrace check -PslimTests
|
||||
gradle-home-cache-cleanup: true
|
||||
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
|
||||
|
||||
|
|
2
.github/workflows/codeql_analysis.yml
vendored
2
.github/workflows/codeql_analysis.yml
vendored
|
@ -58,7 +58,7 @@ jobs:
|
|||
- name: Build project
|
||||
shell: bash
|
||||
run: |
|
||||
./gradlew assemble
|
||||
./gradlew assemble -PslimTests
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@f6e388ebf0efc915c6c5b165b019ee61a6746a38 # v2.20.1
|
||||
|
|
|
@ -31,6 +31,7 @@ class AndroidCommonPlugin : Plugin<Project> {
|
|||
const val COMPILE_SDK = 34
|
||||
const val MIN_SDK = 26
|
||||
const val TARGET_SDK = 34
|
||||
const val SLIM_TESTS_PROPERTY = "slimTests"
|
||||
}
|
||||
|
||||
override fun apply(project: Project) {
|
||||
|
@ -68,22 +69,25 @@ class AndroidCommonPlugin : Plugin<Project> {
|
|||
val libs = catalog.named("libs")
|
||||
project.dependencies.addProvider("lintChecks", libs.findLibrary("slack-compose-lints").get())
|
||||
}
|
||||
}
|
||||
|
||||
private fun Project.configureSlimTests() {
|
||||
// Disable unit test tasks on the release build type for Android Library projects
|
||||
extensions.findByType<LibraryAndroidComponentsExtension>()?.run {
|
||||
beforeVariants(selector().withBuildType("release")) {
|
||||
(it as HasUnitTestBuilder).enableUnitTest = false
|
||||
it.enableAndroidTest = false
|
||||
private fun Project.configureSlimTests() {
|
||||
if (!providers.gradleProperty(SLIM_TESTS_PROPERTY).isPresent) {
|
||||
return
|
||||
}
|
||||
// Disable unit test tasks on the release build type for Android Library projects
|
||||
extensions.findByType<LibraryAndroidComponentsExtension>()?.run {
|
||||
beforeVariants(selector().withBuildType("release")) {
|
||||
(it as HasUnitTestBuilder).enableUnitTest = false
|
||||
it.enableAndroidTest = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Disable unit test tasks on the release build type for Android Application projects.
|
||||
extensions.findByType<ApplicationAndroidComponentsExtension>()?.run {
|
||||
beforeVariants(selector().withBuildType("release")) {
|
||||
(it as HasUnitTestBuilder).enableUnitTest = false
|
||||
it.enableAndroidTest = false
|
||||
// Disable unit test tasks on the release build type for Android Application projects.
|
||||
extensions.findByType<ApplicationAndroidComponentsExtension>()?.run {
|
||||
beforeVariants(selector().withBuildType("release")) {
|
||||
(it as HasUnitTestBuilder).enableUnitTest = false
|
||||
it.enableAndroidTest = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue