Bug 1107811 - Part 3: Fix Gradle configurations. r=me
authorNick Alexander <nalexander@mozilla.com>
Sat, 05 Dec 2015 17:33:55 -0800
changeset 297142 2735a465e5582f716c68d6e12546074ab5e0432b
parent 297141 fe2727dce60dd69c15d20221c15adf3c846fde67
child 297143 7fb27cc3a41695df71c52db2bf093fdf8cdb43be
push idunknown
push userunknown
push dateunknown
reviewersme
bugs1107811
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1107811 - Part 3: Fix Gradle configurations. r=me
mobile/android/app/base/build.gradle
mobile/android/mach_commands.py
settings.gradle
--- a/mobile/android/app/base/build.gradle
+++ b/mobile/android/app/base/build.gradle
@@ -22,18 +22,17 @@ android {
         abortOnError false
     }
 
     sourceSets {
         main {
             manifest.srcFile "${topsrcdir}/mobile/android/base/AndroidManifest.xml"
 
             java {
-                srcDir "${topobjdir}/gradle/base/src"
-
+                srcDir "${topsrcdir}/mobile/android/base/java"
                 srcDir "${topsrcdir}/mobile/android/search/java"
                 srcDir "${topsrcdir}/mobile/android/javaaddons/java"
                 srcDir "${topsrcdir}/mobile/android/services/src/main/java"
 
                 if (mozconfig.substs.MOZ_ANDROID_MLS_STUMBLER) {
                     srcDir "${topsrcdir}/mobile/android/stumbler/java"
                 }
 
@@ -125,11 +124,10 @@ dependencies {
     testCompile 'org.robolectric:robolectric:3.0'
     testCompile 'org.simpleframework:simple-http:4.1.13'
 }
 
 apply plugin: 'idea'
 
 idea {
     module {
-        excludeDirs += file("${topobjdir}/gradle/base/src/org/mozilla/gecko/resources")
     }
 }
--- a/mobile/android/mach_commands.py
+++ b/mobile/android/mach_commands.py
@@ -118,17 +118,17 @@ class MachCommands(MachCommandBase):
         srcdir('app/src/robocop', 'mobile/android/tests/browser/robocop/src')
         srcdir('app/src/background', 'mobile/android/tests/background/junit3/src')
         srcdir('app/src/browser', 'mobile/android/tests/browser/junit3/src')
         srcdir('app/src/javaaddons', 'mobile/android/tests/javaaddons/src')
 
         srcdir('base/build.gradle', 'mobile/android/gradle/base/build.gradle')
         srcdir('base/lint.xml', 'mobile/android/gradle/base/lint.xml')
         srcdir('base/src/main/AndroidManifest.xml', 'mobile/android/gradle/base/AndroidManifest.xml')
-        srcdir('base/src/main/java/org/mozilla/gecko', 'mobile/android/base')
+        srcdir('base/src/main/java/org/mozilla/gecko', 'mobile/android/base/java/org/mozilla/gecko')
         srcdir('base/src/main/java/org/mozilla/mozstumbler', 'mobile/android/stumbler/java/org/mozilla/mozstumbler')
         srcdir('base/src/main/java/org/mozilla/search', 'mobile/android/search/java/org/mozilla/search')
         srcdir('base/src/main/java/org/mozilla/javaaddons', 'mobile/android/javaaddons/java/org/mozilla/javaaddons')
         srcdir('base/src/services', 'mobile/android/services/src/main')
         srcdir('base/src/webrtc_audio_device/java', 'media/webrtc/trunk/webrtc/modules/audio_device/android/java/src')
         srcdir('base/src/webrtc_video_capture/java', 'media/webrtc/trunk/webrtc/modules/video_capture/android/java/src')
         srcdir('base/src/webrtc_video_render/java', 'media/webrtc/trunk/webrtc/modules/video_render/android/java/src')
         srcdir('base/src/main/res', 'mobile/android/base/resources')
--- a/settings.gradle
+++ b/settings.gradle
@@ -16,35 +16,16 @@ if (proc.exitValue() != 0) {
 import groovy.json.JsonSlurper
 def slurper = new JsonSlurper()
 def json = slurper.parseText(standardOutput.toString())
 
 if (json.substs.MOZ_BUILD_APP != 'mobile/android') {
     throw new GradleException("Building with Gradle is only supported for Fennec, i.e., MOZ_BUILD_APP == 'mobile/android'.");
 }
 
-def srcdir = { dst, src ->
-    def d = java.nio.file.Paths.get("${json.topobjdir}/gradle/${dst}")
-    def s = java.nio.file.Paths.get("${json.topsrcdir}/${src}")
-    try {
-        java.nio.file.Files.createDirectories(d.getParent())
-    } catch (java.nio.file.FileAlreadyExistsException e) {
-        // Do nothing.
-    }
-    try {
-        java.nio.file.Files.createSymbolicLink(d, s)
-    } catch (java.nio.file.FileAlreadyExistsException e) {
-        // Do nothing.
-    }
-}
-
-// Since base/ doesn't have the correct package prefix directory structure, we
-// still need to symlink.
-srcdir('base/src/org/mozilla/gecko', 'mobile/android/base')
-
 include ':app'
 include ':base'
 include ':omnijar'
 include ':thirdparty'
 
 project(':app').projectDir = new File("${json.topsrcdir}/mobile/android/app")
 project(':base').projectDir = new File("${json.topsrcdir}/mobile/android/app/base")
 project(':omnijar').projectDir = new File("${json.topsrcdir}/mobile/android/app/omnijar")