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

Disable debug builds for library modules. #833

Merged
merged 2 commits into from
Oct 16, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ subprojects {
}
}
}

// Ignore 'debug' buildType for library projects
// Because we don't have debug-specific code and we don't need to build debug variants
// https://gist.github.com/artem-zinnatullin/ec3bce6dcb2cd524c435
if ('com.android.build.gradle.LibraryPlugin'.equals(plugin.class.name)) {
project.android.variantFilter {
if (it.buildType.name.equals('debug')) {
it.ignore = true
}
}
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ SHOULD_PUBLISH_RELEASE="$1"

# For some reason test for annotation processor are failing on a regular CI setup.
# So we had to exclude test task for it from the main build process and execute it as a separate command.
./gradlew clean build checkstyle -PdisablePreDex -x :storio-sqlite-annotations-processor-test:test -x :storio-content-resolver-annotations-processor-test:test
./gradlew :storio-sqlite-annotations-processor-test:testDebugUnitTest
./gradlew :storio-content-resolver-annotations-processor-test:testDebugUnitTest
./gradlew clean build checkstyle -PdisablePreDex --exclude-task :storio-sqlite-annotations-processor-test:test --exclude-task :storio-content-resolver-annotations-processor-test:test
./gradlew :storio-sqlite-annotations-processor-test:test
./gradlew :storio-content-resolver-annotations-processor-test:test

if [ "$SHOULD_PUBLISH_RELEASE" == "publish=true" ]; then
echo "Launching release publishing process..."
Expand Down
6 changes: 4 additions & 2 deletions gradle/jacoco-android.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jacoco {

project.afterEvaluate {
// Grab all build types and product flavors
def buildTypes = android.buildTypes.collect { type -> type.name }
def buildTypes = android.buildTypes
.collect { type -> type.name }
.findAll { buildTypeName -> 'debug'.equals(buildTypeName) == false } // Ideally we should scan for non ignored build variants.
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }

// When no product flavors defined, use empty
Expand Down Expand Up @@ -70,4 +72,4 @@ project.afterEvaluate {
build.dependsOn "${coverageTaskName}"
}
}
}
}