2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-15 18:12:54 +00:00
iceraven-browser/build.gradle

286 lines
9.1 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"
]
}
}
subprojects {
afterEvaluate {
if (it.hasProperty('android')) {
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
}
}
}
2020-08-04 17:56:28 +00:00
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}
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)"
}