mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-13 07:10:28 +00:00
e46a3545ae
Revert "Bug 1863744 - Update Gradle to version 8.4" This reverts commit 829795632954148709fbe945c78d55cc62053ac8. Revert "Bug 1821005 - Apply additional keep rules for missing classes detected while running R8." This reverts commit 8f3f246cc5ff571323f56d46963d8d176bec91e3. Revert "Bug 1821005 - Set UI_INJECTION_HOST mode for lint in test." This reverts commit 6962bf0b5df57781045f68417f76527bcdf521ab. Revert "Bug 1821005 - Include sourcesJar as an input of publishing." This reverts commit 41b2a48da577787c3189eec8c8af71c35cfecbfb. Revert "Bug 1821005 - Set compileOptions for android subprojects." This reverts commit fb21df9d0a9cd585e216733dc1bf929636df20f1. Revert "Bug 1821005 - Replace deprecated project.buildDir" This reverts commit 6f880de46ec73f7e5240a0279108bbb6aeb0f63b. Revert "Bug 1821005 - Exclude generated metrics docs from detekt." This reverts commit f17d2430bf1daabeed2724312354018050f3f52a. Revert "Bug 1821005 - Exclude build in extensions versioning from detekt." This reverts commit 34144c5ad1d62e2d85492f8d32341bbcd032690b. Revert "Bug 1821005 - Add uses-feature tag for camera permission." This reverts commit 13c80944bd1756cdcaa98eef783b6a23ad12cabd. Revert "Bug 1821005 - Set nonTransitiveRClass and nonFinalResIds build flags to false." This reverts commit 219fbc19c54134ad264edc79642fa1799c6f54d6. Revert "Bug 1821005 - Apply plugin: 'kotlin-android' for UI modules." This reverts commit ddbd5e18eb9d2b33b4de4a6df48d97ec4ab42963. Revert "Bug 1821005 - Enable generation of the BuildConfig class" This reverts commit 65c2b8c63790fbd2352f3f94b99c80d81d18dae1. Revert "Bug 1821005 - Add namespace to samples-glean-library module" This reverts commit 0239233efb1cc4e896e4aa0337e3da911eeb2f1c. Revert "Bug 1821005 - Replace deprecated toLowerCase with lowercase." This reverts commit 69f2c66aad3aa638a1bab31b2a1e6c597d1f3992. Revert "Bug 1821005 - Replace deprecated 'toInt' method with 'code' property." This reverts commit 7adb38a6fbe20de3fdb6723a10e574d183e7fcff. Revert "Bug 1821005 - Replace deprecated execResult." This reverts commit bfd02dd16d7e5c9dbcf34858fbbe4176d698f8cd. Revert "Bug 1849833 - Replace deprecated extractNativeLibs manifest attribute." This reverts commit a05bc9618457ab2d71a5d3d88d8d3b0318497a54. Revert "Bug 1821005 - Upgrade AGP to 8.0.2" This reverts commit fc0fadd63553e2144ce074454d502ecf307eb988. Revert "Bug 1821005 - Upgrade kotlin-dsl to 4.1.0." This reverts commit 14e8903e922fa22e28450520be3b6152be6a3a8f. Revert "Bug 1821005 - Upgrade Gradle to 8.3 version." This reverts commit f14f447a4d43588d24e4ca3efde0668ddcf7cf08.
273 lines
8.7 KiB
Groovy
273 lines
8.7 KiB
Groovy
import io.gitlab.arturbosch.detekt.Detekt
|
|
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
buildscript {
|
|
// This logic is duplicated in the allprojects block: I don't know how to fix that.
|
|
repositories {
|
|
maven {
|
|
name "Mozilla Nightly"
|
|
url "https://nightly.maven.mozilla.org/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
|
|
maven {
|
|
name "Mozilla"
|
|
url "https://maven.mozilla.org/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
|
|
if (ExtraRepositories.mozillaStaging) {
|
|
maven {
|
|
name "Mozilla Staging"
|
|
url "https://maven-default.stage.mozaws.net/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("googleRepo")) {
|
|
maven {
|
|
name "Google"
|
|
allowInsecureProtocol true // Local Nexus in CI uses HTTP
|
|
url project.property("googleRepo")
|
|
}
|
|
} else {
|
|
google() {
|
|
content {
|
|
// Improve performance: only check google maven for google deps.
|
|
includeGroupByRegex RepoMatching.androidx
|
|
includeGroupByRegex RepoMatching.comAndroid
|
|
includeGroupByRegex RepoMatching.comGoogle
|
|
}
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("centralRepo")) {
|
|
maven {
|
|
name "MavenCentral"
|
|
url project.property("centralRepo")
|
|
allowInsecureProtocol true // Local Nexus in CI uses HTTP
|
|
}
|
|
} else {
|
|
mavenCentral() {
|
|
content {
|
|
// Improve security: don't search deps with known repos.
|
|
excludeGroupByRegex RepoMatching.mozilla
|
|
excludeGroupByRegex RepoMatching.androidx
|
|
excludeGroupByRegex RepoMatching.comAndroid
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
classpath ComponentsDependencies.tools_androidgradle
|
|
classpath ComponentsDependencies.tools_kotlingradle
|
|
classpath FenixDependencies.tools_benchmarkgradle
|
|
classpath FenixDependencies.androidx_safeargs
|
|
classpath FenixDependencies.osslicenses_plugin
|
|
classpath "org.mozilla.telemetry:glean-gradle-plugin:${Versions.mozilla_glean}"
|
|
classpath "${ApplicationServicesConfig.groupId}:tooling-nimbus-gradle:${ApplicationServicesConfig.version}"
|
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
// in the individual module build.gradle files
|
|
}
|
|
|
|
// Variables in plugins {} aren't directly supported. Hack around it by setting an
|
|
// intermediate variable which can pull from FenixDependenciesPlugin.kt and be used later.
|
|
ext {
|
|
detekt_plugin = Versions.detekt
|
|
ksp_plugin = Versions.ksp_plugin
|
|
protobuf_plugin = FenixVersions.protobuf_plugin
|
|
python_envs_plugin = Versions.python_envs_plugin
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id("io.gitlab.arturbosch.detekt").version("$detekt_plugin")
|
|
id("com.google.devtools.ksp").version("$ksp_plugin")
|
|
}
|
|
|
|
allprojects {
|
|
// This logic is duplicated in the buildscript block: I don't know how to fix that.
|
|
repositories {
|
|
maven {
|
|
name "Mozilla Nightly"
|
|
url "https://nightly.maven.mozilla.org/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
|
|
maven {
|
|
name "Mozilla"
|
|
url "https://maven.mozilla.org/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
|
|
if (ExtraRepositories.mozillaStaging) {
|
|
maven {
|
|
name "Mozilla Staging"
|
|
url "https://maven-default.stage.mozaws.net/maven2"
|
|
content {
|
|
// Improve performance: only check moz maven for mozilla deps.
|
|
includeGroupByRegex RepoMatching.mozilla
|
|
}
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("googleRepo")) {
|
|
maven {
|
|
name "Google"
|
|
url project.property("googleRepo")
|
|
allowInsecureProtocol true // Local Nexus in CI uses HTTP
|
|
}
|
|
} else {
|
|
google() {
|
|
content {
|
|
// Improve performance: only check google maven for google deps.
|
|
includeGroupByRegex RepoMatching.androidx
|
|
includeGroupByRegex RepoMatching.comAndroid
|
|
includeGroupByRegex RepoMatching.comGoogle
|
|
}
|
|
}
|
|
}
|
|
|
|
if (project.hasProperty("centralRepo")) {
|
|
maven {
|
|
name "MavenCentral"
|
|
url project.property("centralRepo")
|
|
allowInsecureProtocol true // Local Nexus in CI uses HTTP
|
|
}
|
|
} else {
|
|
mavenCentral() {
|
|
content {
|
|
// Improve security: don't search deps with known repos.
|
|
excludeGroupByRegex RepoMatching.mozilla
|
|
excludeGroupByRegex RepoMatching.androidx
|
|
excludeGroupByRegex RepoMatching.comAndroid
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(KotlinCompile).configureEach {
|
|
kotlinOptions.jvmTarget = "17"
|
|
kotlinOptions.allWarningsAsErrors = true
|
|
kotlinOptions.freeCompilerArgs += [
|
|
"-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all-compatibility"
|
|
]
|
|
}
|
|
}
|
|
|
|
tasks.register('clean', Delete) {
|
|
delete rootProject.buildDir
|
|
}
|
|
|
|
detekt {
|
|
input = files("$projectDir/app/src")
|
|
config = files("$projectDir/config/detekt.yml")
|
|
|
|
reports {
|
|
html {
|
|
enabled = true
|
|
destination = file("$projectDir/build/reports/detekt.html")
|
|
}
|
|
xml {
|
|
enabled = false
|
|
}
|
|
txt {
|
|
enabled = false
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(Detekt).configureEach() {
|
|
autoCorrect = true
|
|
|
|
exclude "**/test/**"
|
|
exclude "**/androidTest/**"
|
|
exclude "**/build/**"
|
|
exclude "**/resources/**"
|
|
exclude "**/tmp/**"
|
|
}
|
|
|
|
// Apply same path exclusions as for the main task
|
|
tasks.withType(DetektCreateBaselineTask).configureEach() {
|
|
exclude "**/test/**"
|
|
exclude "**/androidTest/**"
|
|
exclude "**/build/**"
|
|
exclude "**/resources/**"
|
|
exclude "**/tmp/**"
|
|
}
|
|
|
|
configurations {
|
|
ktlint
|
|
}
|
|
|
|
dependencies {
|
|
ktlint("com.pinterest:ktlint:${Versions.ktlint}") {
|
|
attributes {
|
|
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
|
|
}
|
|
}
|
|
|
|
detekt project(":mozilla-detekt-rules")
|
|
detekt "io.gitlab.arturbosch.detekt:detekt-cli:${Versions.detekt}"
|
|
}
|
|
|
|
tasks.register('ktlint', JavaExec) {
|
|
group = "verification"
|
|
description = "Check Kotlin code style."
|
|
classpath = configurations.ktlint
|
|
mainClass.set("com.pinterest.ktlint.Main")
|
|
args "app/src/**/*.kt", "!**/build/**/*.kt", "--baseline=ktlint-baseline.xml"
|
|
}
|
|
|
|
tasks.register('ktlintFormat', JavaExec) {
|
|
description = "Fix Kotlin code style deviations."
|
|
classpath = configurations.ktlint
|
|
mainClass.set("com.pinterest.ktlint.Main")
|
|
args "-F", "app/src/**/*.kt", "!**/build/**/*.kt", "--baseline=ktlint-baseline.xml"
|
|
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
|
|
}
|
|
|
|
tasks.withType(Detekt.class).configureEach {
|
|
exclude("**/resources/**")
|
|
exclude("**/tmp/**")
|
|
}
|
|
|
|
tasks.register("listRepositories") {
|
|
doLast {
|
|
println "Repositories:"
|
|
project.repositories.each { println "Name: " + it.name + "; url: " + it.url }
|
|
}
|
|
}
|
|
|
|
tasks.register("githubTestDetails", GithubDetailsTask) {
|
|
text = "### [Unit Test Results Fenix]({reportsUrl}/test/testFenixDebugUnitTest/index.html)"
|
|
}
|
|
|
|
tasks.register("githubLintDetektDetails", GithubDetailsTask) {
|
|
text = "### [Detekt Results Fenix]({reportsUrl}/detekt.html)"
|
|
}
|
|
|
|
tasks.register("githubLintAndroidDetails", GithubDetailsTask) {
|
|
text = "### [Android Lint Results Fenix]({reportsUrl}/lint-results-debug.html)"
|
|
}
|