diff --git a/app/build.gradle b/app/build.gradle index db786e75e..2f462c194 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -165,6 +165,7 @@ android { buildFeatures { viewBinding true + buildConfig true } androidResources { @@ -240,6 +241,9 @@ android { excludes += ['META-INF/atomicfu.kotlin_module', 'META-INF/AL2.0', 'META-INF/LGPL2.1', 'META-INF/LICENSE.md', 'META-INF/LICENSE-notice.md'] } + jniLibs { + useLegacyPackaging true + } } @@ -755,14 +759,14 @@ if (project.hasProperty("coverage")) { def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*$[0-9].*'] - def kotlinDebugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/${variant.name}", excludes: fileFilter) - def javaDebugTree = fileTree(dir: "$project.buildDir/intermediates/classes/${variant.flavorName}/${variant.buildType.name}", + def kotlinDebugTree = fileTree(dir: "$project.layout.buildDirectory/tmp/kotlin-classes/${variant.name}", excludes: fileFilter) + def javaDebugTree = fileTree(dir: "$project.layout.buildDirectory/intermediates/classes/${variant.flavorName}/${variant.buildType.name}", excludes: fileFilter) def mainSrc = "$project.projectDir/src/main/java" sourceDirectories.setFrom(files([mainSrc])) classDirectories.setFrom(files([kotlinDebugTree, javaDebugTree])) - executionData.setFrom(fileTree(dir: project.buildDir, includes: [ + executionData.setFrom(fileTree(dir: project.layout.buildDirectory, includes: [ "jacoco/test${variant.name.capitalize()}UnitTest.exec", 'outputs/code-coverage/connected/*coverage.ec' ])) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index e269f6577..982ef996d 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -124,3 +124,9 @@ # Keep Android Lifecycle methods # https://bugzilla.mozilla.org/show_bug.cgi?id=1596302 -keep class androidx.lifecycle.** { *; } + +-dontwarn java.beans.BeanInfo +-dontwarn java.beans.FeatureDescriptor +-dontwarn java.beans.IntrospectionException +-dontwarn java.beans.Introspector +-dontwarn java.beans.PropertyDescriptor diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a8e85a935..f5a6da407 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,6 +17,16 @@ + + + + + @@ -43,7 +53,6 @@ /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then done fi -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/mozilla-lint-rules/src/test/java/org/mozilla/fenix/lintrules/LicenseDetectorTest.kt b/mozilla-lint-rules/src/test/java/org/mozilla/fenix/lintrules/LicenseDetectorTest.kt index c64b8ce03..c05cda163 100644 --- a/mozilla-lint-rules/src/test/java/org/mozilla/fenix/lintrules/LicenseDetectorTest.kt +++ b/mozilla-lint-rules/src/test/java/org/mozilla/fenix/lintrules/LicenseDetectorTest.kt @@ -53,6 +53,7 @@ class LicenseDetectorTest : LintDetectorTest() { lint() .files(TestFiles.kt(code)) .allowMissingSdk(true) + .testModes(TestMode.UI_INJECTION_HOST) .run() .expect(expectedReport) .expectFixDiffs(expectedFixOutput) diff --git a/plugins/apksize/build.gradle b/plugins/apksize/build.gradle index ebc7ab538..77b077a8b 100644 --- a/plugins/apksize/build.gradle +++ b/plugins/apksize/build.gradle @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ plugins { - id "org.gradle.kotlin.kotlin-dsl" version "2.4.1" + id "org.gradle.kotlin.kotlin-dsl" version "4.1.2" } repositories { diff --git a/plugins/apksize/src/main/java/ApkSizePlugin.kt b/plugins/apksize/src/main/java/ApkSizePlugin.kt index e44526741..6a70a4da8 100644 --- a/plugins/apksize/src/main/java/ApkSizePlugin.kt +++ b/plugins/apksize/src/main/java/ApkSizePlugin.kt @@ -48,7 +48,7 @@ open class ApkSizeTask : DefaultTask() { } private fun determineApkSizes(): Map { - val variantOutputPath = variantName?.removePrefix("fenix")?.toLowerCase() + val variantOutputPath = variantName?.removePrefix("fenix")?.lowercase() val basePath = listOf( "${project.projectDir}", "build", "outputs", "apk", "fenix", variantOutputPath ).joinToString(File.separator) diff --git a/plugins/fenixdependencies/build.gradle b/plugins/fenixdependencies/build.gradle index 32cea475d..7e8043a2a 100644 --- a/plugins/fenixdependencies/build.gradle +++ b/plugins/fenixdependencies/build.gradle @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ plugins { - id "org.gradle.kotlin.kotlin-dsl" version "2.4.1" + id "org.gradle.kotlin.kotlin-dsl" version "4.1.2" } repositories {