2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-13 07:10:28 +00:00
iceraven-browser/build.gradle

273 lines
8.7 KiB
Groovy
Raw Normal View History

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 {
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
// This logic is duplicated in the allprojects block: I don't know how to fix that.
repositories {
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
maven {
name "Mozilla Nightly"
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
url "https://nightly.maven.mozilla.org/maven2"
content {
// Improve performance: only check moz maven for mozilla deps.
includeGroupByRegex RepoMatching.mozilla
}
}
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
maven {
name "Mozilla"
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
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
}
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
}
}
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
}
}
}
}
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
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}"
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
// 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 {
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
// 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"
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
content {
// Improve performance: only check moz maven for mozilla deps.
includeGroupByRegex RepoMatching.mozilla
}
}
maven {
name "Mozilla"
url "https://maven.mozilla.org/maven2"
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
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
}
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
}
}
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
}
}
}
}
[fenix] For https://github.com/mozilla-mobile/fenix/issues/9644: restrict deps to specific repositories (https://github.com/mozilla-mobile/fenix/pull/9649) * For https://github.com/mozilla-mobile/fenix/issues/9644: remove unnecessary leanplum maven repository. The docs say it is [1] "only needed for Android SDK versions below 4.3.0". That is API 18 and our min SDK is 21. [1]: https://docs.leanplum.com/reference#android-setup * For https://github.com/mozilla-mobile/fenix/issues/9644: move buildscript block from :app to root project. This will reduce the amount of duplication we need in specifying restricted dependencies and centralize repository definitions. Since we're a one project app, it shouldn't have a significant impact on performance. * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict dependencies following FFTV config. However, there is a resolution error to be fixed in the next commit. This is verbatim from FFTV except I removed the no-op "improve security if code is refactored incorrectly" lines: these lines rarely changed and I'm not that concerned. It might be better to simplify the configuration. Source: https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/buildSrc/src/main/java/org/mozilla/gradle/Dependencies.kt#L7 https://github.com/mozilla-mobile/firefox-tv/blob/62a2fa680c49beae271b55981d7afecc67d2aa21/build.gradle#L31 * For https://github.com/mozilla-mobile/fenix/issues/9644: restrict firebase deps to google repo. This fixes the resolution error from the previous PR.
2020-04-15 17:54:36 +00:00
tasks.withType(KotlinCompile).configureEach {
2023-05-22 12:18:26 +00:00
kotlinOptions.jvmTarget = "17"
kotlinOptions.allWarningsAsErrors = true
kotlinOptions.freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn", "-Xjvm-default=all-compatibility"
]
}
}
2020-08-04 17:56:28 +00:00
tasks.register('clean', Delete) {
Bug 1821005 - Revert Gradle 8 upgrade due to startup crashes 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.
2023-11-08 18:32:11 +00:00
delete rootProject.buildDir
}
detekt {
[fenix] For https://github.com/mozilla-mobile/fenix/issues/5574 - Migrate SessionControl to LibState (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 1: Port TabAction.SaveTabGroup to TabSessionInteractor and SessionControlController. (https://github.com/mozilla-mobile/fenix/pull/6651) - Introduces the TabSessionInteractor, SessionControlInteractor and SessionControlController classes. - Removes the TabAction.SaveTabGroup. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 2: Port TabAction.PrivateBrowsingLearnMore to TabSessionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 3: Port TabAction.ShareTabs to TabSessionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 4: Remove unused TabAction.Share and TabItemMenu (https://github.com/mozilla-mobile/fenix/pull/6651) In https://github.com/mozilla-mobile/fenix/issues/2205, the tab overflow button was removed which would have shown the TabItemMenu when clicked. So, we can remove TabItemMenu since it is not used and as a result, we can also remove TabAction.Share since there are no consumers. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 5: Port TabAction.PlayMedia and TabAction.PauseMedia to TabSessionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 6: Port TabAction.Select to TabSessionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 7: Port Onboarding.Finish to OnboardingInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 8: Port TabAction.Close and TabAction.CloseAll to TabSessionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) - Removes TabAction * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 9: Port CollectionAction.Delete to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 10: Port CollectionAction.ShareTabs to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 11: Port CollectionAction.AddTab and CollectionAction.Rename to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 12: Port CollectionAction.RemoveTab to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 13: Port CollectionAction.OpenTab to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 14: Port CollectionAction.CloseTabs to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 15: Introduce a HomeFragmentStore (https://github.com/mozilla-mobile/fenix/pull/6651) - We will hook up the HomeFragmentStore in later parts. - Removes List<Tab>.toSessionBundle(context: Context) since it is unused. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 16: Port CollectionAction.Collapse and CollectionAction.Expand to CollectionInteractor and SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) - We assume the store is hooked up to the SessionControlController in this part, but this work will be done in a later part. - Removes CollectionAction. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 20: Remove the architecture module. (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 17: Remove duplicate subscribeToTabCollections in BrowserFragment.kt (https://github.com/mozilla-mobile/fenix/pull/6651) There is a duplicate call of subscribeToTabCollections() in both HomeFragment and BrowserFragment. In this patch, we remove the call in BrowserFragment to avoid passing the HomeFragmentStore to BrowserFragment in order to dispatch the CollectionsChange event. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 18: Delete SessionControlComponent and fix TabCollection and Tab imports (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 19: Use the new HomeFragmentStore in the HomeFragment (https://github.com/mozilla-mobile/fenix/pull/6651) - Renames SessionControlUIView to SessionControlView * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 21: Fix white screen on home fragment (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 22: Fix formatting in SessionControlInteractor and replace See with @see in SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 23: Move to metrics.track call to the beginning of handleCollectionRemoveTab (https://github.com/mozilla-mobile/fenix/pull/6651) This ensures that the metrics.track will be called immediately before the tab is removed from the collection. * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 24: Use the sessionManager getter in SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 25: Use mapNotNull in List<Tab>.toSessionBundle (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 26: Simplify closeTab and closeAllTabs functions by assigning a deletionJob constant (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 27: Replace listOf() with emptyList() in removeAllTabsWithUndo (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 28: Replace the Context parameter with the HomeActivity in SessionControlController (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Part 29: Add test for HomeFragmentStore, DefaultSessionControlController and SessionControlInteractor (https://github.com/mozilla-mobile/fenix/pull/6651) * For https://github.com/mozilla-mobile/fenix/issues/5574 - Removes running CI against the architecture debug build varient
2019-12-05 03:06:05 +00:00
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}") {
2021-07-29 15:37:31 +00:00
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
}
detekt project(":mozilla-detekt-rules")
detekt "io.gitlab.arturbosch.detekt:detekt-cli:${Versions.detekt}"
}
2020-08-04 17:56:28 +00:00
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) {
2021-07-29 15:38:00 +00:00
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")
2021-07-29 15:38:00 +00:00
}
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 }
2020-08-04 17:56:28 +00:00
}
}
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)"
}