Backed out changeset 9a3c4f7cd85e (bug 1384312) for gradle-dependencies bustage

MozReview-Commit-ID: FYZ5jRQ2bOX
This commit is contained in:
Phil Ringnalda 2017-10-13 18:31:44 -07:00
parent f7c951b1c3
commit f023aa4b79
4 changed files with 8 additions and 70 deletions

View File

@ -355,10 +355,6 @@ android.applicationVariants.all { variant ->
} }
} }
android.applicationVariants.all { variant ->
configureVariantWithJNIWrappers(variant, "Fennec")
}
apply plugin: 'spoon' apply plugin: 'spoon'
spoon { spoon {

View File

@ -25,8 +25,6 @@ GARBAGE += \
GARBAGE_DIRS += classes db jars res sync services generated GARBAGE_DIRS += classes db jars res sync services generated
gradle_dir := $(topobjdir)/gradle/build/mobile/android
# The bootclasspath is functionally identical to the classpath, but allows the # The bootclasspath is functionally identical to the classpath, but allows the
# classes given to redefine classes in core packages, such as java.lang. # classes given to redefine classes in core packages, such as java.lang.
# android.jar is here as it provides Android's definition of the Java Standard # android.jar is here as it provides Android's definition of the Java Standard
@ -143,7 +141,6 @@ uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
java_bundled_libs := $(call uniq,$(java_bundled_libs)) java_bundled_libs := $(call uniq,$(java_bundled_libs))
java_bundled_libs := $(subst $(NULL) ,:,$(strip $(java_bundled_libs))) java_bundled_libs := $(subst $(NULL) ,:,$(strip $(java_bundled_libs)))
ifndef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
GECKOVIEW_JARS = \ GECKOVIEW_JARS = \
constants.jar \ constants.jar \
gecko-R.jar \ gecko-R.jar \
@ -169,6 +166,8 @@ ifdef MOZ_ANDROID_MMA
GECKOVIEW_JARS += gecko-thirdparty-leanplum_sdk.jar GECKOVIEW_JARS += gecko-thirdparty-leanplum_sdk.jar
endif endif
geckoview_jars_classpath := $(subst $(NULL) ,:,$(strip $(GECKOVIEW_JARS)))
FENNEC_JARS = \ FENNEC_JARS = \
gecko-browser.jar \ gecko-browser.jar \
gecko-thirdparty.jar \ gecko-thirdparty.jar \
@ -183,17 +182,6 @@ ifdef MOZ_ANDROID_MLS_STUMBLER
FENNEC_JARS += ../stumbler/stumbler.jar FENNEC_JARS += ../stumbler/stumbler.jar
endif endif
else # MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
GECKOVIEW_JARS := $(gradle_dir)/geckoview/intermediates/bundles/debug/classes.jar
FENNEC_JARS := $(gradle_dir)/app/intermediates/packaged/officialPhoton/debug/classes.jar
$(GECKOVIEW_JARS): .gradle.deps
$(FENNEC_JARS): .gradle.deps
endif # MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
geckoview_jars_classpath := $(subst $(NULL) ,:,$(strip $(GECKOVIEW_JARS)))
# All the jars we're compiling from source. (not to be confused with # All the jars we're compiling from source. (not to be confused with
# java_bundled_libs, which holds the jars which we're including as binaries). # java_bundled_libs, which holds the jars which we're including as binaries).
@ -240,30 +228,22 @@ endif # MOZ_INSTALL_TRACKING
library_jars := $(subst $(NULL) ,:,$(strip $(library_jars))) library_jars := $(subst $(NULL) ,:,$(strip $(library_jars)))
gradle_dir := $(topobjdir)/gradle/build/mobile/android
ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE ifdef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
.gradle.deps: .aapt.deps FORCE .gradle.deps: .aapt.deps FORCE
@$(TOUCH) $@ @$(TOUCH) $@
$(topsrcdir)/mach gradle \ $(topsrcdir)/mach gradle \
geckoview:generateJNIWrappersForGeneratedRelease \ app:assembleOfficialPhotonDebug app:assembleOfficialPhotonDebugAndroidTest -x lint
app:generateJNIWrappersForFennecOfficialPhotonDebug \
app:assembleOfficialPhotonDebug \
app:assembleOfficialPhotonDebugAndroidTest \
-x lint
classes.dex: .gradle.deps classes.dex: .gradle.deps
$(REPORT_BUILD) $(REPORT_BUILD)
cp $(gradle_dir)/app/intermediates/transforms/dex/officialPhoton/debug/folders/1000/1f/main/classes.dex $@ cp $(gradle_dir)/app/intermediates/transforms/dex/officialPhoton/debug/folders/1000/1f/main/classes.dex $@
GeneratedJNIWrappers.cpp GeneratedJNIWrappers.h GeneratedJNINatives.h : .gradle.deps
$(REPORT_BUILD)
FennecJNIWrappers.cpp FennecJNIWrappers.h FennecJNINatives.h: .gradle.deps
$(REPORT_BUILD)
else else
classes.dex: .proguard.deps classes.dex: .proguard.deps
$(REPORT_BUILD) $(REPORT_BUILD)
$(DX) --dex --output=classes.dex --force-jumbo jars-proguarded $(DX) --dex --output=classes.dex --force-jumbo jars-proguarded
endif
ifdef MOZ_DISABLE_PROGUARD ifdef MOZ_DISABLE_PROGUARD
PROGUARD_PASSES=0 PROGUARD_PASSES=0
@ -348,8 +328,6 @@ FennecJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES) $(FENNEC_JARS)
org.mozilla.gecko.annotationProcessors.AnnotationProcessor \ org.mozilla.gecko.annotationProcessors.AnnotationProcessor \
Fennec $(FENNEC_JARS) Fennec $(FENNEC_JARS)
endif # MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
not_android_res_files := \ not_android_res_files := \
@ -558,6 +536,7 @@ endif
# GeneratedJNIWrappers.h and GeneratedJNINatives.h # GeneratedJNIWrappers.h and GeneratedJNINatives.h
# FennecJNIWrappers.cpp target also generates # FennecJNIWrappers.cpp target also generates
# FennecJNIWrappers.h and FennecJNINatives.h # FennecJNIWrappers.h and FennecJNINatives.h
ifndef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
# List of build flags used by auto-generated JNI bindings (through the # List of build flags used by auto-generated JNI bindings (through the
# @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this # @BuildFlag annotation in Java). For example, add a "MOZ_FOO \" line to this
@ -607,12 +586,11 @@ libs:: FennecJNIWrappers.cpp
echo '* Repeat the build, and check in any changes. *' && \ echo '* Repeat the build, and check in any changes. *' && \
echo '*****************************************************' && \ echo '*****************************************************' && \
exit 1) exit 1)
endif
libs:: classes.dex libs:: classes.dex
$(INSTALL) classes.dex $(FINAL_TARGET) $(INSTALL) classes.dex $(FINAL_TARGET)
ifndef MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE
# Generate Java binder interfaces from AIDL files. # Generate Java binder interfaces from AIDL files.
GECKOVIEW_AIDLS = \ GECKOVIEW_AIDLS = \
org/mozilla/gecko/IGeckoEditableChild.aidl \ org/mozilla/gecko/IGeckoEditableChild.aidl \
@ -645,5 +623,3 @@ fennec_aidl_targets := $(addprefix $(fennec_aidl_target_path)/,$(patsubst %.aidl
$(fennec_aidl_targets): $(fennec_aidl_target_path)/%.java: $(fennec_aidl_src_path)/%.aidl $(fennec_aidl_targets): $(fennec_aidl_target_path)/%.java: $(fennec_aidl_src_path)/%.aidl
@echo "Processing AIDL: $< => $@" @echo "Processing AIDL: $< => $@"
$(AIDL) -p$(ANDROID_SDK)/framework.aidl -I$(fennec_aidl_src_path) -I$(geckoview_aidl_src_path) -o$(fennec_aidl_target_path) $< $(AIDL) -p$(ANDROID_SDK)/framework.aidl -I$(fennec_aidl_src_path) -I$(geckoview_aidl_src_path) -o$(fennec_aidl_target_path) $<
endif # MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE

View File

@ -167,10 +167,6 @@ android.libraryVariants.all { variant ->
} }
} }
android.libraryVariants.all { variant ->
configureVariantWithJNIWrappers(variant, "Generated")
}
apply plugin: 'maven' apply plugin: 'maven'
uploadArchives { uploadArchives {

View File

@ -121,33 +121,3 @@ ext.configureVariantWithGeckoBinaries = { variant ->
android.sourceSets."${sourceSet}".assets.srcDir syncAssetsFromDistDir.destinationDir android.sourceSets."${sourceSet}".assets.srcDir syncAssetsFromDistDir.destinationDir
android.sourceSets."${sourceSet}".jniLibs.srcDir syncLibsFromDistDir.destinationDir android.sourceSets."${sourceSet}".jniLibs.srcDir syncLibsFromDistDir.destinationDir
} }
ext.configureVariantWithJNIWrappers = { variant, module ->
def jarTask = tasks.findByName("jar${variant.name.capitalize()}Classes")
if (jarTask == null) {
jarTask = tasks.findByName("package${variant.name.capitalize()}JarArtifact")
}
if (jarTask == null) {
throw new GradleException("Jar task not found: \"jar${variant.name.capitalize()}Classes\"\t\"package${variant.name.capitalize()}JarArtifact\"" )
}
if (jarTask.outputs.files.size() != 1) {
throw new GradleException("Jar task output multiple files other than one single jar")
}
def wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}", type: JavaExec) {
classpath = variant.javaCompile.classpath
// Include android.jar.
classpath variant.javaCompile.options.bootClasspath
classpath "${topobjdir}/build/annotationProcessors/annotationProcessors.jar"
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
args module
args jarTask.outputs.files.iterator().next()
workingDir "${topobjdir}/mobile/android/base"
dependsOn jarTask
}
variant.assemble.dependsOn wrapperTask
}