gecko-dev/mobile/android/gradle/build.gradle
Nick Alexander 3f6c59b27c Bug 1171566 - Part 1: Configure Gradle and Spoon. rs=mcomella
There are few things happening here:

* A purely mechanical move of test sources into org.mozilla.test.browser.junit3.
  This is only to make it easy to specify the suite in Spoon.  (But it has the
  advantage of making it possible to move files around in IntelliJ, since the
  symlink points to src instead of org/mozilla/gecko.)

* Specifying the suite (package name) ended up requiring changes to the
  spoon-gradle-plugin anyway.  Hence, I've included this custom
  spoon-gradle-plugin version locally, while I work to upstream the changes.

* Some Gradle trickery to make |mach gradle runBrowserTests| execute Spoon with
  the correct package name.

--HG--
rename : mobile/android/tests/browser/junit3/src/BrowserTestCase.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/BrowserTestCase.java
rename : mobile/android/tests/browser/junit3/src/TestDistribution.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestDistribution.java
rename : mobile/android/tests/browser/junit3/src/TestGeckoBackgroundThread.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestGeckoBackgroundThread.java
rename : mobile/android/tests/browser/junit3/src/TestGeckoMenu.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestGeckoMenu.java
rename : mobile/android/tests/browser/junit3/src/TestGeckoProfilesProvider.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestGeckoProfilesProvider.java
rename : mobile/android/tests/browser/junit3/src/TestGeckoSharedPrefs.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestGeckoSharedPrefs.java
rename : mobile/android/tests/browser/junit3/src/TestImageDownloader.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestImageDownloader.java
rename : mobile/android/tests/browser/junit3/src/TestJarReader.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestJarReader.java
rename : mobile/android/tests/browser/junit3/src/TestRawResource.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestRawResource.java
rename : mobile/android/tests/browser/junit3/src/TestSuggestedSites.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestSuggestedSites.java
rename : mobile/android/tests/browser/junit3/src/TestTopSitesCursorWrapper.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/TestTopSitesCursorWrapper.java
rename : mobile/android/tests/browser/junit3/src/harness/BrowserInstrumentationTestRunner.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/harness/BrowserInstrumentationTestRunner.java
rename : mobile/android/tests/browser/junit3/src/harness/BrowserTestListener.java => mobile/android/tests/browser/junit3/src/org/mozilla/tests/browser/junit3/harness/BrowserTestListener.java
extra : rebase_source : 5eff7e0da0be912838fac0ddad5f6b357800eb45
extra : histedit_source : e76288628e14aeb155d2d3b4033d056c6efdc646
2015-06-04 12:09:23 -07:00

62 lines
1.9 KiB
Groovy

allprojects {
// Expose the per-object-directory configuration to all projects.
ext {
mozconfig = gradle.mozconfig
topsrcdir = gradle.mozconfig.topsrcdir
topobjdir = gradle.mozconfig.topobjdir
}
repositories {
jcenter()
}
}
buildDir "${topobjdir}/mobile/android/gradle/build"
buildscript {
repositories {
jcenter()
// For spoon-gradle-plugin SNAPSHOT release. This needs to go before
// the snapshots repository, otherwise we find a remote 1.0.3-SNAPSHOT
// that doesn't include nalexander's local changes.
maven {
url "file://${topsrcdir}/mobile/android/gradle/m2repo"
}
// For spoon SNAPSHOT releases.
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
}
dependencies {
// IntelliJ 14.0.2 wants 0.14.4; IntelliJ 14.0.3 and Android Studio want
// 1.0.0. There are major issues with the combination of 0.14.4, Gradle
// 2.2.1, and IntelliJ 14.0.2: see Bug 1120032.
classpath 'com.android.tools.build:gradle:1.0.0'
classpath('com.stanfy.spoon:spoon-gradle-plugin:1.0.3-SNAPSHOT') {
// Without these, we get errors linting.
exclude module: 'guava'
}
}
}
task generateCodeAndResources(type:Exec) {
workingDir "${topobjdir}"
commandLine mozconfig.substs.GMAKE
args '-C'
args "${topobjdir}/mobile/android/base"
args 'gradle-targets'
// Only show the output if something went wrong.
ignoreExitValue = true
standardOutput = new ByteArrayOutputStream()
errorOutput = standardOutput
doLast {
if (execResult.exitValue != 0) {
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
}
}
}