Backed out 2 changesets (bug 1924520) partial backout for as requested by Aaditya Dhingra. CLOSED TREE
Backed out changeset 17764af0218a (bug 1924520) Backed out changeset 4447d8955f60 (bug 1924520)
This commit is contained in:
@@ -134,7 +134,7 @@ ifeq ($(MOZ_BUILD_APP),mobile/android)
|
|||||||
recurse_android-stage-package: stage-package
|
recurse_android-stage-package: stage-package
|
||||||
|
|
||||||
recurse_android-archive-geckoview:
|
recurse_android-archive-geckoview:
|
||||||
GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(topsrcdir)/mach --log-no-times android archive-geckoview $(if $(MOZ_AUTOMATION),--no-configuration-cache)
|
GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(topsrcdir)/mach --log-no-times android archive-geckoview
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef MOZ_WIDGET_TOOLKIT
|
ifdef MOZ_WIDGET_TOOLKIT
|
||||||
|
|||||||
27
build.gradle
27
build.gradle
@@ -212,6 +212,23 @@ allprojects {
|
|||||||
|
|
||||||
buildDir "${topobjdir}/gradle/build"
|
buildDir "${topobjdir}/gradle/build"
|
||||||
|
|
||||||
|
// A stream that processes bytes line by line, prepending a tag before sending
|
||||||
|
// each line to Gradle's logging.
|
||||||
|
class TaggedLogOutputStream extends org.apache.commons.exec.LogOutputStream {
|
||||||
|
String tag
|
||||||
|
Logger logger
|
||||||
|
|
||||||
|
TaggedLogOutputStream(tag, logger) {
|
||||||
|
this.tag = tag
|
||||||
|
this.logger = logger
|
||||||
|
}
|
||||||
|
|
||||||
|
void processLine(String line, int level) {
|
||||||
|
logger.lifecycle("${this.tag} ${line}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
import org.gradle.api.services.BuildServiceParameters
|
import org.gradle.api.services.BuildServiceParameters
|
||||||
abstract class MozconfigService implements BuildService<MozconfigService.Params>, AutoCloseable {
|
abstract class MozconfigService implements BuildService<MozconfigService.Params>, AutoCloseable {
|
||||||
interface Params extends BuildServiceParameters {
|
interface Params extends BuildServiceParameters {
|
||||||
@@ -361,8 +378,9 @@ task machBuildFaster(type: MachExec) {
|
|||||||
args '-v'
|
args '-v'
|
||||||
}
|
}
|
||||||
|
|
||||||
standardOutput = System.out
|
// `path` is like `:machBuildFaster`.
|
||||||
errorOutput = System.err
|
standardOutput = new TaggedLogOutputStream("${path}>", logger)
|
||||||
|
errorOutput = standardOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
task machStagePackage(type: MachExec) {
|
task machStagePackage(type: MachExec) {
|
||||||
@@ -390,8 +408,9 @@ task machStagePackage(type: MachExec) {
|
|||||||
// Force running `stage-package`.
|
// Force running `stage-package`.
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
|
|
||||||
standardOutput = System.out
|
// `path` is like `:machStagePackage`.
|
||||||
errorOutput = System.err
|
standardOutput = new TaggedLogOutputStream("${path}>", logger)
|
||||||
|
errorOutput = standardOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
|||||||
@@ -8,14 +8,6 @@ org.gradle.configureondemand=true
|
|||||||
# Be careful when changing org.gradle.jvmargs below. It will clobber
|
# Be careful when changing org.gradle.jvmargs below. It will clobber
|
||||||
# any defaults set by Gradle: https://github.com/gradle/gradle/issues/19750
|
# any defaults set by Gradle: https://github.com/gradle/gradle/issues/19750
|
||||||
org.gradle.jvmargs=-Xmx8g -Xms2g -XX:MaxMetaspaceSize=6g
|
org.gradle.jvmargs=-Xmx8g -Xms2g -XX:MaxMetaspaceSize=6g
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
|
||||||
|
|
||||||
# Bug 1946302: Currently task of type `com.google.android.gms.oss.licenses.plugin.LicensesTask` fails as
|
|
||||||
# notCompatibleWithConfigurationCache. Issue tracked in https://github.com/google/play-services-plugins/issues/246
|
|
||||||
# Solution provided here: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api/-task/not-compatible-with-configuration-cache.html
|
|
||||||
org.gradle.configuration-cache.problems=warn
|
|
||||||
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.nonTransitiveRClass=false
|
android.nonTransitiveRClass=false
|
||||||
android.nonFinalResIds=false
|
android.nonFinalResIds=false
|
||||||
|
|||||||
@@ -117,36 +117,38 @@ subprojects {
|
|||||||
|
|
||||||
testLogging.events = []
|
testLogging.events = []
|
||||||
|
|
||||||
|
def out = services.get(StyledTextOutputFactory).create("an-ouput")
|
||||||
|
|
||||||
beforeSuite { descriptor ->
|
beforeSuite { descriptor ->
|
||||||
if (descriptor.getClassName() != null) {
|
if (descriptor.getClassName() != null) {
|
||||||
println("\nSUITE: " + descriptor.getClassName())
|
out.style(Style.Header).println("\nSUITE: " + descriptor.getClassName())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeTest { descriptor ->
|
beforeTest { descriptor ->
|
||||||
println(" TEST: " + descriptor.getName())
|
out.style(Style.Description).println(" TEST: " + descriptor.getName())
|
||||||
}
|
}
|
||||||
|
|
||||||
onOutput { descriptor, event ->
|
onOutput { descriptor, event ->
|
||||||
it.logger.lifecycle(" " + event.message.trim())
|
logger.lifecycle(" " + event.message.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
afterTest { descriptor, result ->
|
afterTest { descriptor, result ->
|
||||||
switch (result.getResultType()) {
|
switch (result.getResultType()) {
|
||||||
case ResultType.SUCCESS:
|
case ResultType.SUCCESS:
|
||||||
println(" SUCCESS")
|
out.style(Style.Success).println(" SUCCESS")
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.FAILURE:
|
case ResultType.FAILURE:
|
||||||
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
||||||
println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
out.style(Style.Failure).println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.SKIPPED:
|
case ResultType.SKIPPED:
|
||||||
println(" SKIPPED")
|
out.style(Style.Info).println(" SKIPPED")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
it.logger.lifecycle("")
|
logger.lifecycle("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,15 +47,11 @@ tasks.register("syncWebcompatExtension", Sync) {
|
|||||||
// webcompat adopted #include directives in Bug 1936031, which are only
|
// webcompat adopted #include directives in Bug 1936031, which are only
|
||||||
// processed for Desktop builds. The filter below pre-processes the files
|
// processed for Desktop builds. The filter below pre-processes the files
|
||||||
// that include these directives.
|
// that include these directives.
|
||||||
|
|
||||||
// configuration-cache doesn't allow calling file() from a groovy closure,
|
|
||||||
// in this case filesMatching callback, so we call file before the closure.
|
|
||||||
def interventionsJson = file("$topsrcdir/browser/extensions/webcompat/data/interventions.json")
|
|
||||||
filesMatching([
|
filesMatching([
|
||||||
'**/run.js',
|
'**/run.js',
|
||||||
]) {
|
]) {
|
||||||
filter(ReplaceTokens, beginToken: '', endToken: '', tokens: [
|
filter(ReplaceTokens, beginToken: '', endToken: '', tokens: [
|
||||||
'#include data/interventions.json': interventionsJson.text.trim(),
|
'#include data/interventions.json': file("$topsrcdir/browser/extensions/webcompat/data/interventions.json").text.trim(),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ preBuild.finalizedBy("generateComponentEnum")
|
|||||||
* Generates a "Components" enum listing all published components.
|
* Generates a "Components" enum listing all published components.
|
||||||
*/
|
*/
|
||||||
tasks.register("generateComponentEnum") {
|
tasks.register("generateComponentEnum") {
|
||||||
def buildConfigCache = buildConfig
|
|
||||||
doLast {
|
doLast {
|
||||||
generatedSrcDir.mkdirs()
|
generatedSrcDir.mkdirs()
|
||||||
|
|
||||||
@@ -114,7 +113,7 @@ tasks.register("generateComponentEnum") {
|
|||||||
file << "\n"
|
file << "\n"
|
||||||
file << "enum class Component {" << "\n"
|
file << "enum class Component {" << "\n"
|
||||||
|
|
||||||
file << buildConfigCache.projects.findAll { project ->
|
file << buildConfig.projects.findAll { project ->
|
||||||
project.value.publish
|
project.value.publish
|
||||||
}.collect { project ->
|
}.collect { project ->
|
||||||
" " + project.key.replace("-", "_").toUpperCase(Locale.US)
|
" " + project.key.replace("-", "_").toUpperCase(Locale.US)
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
|||||||
apply plugin: 'kotlinx-serialization'
|
apply plugin: 'kotlinx-serialization'
|
||||||
|
|
||||||
import groovy.json.JsonOutput
|
import groovy.json.JsonOutput
|
||||||
|
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||||
|
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
import static org.gradle.api.tasks.testing.TestResult.ResultType
|
import static org.gradle.api.tasks.testing.TestResult.ResultType
|
||||||
@@ -829,18 +831,17 @@ if (project.hasProperty("coverage")) {
|
|||||||
// Usage: "./gradlew printVariants
|
// Usage: "./gradlew printVariants
|
||||||
// -------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------
|
||||||
tasks.register('printVariants') {
|
tasks.register('printVariants') {
|
||||||
def variants = project.provider {
|
doLast {
|
||||||
android.applicationVariants.collect { variant -> [
|
def variants = android.applicationVariants.collect { variant -> [
|
||||||
apks: variant.outputs.collect { output -> [
|
apks: variant.outputs.collect { output -> [
|
||||||
abi: output.getFilter(FilterConfiguration.FilterType.ABI.name()),
|
abi: output.getFilter(FilterConfiguration.FilterType.ABI.name()),
|
||||||
fileName: output.outputFile.name
|
fileName: output.outputFile.name
|
||||||
]},
|
]},
|
||||||
build_type: variant.buildType.name,
|
build_type: variant.buildType.name,
|
||||||
name: variant.name,
|
name: variant.name,
|
||||||
]}}
|
]}
|
||||||
doLast {
|
|
||||||
// AndroidTest is a special case not included above
|
// AndroidTest is a special case not included above
|
||||||
variants.get().add([
|
variants.add([
|
||||||
apks: [[
|
apks: [[
|
||||||
abi: 'noarch',
|
abi: 'noarch',
|
||||||
fileName: 'app-debug-androidTest.apk',
|
fileName: 'app-debug-androidTest.apk',
|
||||||
@@ -848,7 +849,7 @@ tasks.register('printVariants') {
|
|||||||
build_type: 'androidTest',
|
build_type: 'androidTest',
|
||||||
name: 'androidTest',
|
name: 'androidTest',
|
||||||
])
|
])
|
||||||
println 'variants: ' + JsonOutput.toJson(variants.get())
|
println 'variants: ' + JsonOutput.toJson(variants)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,36 +862,38 @@ afterEvaluate {
|
|||||||
|
|
||||||
testLogging.events = []
|
testLogging.events = []
|
||||||
|
|
||||||
|
def out = services.get(StyledTextOutputFactory).create("tests")
|
||||||
|
|
||||||
beforeSuite { descriptor ->
|
beforeSuite { descriptor ->
|
||||||
if (descriptor.getClassName() != null) {
|
if (descriptor.getClassName() != null) {
|
||||||
println("\nSUITE: " + descriptor.getClassName())
|
out.style(Style.Header).println("\nSUITE: " + descriptor.getClassName())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeTest { descriptor ->
|
beforeTest { descriptor ->
|
||||||
println(" TEST: " + descriptor.getName())
|
out.style(Style.Description).println(" TEST: " + descriptor.getName())
|
||||||
}
|
}
|
||||||
|
|
||||||
onOutput { descriptor, event ->
|
onOutput { descriptor, event ->
|
||||||
it.logger.lifecycle(" " + event.message.trim())
|
logger.lifecycle(" " + event.message.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
afterTest { descriptor, result ->
|
afterTest { descriptor, result ->
|
||||||
switch (result.getResultType()) {
|
switch (result.getResultType()) {
|
||||||
case ResultType.SUCCESS:
|
case ResultType.SUCCESS:
|
||||||
println(" SUCCESS")
|
out.style(Style.Success).println(" SUCCESS")
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.FAILURE:
|
case ResultType.FAILURE:
|
||||||
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
||||||
println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
out.style(Style.Failure).println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.SKIPPED:
|
case ResultType.SKIPPED:
|
||||||
println(" SKIPPED")
|
out.style(Style.Info).println(" SKIPPED")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
it.logger.lifecycle("")
|
logger.lifecycle("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ subprojects {
|
|||||||
if (it.startsWith('w: ') || it.startsWith('e: ')) {
|
if (it.startsWith('w: ') || it.startsWith('e: ')) {
|
||||||
def matches = (it =~ /([ew]): (.+):(\d+):(\d+) (.*)/)
|
def matches = (it =~ /([ew]): (.+):(\d+):(\d+) (.*)/)
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
task.logger.quiet "kotlinc message format has changed!"
|
logger.quiet "kotlinc message format has changed!"
|
||||||
if (it.startsWith('w: ')) {
|
if (it.startsWith('w: ')) {
|
||||||
// For warnings, don't continue because we don't want to throw an
|
// For warnings, don't continue because we don't want to throw an
|
||||||
// exception. For errors, we want the exception so that the new error
|
// exception. For errors, we want the exception so that the new error
|
||||||
@@ -137,7 +137,7 @@ subprojects {
|
|||||||
def (_, type, file, line, column, message) = matches[0]
|
def (_, type, file, line, column, message) = matches[0]
|
||||||
type = (type == 'w') ? 'warning' : 'error'
|
type = (type == 'w') ? 'warning' : 'error'
|
||||||
// Use logger.lifecycle, which does not go through stderr again.
|
// Use logger.lifecycle, which does not go through stderr again.
|
||||||
task.logger.lifecycle "$file:$line:$column: $type: $message"
|
logger.lifecycle "$file:$line:$column: $type: $message"
|
||||||
}
|
}
|
||||||
} as StandardOutputListener
|
} as StandardOutputListener
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,6 @@
|
|||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx7g -Xms2g -XX:MaxMetaspaceSize=6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
|
org.gradle.jvmargs=-Xmx7g -Xms2g -XX:MaxMetaspaceSize=6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
|
||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
|
||||||
|
|
||||||
# Bug 1946302: Currently task of type `com.google.android.gms.oss.licenses.plugin.LicensesTask` fails as
|
|
||||||
# notCompatibleWithConfigurationCache. Issue tracked in https://github.com/google/play-services-plugins/issues/246
|
|
||||||
# Solution provided here: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api/-task/not-compatible-with-configuration-cache.html
|
|
||||||
org.gradle.configuration-cache.problems=warn
|
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ apply from: versionCodeGradle
|
|||||||
|
|
||||||
import com.android.build.api.variant.FilterConfiguration
|
import com.android.build.api.variant.FilterConfiguration
|
||||||
import groovy.json.JsonOutput
|
import groovy.json.JsonOutput
|
||||||
|
import org.gradle.internal.logging.text.StyledTextOutput.Style
|
||||||
|
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
import static org.gradle.api.tasks.testing.TestResult.ResultType
|
import static org.gradle.api.tasks.testing.TestResult.ResultType
|
||||||
@@ -553,15 +555,15 @@ android.applicationVariants.configureEach { variant ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def generatedLocaleListDir = file('src/main/java/org/mozilla/focus/generated')
|
def generatedLocaleListDir = 'src/main/java/org/mozilla/focus/generated'
|
||||||
def generatedLocaleListFilename = 'LocalesList.kt'
|
def generatedLocaleListFilename = 'LocalesList.kt'
|
||||||
|
|
||||||
def enabledLocales = project.provider { getEnabledLocales() }
|
|
||||||
|
|
||||||
tasks.register('generateLocaleList') {
|
tasks.register('generateLocaleList') {
|
||||||
def localeList = file(new File(generatedLocaleListDir, generatedLocaleListFilename))
|
|
||||||
doLast {
|
doLast {
|
||||||
generatedLocaleListDir.mkdir()
|
def dir = file(generatedLocaleListDir)
|
||||||
|
dir.mkdir()
|
||||||
|
def localeList = file(new File(dir, generatedLocaleListFilename))
|
||||||
|
|
||||||
localeList.delete()
|
localeList.delete()
|
||||||
localeList.createNewFile()
|
localeList.createNewFile()
|
||||||
localeList << "package org.mozilla.focus.generated" << "\n" << "\n"
|
localeList << "package org.mozilla.focus.generated" << "\n" << "\n"
|
||||||
@@ -579,7 +581,7 @@ tasks.register('generateLocaleList') {
|
|||||||
localeList << " " << "listOf("
|
localeList << " " << "listOf("
|
||||||
localeList << "\n"
|
localeList << "\n"
|
||||||
localeList << " "
|
localeList << " "
|
||||||
localeList << enabledLocales.get().join(",\n" + " ")
|
localeList << getEnabledLocales().join(",\n" + " ")
|
||||||
localeList << ",\n"
|
localeList << ",\n"
|
||||||
localeList << " )," << "\n"
|
localeList << " )," << "\n"
|
||||||
localeList << " )" << "\n"
|
localeList << " )" << "\n"
|
||||||
@@ -594,7 +596,7 @@ tasks.configureEach { task ->
|
|||||||
}
|
}
|
||||||
|
|
||||||
clean.doLast {
|
clean.doLast {
|
||||||
generatedLocaleListDir.deleteDir()
|
file(generatedLocaleListDir).deleteDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (project.hasProperty("coverage")) {
|
if (project.hasProperty("coverage")) {
|
||||||
@@ -641,17 +643,17 @@ if (project.hasProperty("coverage")) {
|
|||||||
// Taskgraph Usage: "./gradlew printVariants
|
// Taskgraph Usage: "./gradlew printVariants
|
||||||
// -------------------------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------------------------
|
||||||
tasks.register('printVariants') {
|
tasks.register('printVariants') {
|
||||||
def variants = project.provider { android.applicationVariants.collect { variant -> [
|
doLast {
|
||||||
|
def variants = android.applicationVariants.collect { variant -> [
|
||||||
apks: variant.outputs.collect { output -> [
|
apks: variant.outputs.collect { output -> [
|
||||||
abi: output.getFilter(FilterConfiguration.FilterType.ABI.name()),
|
abi: output.getFilter(FilterConfiguration.FilterType.ABI.name()),
|
||||||
fileName: output.outputFile.name
|
fileName: output.outputFile.name
|
||||||
]},
|
]},
|
||||||
build_type: variant.buildType.name,
|
build_type: variant.buildType.name,
|
||||||
name: variant.name,
|
name: variant.name,
|
||||||
]}}
|
]}
|
||||||
doLast {
|
|
||||||
// AndroidTest is a special case not included above
|
// AndroidTest is a special case not included above
|
||||||
variants.get().add([
|
variants.add([
|
||||||
apks: [[
|
apks: [[
|
||||||
abi: 'noarch',
|
abi: 'noarch',
|
||||||
fileName: 'app-debug-androidTest.apk',
|
fileName: 'app-debug-androidTest.apk',
|
||||||
@@ -659,7 +661,7 @@ tasks.register('printVariants') {
|
|||||||
build_type: 'androidTest',
|
build_type: 'androidTest',
|
||||||
name: 'androidTest',
|
name: 'androidTest',
|
||||||
])
|
])
|
||||||
println 'variants: ' + JsonOutput.toJson(variants.get())
|
println 'variants: ' + JsonOutput.toJson(variants)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -672,36 +674,38 @@ afterEvaluate {
|
|||||||
|
|
||||||
testLogging.events = []
|
testLogging.events = []
|
||||||
|
|
||||||
|
def out = services.get(StyledTextOutputFactory).create("tests")
|
||||||
|
|
||||||
beforeSuite { descriptor ->
|
beforeSuite { descriptor ->
|
||||||
if (descriptor.getClassName() != null) {
|
if (descriptor.getClassName() != null) {
|
||||||
println("\nSUITE: " + descriptor.getClassName())
|
out.style(Style.Header).println("\nSUITE: " + descriptor.getClassName())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeTest { descriptor ->
|
beforeTest { descriptor ->
|
||||||
println(" TEST: " + descriptor.getName())
|
out.style(Style.Description).println(" TEST: " + descriptor.getName())
|
||||||
}
|
}
|
||||||
|
|
||||||
onOutput { descriptor, event ->
|
onOutput { descriptor, event ->
|
||||||
it.logger.lifecycle(" " + event.message.trim())
|
logger.lifecycle(" " + event.message.trim())
|
||||||
}
|
}
|
||||||
|
|
||||||
afterTest { descriptor, result ->
|
afterTest { descriptor, result ->
|
||||||
switch (result.getResultType()) {
|
switch (result.getResultType()) {
|
||||||
case ResultType.SUCCESS:
|
case ResultType.SUCCESS:
|
||||||
println(" SUCCESS")
|
out.style(Style.Success).println(" SUCCESS")
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.FAILURE:
|
case ResultType.FAILURE:
|
||||||
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
def testId = descriptor.getClassName() + "." + descriptor.getName()
|
||||||
println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
out.style(Style.Failure).println(" TEST-UNEXPECTED-FAIL | " + testId + " | " + result.getException())
|
||||||
break
|
break
|
||||||
|
|
||||||
case ResultType.SKIPPED:
|
case ResultType.SKIPPED:
|
||||||
println(" SKIPPED")
|
out.style(Style.Info).println(" SKIPPED")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
it.logger.lifecycle("")
|
logger.lifecycle("")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,6 @@ android.useAndroidX=true
|
|||||||
org.gradle.jvmargs=-Xmx7g -Xms2g -XX:MaxMetaspaceSize=6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
|
org.gradle.jvmargs=-Xmx7g -Xms2g -XX:MaxMetaspaceSize=6g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
|
||||||
org.gradle.configureondemand=true
|
org.gradle.configureondemand=true
|
||||||
|
|
||||||
org.gradle.configuration-cache=true
|
|
||||||
|
|
||||||
# Bug 1946302: Currently task of type `com.google.android.gms.oss.licenses.plugin.LicensesTask` fails as
|
|
||||||
# notCompatibleWithConfigurationCache. Issue tracked in https://github.com/google/play-services-plugins/issues/246
|
|
||||||
# Solution provided here: https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api/-task/not-compatible-with-configuration-cache.html
|
|
||||||
org.gradle.configuration-cache.problems=warn
|
|
||||||
|
|
||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
|||||||
@@ -184,8 +184,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def projectVersion = project.ext.gleanVersion
|
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
api {
|
api {
|
||||||
outgoing {
|
outgoing {
|
||||||
@@ -195,7 +193,7 @@ configurations {
|
|||||||
}
|
}
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
// Implicit capability
|
// Implicit capability
|
||||||
capability("org.mozilla.geckoview:${getArtifactId()}:${projectVersion}")
|
capability("org.mozilla.geckoview:${getArtifactId()}:${project.ext.versionNumber}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,7 +204,8 @@ configurations {
|
|||||||
runtimeOnly {
|
runtimeOnly {
|
||||||
outgoing {
|
outgoing {
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
capability("org.mozilla.geckoview:geckoview:${projectVersion}")
|
// Implicit capability
|
||||||
|
capability("org.mozilla.geckoview:geckoview:${project.ext.versionNumber}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,16 +250,6 @@ android.libraryVariants.all { variant ->
|
|||||||
// https://code.tutsplus.com/tutorials/creating-and-publishing-an-android-library--cms-24582,
|
// https://code.tutsplus.com/tutorials/creating-and-publishing-an-android-library--cms-24582,
|
||||||
// and amended from numerous Stackoverflow posts.
|
// and amended from numerous Stackoverflow posts.
|
||||||
def name = variant.name
|
def name = variant.name
|
||||||
def classpathFilesProvider = variant.javaCompileProvider.flatMap { compileTask ->
|
|
||||||
project.provider { compileTask.classpath.files }
|
|
||||||
}
|
|
||||||
|
|
||||||
def classpathFilesProviderFiles = project.provider {
|
|
||||||
files(classpathFilesProvider.get())
|
|
||||||
}
|
|
||||||
|
|
||||||
def androidLintProperty = project.provider { project.hasProperty('android-lint') }
|
|
||||||
|
|
||||||
def javadoc = task "javadoc${name.capitalize()}"(type: Javadoc) {
|
def javadoc = task "javadoc${name.capitalize()}"(type: Javadoc) {
|
||||||
failOnError = false
|
failOnError = false
|
||||||
description = "Generate Javadoc for build variant $name"
|
description = "Generate Javadoc for build variant $name"
|
||||||
@@ -270,13 +259,12 @@ android.libraryVariants.all { variant ->
|
|||||||
// this is a problem for the javadoc lint, which needs to read the output of the task
|
// this is a problem for the javadoc lint, which needs to read the output of the task
|
||||||
// to determine if there are warnings or errors. To force that we pass a -Pandroid-lint
|
// to determine if there are warnings or errors. To force that we pass a -Pandroid-lint
|
||||||
// parameter to all lints that can be used here to force running the task every time.
|
// parameter to all lints that can be used here to force running the task every time.
|
||||||
|
|
||||||
outputs.upToDateWhen {
|
outputs.upToDateWhen {
|
||||||
!androidLintProperty.get()
|
!project.hasProperty('android-lint')
|
||||||
}
|
}
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
classpath = classpathFilesProviderFiles.get()
|
classpath = files(variant.javaCompileProvider.get().classpath.files)
|
||||||
}
|
}
|
||||||
|
|
||||||
def results = []
|
def results = []
|
||||||
@@ -300,9 +288,6 @@ android.libraryVariants.all { variant ->
|
|||||||
logging.addStandardErrorListener(listener)
|
logging.addStandardErrorListener(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
def reportsDir = file("$buildDir/reports")
|
|
||||||
def reportsJsonFile = file("$buildDir/reports/javadoc-results-${name}.json")
|
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
logging.removeStandardErrorListener(listener)
|
logging.removeStandardErrorListener(listener)
|
||||||
|
|
||||||
@@ -310,8 +295,8 @@ android.libraryVariants.all { variant ->
|
|||||||
// `android-javadoc` linter to fail in the face of Javadoc warnings.
|
// `android-javadoc` linter to fail in the face of Javadoc warnings.
|
||||||
def resultsJson = JsonOutput.toJson(results)
|
def resultsJson = JsonOutput.toJson(results)
|
||||||
|
|
||||||
reportsDir.mkdirs()
|
file("$buildDir/reports").mkdirs()
|
||||||
reportsJsonFile.write(resultsJson)
|
file("$buildDir/reports/javadoc-results-${name}.json").write(resultsJson)
|
||||||
}
|
}
|
||||||
|
|
||||||
source = variant.sourceSets.collect({ it.java.srcDirs })
|
source = variant.sourceSets.collect({ it.java.srcDirs })
|
||||||
@@ -488,13 +473,6 @@ afterEvaluate {
|
|||||||
apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
|
apply from: "${topsrcdir}/mobile/android/gradle/debug_level.gradle"
|
||||||
android.libraryVariants.all configureVariantDebugLevel
|
android.libraryVariants.all configureVariantDebugLevel
|
||||||
|
|
||||||
def androidBootClasspath = provider {
|
|
||||||
android.bootClasspath.findAll { it.name.startsWith('android.jar') }
|
|
||||||
}
|
|
||||||
|
|
||||||
def bindingsDir = "${topobjdir}/widget/android/bindings"
|
|
||||||
|
|
||||||
def generateSdkBindingsArgsProvider = project.provider { project.hasProperty('generate_sdk_bindings_args') ? project.generate_sdk_bindings_args : false }
|
|
||||||
// There's nothing specific to the :geckoview project here -- this just needs to
|
// There's nothing specific to the :geckoview project here -- this just needs to
|
||||||
// be somewhere where the Android plugin is available so that we can fish the
|
// be somewhere where the Android plugin is available so that we can fish the
|
||||||
// path to "android.jar".
|
// path to "android.jar".
|
||||||
@@ -516,14 +494,14 @@ task("generateSDKBindings", type: JavaExec) {
|
|||||||
doFirst {
|
doFirst {
|
||||||
// We only want to generate bindings for the main framework JAR,
|
// We only want to generate bindings for the main framework JAR,
|
||||||
// but not any of the additional android.test libraries.
|
// but not any of the additional android.test libraries.
|
||||||
args androidBootClasspath.get()
|
args android.bootClasspath.findAll { it.getName().startsWith('android.jar') }
|
||||||
args 29
|
args 29
|
||||||
args bindingsDir
|
args "${topobjdir}/widget/android/bindings"
|
||||||
|
|
||||||
// From -Pgenerate_sdk_bindings_args=... on command line; missing in
|
// From -Pgenerate_sdk_bindings_args=... on command line; missing in
|
||||||
// `android-gradle-dependencies` toolchain task.
|
// `android-gradle-dependencies` toolchain task.
|
||||||
if (generateSdkBindingsArgsProvider.get()) {
|
if (project.hasProperty('generate_sdk_bindings_args')) {
|
||||||
args generateSdkBindingsArgsProvider.get().split(';')
|
args project.generate_sdk_bindings_args.split(';')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,12 +252,10 @@ set_config("GRADLE_ANDROID_LINT_TASKS", gradle_android_lint_tasks)
|
|||||||
@depends(gradle_android_build_config)
|
@depends(gradle_android_build_config)
|
||||||
def gradle_android_api_lint_tasks(build_config):
|
def gradle_android_api_lint_tasks(build_config):
|
||||||
"""Gradle tasks run by |mach android api-lint|."""
|
"""Gradle tasks run by |mach android api-lint|."""
|
||||||
# --no-configuration-cache will be removed in bug 1950099
|
|
||||||
return [
|
return [
|
||||||
"geckoview:apiLint{geckoview.variant.name}".format(
|
"geckoview:apiLint{geckoview.variant.name}".format(
|
||||||
geckoview=build_config.geckoview
|
geckoview=build_config.geckoview
|
||||||
),
|
),
|
||||||
"--no-configuration-cache",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export PATH=$MOZ_FETCHES_DIR/jdk-8/bin:$PATH
|
|||||||
|
|
||||||
export MOZCONFIG=mobile/android/config/mozconfigs/android-arm-gradle-dependencies/nightly-lite
|
export MOZCONFIG=mobile/android/config/mozconfigs/android-arm-gradle-dependencies/nightly-lite
|
||||||
./mach build
|
./mach build
|
||||||
./mach gradle downloadDependencies --no-configuration-cache
|
./mach gradle downloadDependencies
|
||||||
./mach android gradle-dependencies --no-configuration-cache
|
./mach android gradle-dependencies
|
||||||
|
|
||||||
. taskcluster/scripts/misc/android-gradle-dependencies/after.sh
|
. taskcluster/scripts/misc/android-gradle-dependencies/after.sh
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ export PATH=$MOZ_FETCHES_DIR/jdk-8/bin:$PATH
|
|||||||
|
|
||||||
export MOZCONFIG=mobile/android/config/mozconfigs/android-arm-gradle-dependencies/nightly
|
export MOZCONFIG=mobile/android/config/mozconfigs/android-arm-gradle-dependencies/nightly
|
||||||
./mach build
|
./mach build
|
||||||
./mach gradle downloadDependencies --no-configuration-cache
|
./mach gradle downloadDependencies
|
||||||
./mach android gradle-dependencies --no-configuration-cache
|
./mach android gradle-dependencies
|
||||||
pushd mobile/android/fenix
|
pushd mobile/android/fenix
|
||||||
./gradlew detekt lint assembleDebug mozilla-lint-rules:test :benchmark:assembleBenchmark
|
./gradlew detekt lint assembleDebug mozilla-lint-rules:test :benchmark:assembleBenchmark
|
||||||
popd
|
popd
|
||||||
|
|||||||
Reference in New Issue
Block a user