Skip to content

Include tests in build and increase version number to 2 #91

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ android {
applicationId = "com.android.developers.androidify"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = 36
versionCode = 1
versionName = "1.0"
versionCode = 2
versionName = "1.0.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ echo "INFO: Cleaning the project..."

# Build the production release bundle without generating a baseline profile.
echo "INFO: Building the production release bundle..."
./gradlew app:bundleRelease app:spdxSbomForRelease -x test -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
./gradlew app:bundleRelease app:spdxSbomForRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the -x test flag alone is not enough to run the tests during the build. The bundleRelease Gradle task does not have a dependency on the test task, so tests will not be executed automatically.

To ensure tests are run, you need to explicitly add the test task to the command.

Suggested change
./gradlew app:bundleRelease app:spdxSbomForRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
./gradlew test app:bundleRelease app:spdxSbomForRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true


# --- Artifact Collection ---
echo "INFO: Preparing artifacts for Kokoro..."
Expand Down
2 changes: 1 addition & 1 deletion build_presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ echo "INFO: Cleaning the project..."

# Build the production release bundle without generating a baseline profile.
echo "INFO: Building the production release bundle..."
./gradlew app:bundleRelease app:spdxSbomForRelease -x test -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
./gradlew app:bundleRelease app:spdxSbomForRelease -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the -x test flag alone is not enough to run the tests during the build. The bundleRelease Gradle task does not have a dependency on the test task, so tests will not be executed automatically.

To ensure tests are run, you need to explicitly add the test task to the command.

Suggested change
./gradlew app:bundleRelease app:spdxSbomForRelease -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true
./gradlew test app:bundleRelease app:spdxSbomForRelease -x uploadCrashlyticsMappingFileRelease -Pandroid.sdk.path=$ANDROID_HOME -PCI_BUILD=true


# --- Artifact Collection ---
echo "INFO: Preparing artifacts for Kokoro..."
Expand Down