From d86b10b8e59ba187990aae7c9f3fb278c69f9a61 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Thu, 26 Oct 2017 15:49:41 -0700 Subject: [PATCH] Bug 1411667 - Remove Spoon plugin references entirely. r=maliu Spoon and some Gradle work allowed to run certain JUnit 3 test suites locally. At the time, running the various test suites was diffficult. Fast forward, and it's easier to run these suites, and in general they are only run in Android Studio. This will only get better as we move the background services tests into a separate module (Bug 1229149). MozReview-Commit-ID: KZTWmkhwi96 --HG-- extra : rebase_source : 5244e81ffe81e8611034fea1edb07681266a7581 --- build.gradle | 21 ------------------ mobile/android/app/build.gradle | 39 --------------------------------- 2 files changed, 60 deletions(-) diff --git a/build.gradle b/build.gradle index 4e30db0694cf..70eed4215840 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ -import java.util.regex.Pattern - def tryInt = { string -> if (string == null) { return string @@ -55,10 +53,6 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.3' - classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.4') { - // Without these, we get errors linting. - exclude module: 'guava' - } // Provided in tree. classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.7.3' } @@ -94,21 +88,6 @@ if ('multi' == System.env.AB_CD) { } } -// Skip unit test for all build variants, unless if it was specifically requested by user. -// The enabled property for the unit test tasks is reset based on the command line task names just before the task execution. -// I bet there is a easier/cleaner way to do this, but this gets the job done for now. -Pattern pattern = Pattern.compile('.*test(.+UnitTest)?.*') -boolean startTasksIncludeTest = gradle.startParameter.taskNames.any { - taskName -> - taskName.matches(pattern) -} -gradle.taskGraph.beforeTask { - Task task -> - if (task.name.matches(pattern)) { - task.enabled = startTasksIncludeTest - } -} - afterEvaluate { subprojects { if (!hasProperty('android')) { diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index cf2383708780..dd0d263d7301 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -355,45 +355,6 @@ android.applicationVariants.all { variant -> configureVariantWithJNIWrappers(variant, "Fennec") } -apply plugin: 'spoon' - -spoon { - // For now, let's be verbose. - debug = true - // It's not helpful to pass when we don't have a device connected. - failIfNoDeviceConnected = true - - def spoonPackageName - if (gradle.startParameter.taskNames.contains('runBrowserTests')) { - spoonPackageName = 'org.mozilla.tests.browser.junit3' - } - if (gradle.startParameter.taskNames.contains('runBackgroundTests')) { - spoonPackageName = 'org.mozilla.gecko.background' - } - if (project.hasProperty('spoonPackageName')) { - // Command line overrides everything. - spoonPackageName = project.spoonPackageName - } - if (spoonPackageName) { - instrumentationArgs = ['-e', "package=${spoonPackageName}".toString()] - } -} - -// // See discussion at https://github.com/stanfy/spoon-gradle-plugin/issues/9. -// afterEvaluate { -// tasks["spoonLocal${android.testBuildType.capitalize()}AndroidTest"].outputs.upToDateWhen { false } - -// // This is an awkward way to define different sets of instrumentation tests. -// // The task name itself is fished at runtime and the package name configured -// // in the spoon configuration. -// task runBrowserTests { -// dependsOn tasks["spoonLocalOldDebugAndroidTest"] -// } -// task runBackgroundTests { -// dependsOn tasks["spoonLocalOldDebugAndroidTest"] -// } -// } - // Bug 1299015: Complain to treeherder if checkstyle, lint, or unittest fails. It's not obvious // how to listen to individual errors in most cases, so we just link to the reports for now. def makeTaskExecutionListener(artifactRootUrl) {