Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gaba
fenix
Commits
d762dea4
Commit
d762dea4
authored
Aug 04, 2020
by
Tiger Oakes
Committed by
Michael Comella
Sep 01, 2020
Browse files
Gradle configuration avoidance
parent
0413d3c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
d762dea4
...
...
@@ -11,6 +11,7 @@ apply plugin: 'com.google.android.gms.oss-licenses-plugin'
import
com.android.build.OutputFile
import
groovy.json.JsonOutput
import
org.gradle.internal.logging.text.StyledTextOutput.Style
import
org.gradle.internal.logging.text.StyledTextOutputFactory
import
org.mozilla.fenix.gradle.tasks.LintUnitTestRunner
...
...
@@ -493,7 +494,7 @@ dependencies {
}
if
(
project
.
hasProperty
(
"coverage"
))
{
tasks
.
withType
(
Test
)
{
tasks
.
withType
(
Test
)
.
configureEach
{
jacoco
.
includeNoLocationClasses
=
true
}
...
...
@@ -535,7 +536,7 @@ if (project.hasProperty("coverage")) {
// Task for printing APK information for the requested variant
// Usage: "./gradlew printVariants
// -------------------------------------------------------------------------------------------------
task
printVariants
{
task
s
.
register
(
'
printVariants
'
)
{
doLast
{
def
variants
=
android
.
applicationVariants
.
collect
{[
apks:
it
.
variantData
.
outputScope
.
apkDatas
.
collect
{[
...
...
@@ -554,11 +555,13 @@ task printVariants {
build_type:
'androidTest'
,
name:
'androidTest'
,
])
println
'variants: '
+
groovy
.
json
.
JsonOutput
.
toJson
(
variants
)
println
'variants: '
+
JsonOutput
.
toJson
(
variants
)
}
}
task
buildTranslationArray
{
// This isn't running as a task, instead the array is build when the gradle file is parsed.
// https://github.com/mozilla-mobile/fenix/issues/14175
def
foundLocales
=
new
StringBuilder
()
foundLocales
.
append
(
"new String[]{"
)
...
...
@@ -575,12 +578,12 @@ task buildTranslationArray {
android
.
defaultConfig
.
buildConfigField
"String[]"
,
"SUPPORTED_LOCALE_ARRAY"
,
foundLocalesString
}
task
lintUnitTestRunner
(
type:
LintUnitTestRunner
)
task
s
.
register
(
'
lintUnitTestRunner
'
,
LintUnitTestRunner
)
afterEvaluate
{
// Format test output. Ported from AC #2401
tasks
.
matching
{
it
instanceof
Test
}.
all
{
tasks
.
withType
(
Test
).
configureEach
{
systemProperty
"robolectric.logging"
,
"stdout"
systemProperty
"logging.test-mode"
,
"true"
...
...
@@ -668,5 +671,5 @@ tasks.register("updateCookiesExtensionVersion", Copy) { task ->
updateExtensionVersion
(
task
,
'src/main/assets/extensions/cookies'
)
}
preBuild
.
dependsOn
updateAdsExtensionVersion
preBuild
.
dependsOn
updateCookiesExtensionVersion
preBuild
.
dependsOn
"
updateAdsExtensionVersion
"
preBuild
.
dependsOn
"
updateCookiesExtensionVersion
"
build.gradle
View file @
d762dea4
...
...
@@ -129,7 +129,7 @@ allprojects {
}
}
tasks
.
withType
(
org
.
jetbrains
.
kotlin
.
gradle
.
tasks
.
KotlinCompile
).
all
{
tasks
.
withType
(
org
.
jetbrains
.
kotlin
.
gradle
.
tasks
.
KotlinCompile
).
configureEach
{
kotlinOptions
.
jvmTarget
=
"1.8"
kotlinOptions
.
allWarningsAsErrors
=
true
kotlinOptions
.
freeCompilerArgs
+=
[
...
...
@@ -138,7 +138,7 @@ allprojects {
}
}
task
clean
(
type:
Delete
)
{
task
s
.
register
(
'clean'
,
Delete
)
{
delete
rootProject
.
buildDir
}
...
...
@@ -169,14 +169,15 @@ dependencies {
detekt
"io.gitlab.arturbosch.detekt:detekt-cli:${Versions.detekt}"
}
task
ktlint
(
type:
JavaExec
,
group:
"verification"
)
{
tasks
.
register
(
'ktlint'
,
JavaExec
)
{
group
=
"verification"
description
=
"Check Kotlin code style."
classpath
=
configurations
.
ktlint
main
=
"com.pinterest.ktlint.Main"
args
"app/src/**/*.kt"
}
tasks
.
withType
(
io
.
gitlab
.
arturbosch
.
detekt
.
Detekt
.
class
)
{
tasks
.
withType
(
io
.
gitlab
.
arturbosch
.
detekt
.
Detekt
.
class
)
.
configureEach
{
exclude
(
"**/resources/**"
)
exclude
(
"**/test/**"
)
exclude
(
"**/tmp/**"
)
...
...
@@ -186,7 +187,7 @@ tasks.register("listRepositories") {
doLast
{
println
"Repositories:"
project
.
repositories
.
each
{
println
"Name: "
+
it
.
name
+
"; url: "
+
it
.
url
}
}
}
}
tasks
.
register
(
"githubTestDetails"
,
GithubDetailsTask
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment