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

Only filter sdk when PREINSTRUMENTED_SDK_VERSIONS is not empty #7787

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 0 additions & 32 deletions .github/workflows/check_aggregateDocs.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/gradle_tasks_validation.yml
@@ -0,0 +1,55 @@
name: Gradle Tasks Validation

on:
push:
branches: [ master ]

pull_request:
branches: [ master, google ]

permissions:
contents: read

jobs:
run_aggregateDocs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 14

- uses: gradle/gradle-build-action@v2

- name: Run aggregateDocs
run: SKIP_NATIVERUNTIME_BUILD=true ./gradlew clean aggregateDocs # building the native runtime is not required for checking javadoc

run_instrumentAll:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11

- uses: gradle/gradle-build-action@v2

- name: Run :preinstrumented:instrumentAll
run: SKIP_NATIVERUNTIME_BUILD=true ./gradlew :preinstrumented:instrumentAll

- name: Run :preinstrumented:instrumentAll with SDK 33
run: SKIP_NATIVERUNTIME_BUILD=true PREINSTRUMENTED_SDK_VERSIONS=33 ./gradlew :preinstrumented:instrumentAll
11 changes: 7 additions & 4 deletions preinstrumented/build.gradle
Expand Up @@ -116,11 +116,14 @@ if (System.getenv('PUBLISH_PREINSTRUMENTED_JARS') == "true") {
}
}

def sdksToInstrument() {
static def sdksToInstrument() {
var result = AndroidSdk.ALL_SDKS
var sdkFilter = (System.getenv('PREINSTRUMENTED_SDK_VERSIONS') ?: "").split(",").collect { it as Integer }
if (sdkFilter.size > 0) {
result = result.findAll { sdkFilter.contains(it.apiLevel) }
var preInstrumentedSdkVersions = (System.getenv('PREINSTRUMENTED_SDK_VERSIONS') ?: "")
if (preInstrumentedSdkVersions.length() > 0) {
var sdkFilter = preInstrumentedSdkVersions.split(",").collect { it as Integer }
if (sdkFilter.size > 0) {
result = result.findAll { sdkFilter.contains(it.apiLevel) }
}
}
return result
}
Expand Down