Bug 1208793 - Part 4: Remove 'preprocessed_code' Gradle project. r=sebastian

DONTBUILD NPOTB

This needed the same dependency changes that the previous part did.
There's a nice simplification here because some of the code is now
being compiled in the containing project (base) and not the (now
removed) sibling project.
This commit is contained in:
Nick Alexander 2015-10-19 18:22:32 -07:00
parent 910f4af6ba
commit 599b705d3d
5 changed files with 18 additions and 66 deletions

View File

@ -46,8 +46,13 @@ android {
srcDir 'src/webrtc_video_render'
}
// Adjust helpers are included in the preprocessed_code project.
exclude 'org/mozilla/gecko/adjust/**'
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
exclude 'org/mozilla/gecko/adjust/StubAdjustHelper.java'
} else {
exclude 'org/mozilla/gecko/adjust/AdjustHelper.java'
}
srcDir "${project.buildDir}/generated/source/preprocessed_code" // See syncPreprocessedCode.
}
res {
@ -71,12 +76,19 @@ android {
}
}
task syncPreprocessedCode(type: Sync, dependsOn: rootProject.generateCodeAndResources) {
into("${project.buildDir}/generated/source/preprocessed_code")
from("${topobjdir}/mobile/android/base/generated/preprocessed")
}
task syncPreprocessedResources(type: Sync, dependsOn: rootProject.generateCodeAndResources) {
into("${project.buildDir}/generated/source/preprocessed_resources")
from("${topobjdir}/mobile/android/base/res")
}
android.libraryVariants.all { variant ->
variant.preBuild.dependsOn syncPreprocessedCode
variant.preBuild.dependsOn syncPreprocessedResources
}
@ -92,9 +104,12 @@ dependencies {
compile 'com.google.android.gms:play-services-cast:8.1.0'
}
compile project(':preprocessed_code')
compile project(':thirdparty')
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
compile project(':thirdparty_adjust_sdk')
}
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.simpleframework:simple-http:4.1.13'

View File

@ -1,4 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.mozilla.gecko.preprocessed_code">
</manifest>

View File

@ -1,53 +0,0 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
targetSdkVersion 22
minSdkVersion 9
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
lintOptions {
abortOnError false
}
sourceSets {
main {
java {
srcDir "${project.buildDir}/generated/source/java"
srcDir 'src/adjust/java'
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
exclude 'org/mozilla/gecko/adjust/StubAdjustHelper.java'
} else {
exclude 'org/mozilla/gecko/adjust/AdjustHelper.java'
}
}
}
}
}
task syncGeneratedSources(type: Sync) {
into("${project.buildDir}/generated/source/java")
from("${topobjdir}/mobile/android/base/generated/preprocessed")
}
android.libraryVariants.all { variant ->
// variant does not expose its generate sources task.
def name = variant.buildType.name
def generateSourcesTask = tasks.findByName("generate${name.capitalize()}Sources")
generateSourcesTask.dependsOn syncGeneratedSources
}
dependencies {
if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
compile project(':thirdparty_adjust_sdk')
}
}

View File

@ -26,14 +26,12 @@ def json = slurper.parseText(standardOutput.toString())
include ':app'
include ':base'
include ':omnijar'
include ':preprocessed_code'
include ':thirdparty'
def gradleRoot = new File("${json.topobjdir}/mobile/android/gradle")
project(':app').projectDir = new File(gradleRoot, 'app')
project(':base').projectDir = new File(gradleRoot, 'base')
project(':omnijar').projectDir = new File(gradleRoot, 'omnijar')
project(':preprocessed_code').projectDir = new File(gradleRoot, 'preprocessed_code')
project(':thirdparty').projectDir = new File(gradleRoot, 'thirdparty')
if (json.substs.MOZ_INSTALL_TRACKING) {

View File

@ -103,10 +103,6 @@ class MachCommands(MachCommandBase):
defines=defines,
deps=os.path.join(self.topobjdir, 'mobile/android/gradle/.deps/local.properties.pp'))
srcdir('preprocessed_code/build.gradle', 'mobile/android/gradle/preprocessed_code/build.gradle')
srcdir('preprocessed_code/src/main/AndroidManifest.xml', 'mobile/android/gradle/preprocessed_code/AndroidManifest.xml')
srcdir('preprocessed_code/src/adjust/java/org/mozilla/gecko/adjust', 'mobile/android/base/adjust')
srcdir('thirdparty/build.gradle', 'mobile/android/gradle/thirdparty/build.gradle')
srcdir('thirdparty/src/main/AndroidManifest.xml', 'mobile/android/gradle/thirdparty/AndroidManifest.xml')
srcdir('thirdparty/src/main/java', 'mobile/android/thirdparty')