Skip to content

Commit cd39d9e

Browse files
committed
Fix Gradle warnings
1 parent f65292e commit cd39d9e

File tree

34 files changed

+133
-143
lines changed

34 files changed

+133
-143
lines changed

build.gradle

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17+
import com.android.build.gradle.tasks.JavaDocGenerationTask
18+
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
19+
import org.jetbrains.dokka.gradle.DokkaTaskPartial
20+
import org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask
21+
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin
22+
1723
def latestSdkVersion = 34
1824

1925
buildscript {
@@ -44,14 +50,14 @@ allprojects {
4450
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
4551
}
4652

47-
tasks.withType(Javadoc).all {
53+
tasks.withType(Javadoc).configureEach {
4854
options.addStringOption('Xdoclint:none', '-quiet')
4955
}
5056
// Disabled until there's a workaround/fix for https://github.com/Kotlin/dokka/issues/2472
51-
tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).all {
57+
tasks.withType(JavaDocGenerationTask).configureEach {
5258
enabled = false
5359
}
54-
configurations.all {
60+
configurations.configureEach {
5561
// Temporarily exclude sample-barebones project from substitution in order to fix the gradle
5662
// build.
5763
if (project.name != "sample-barebones") {
@@ -66,11 +72,11 @@ allprojects {
6672
}
6773

6874
subprojects {
69-
tasks.withType(Javadoc).all {
75+
tasks.withType(Javadoc).configureEach {
7076
enabled = false
7177
}
7278

73-
tasks.withType(org.jetbrains.dokka.gradle.DokkaTaskPartial).configureEach {
79+
tasks.withType(DokkaTaskPartial).configureEach {
7480
dokkaSourceSets {
7581
configureEach {
7682
def module_docs_file = 'module-docs.md'
@@ -79,10 +85,10 @@ subprojects {
7985
}
8086
}
8187
}
82-
dependsOn(tasks.withType(org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask))
88+
dependsOn(tasks.withType(KaptWithoutKotlincTask))
8389
}
8490

85-
tasks.withType(Test) {
91+
tasks.withType(Test).configureEach {
8692
systemProperty "robolectric.looperMode", "LEGACY"
8793

8894
testLogging {
@@ -91,14 +97,14 @@ subprojects {
9197
}
9298
}
9399

94-
plugins.withType(org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin) {
100+
plugins.withType(KotlinBasePlugin).configureEach {
95101
kotlin {
96102
jvmToolchain(17)
97103
}
98104
}
99105

100106
afterEvaluate {
101-
tasks.withType(Test) {
107+
tasks.withType(Test).configureEach {
102108
it.dependsOn copyYogaLibs
103109
systemProperty 'java.library.path', "${rootDir}/build/jniLibs"
104110
environment 'LD_LIBRARY_PATH', "${rootDir}/build/jniLibs"
@@ -114,7 +120,7 @@ subprojects {
114120

115121
apply plugin: 'org.jetbrains.dokka'
116122

117-
tasks.withType(org.jetbrains.dokka.gradle.DokkaMultiModuleTask).configureEach {
123+
tasks.withType(DokkaMultiModuleTask).configureEach {
118124
outputDirectory = file("${rootDir}/website/static/reference")
119125
moduleName = "Litho"
120126
}
@@ -207,7 +213,8 @@ ext.deps.yoga =
207213

208214
// This should hopefully only serve as a temporary measure until
209215
// we have a proper Gradle setup for Yoga and JNI.
210-
task copyYogaLibs(type: Copy, dependsOn: ':yoga:buckBuild') {
216+
tasks.register('copyYogaLibs', Copy) {
217+
dependsOn ':yoga:buckBuild'
211218
from 'buck-out/gen/lib/yogajni/jni#default,shared/'
212219
include '*.so'
213220
include '*.dylib'

lib/yoga/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies {
4141
// Our current NDK setup only gets us half-way there to a way to run Yoga
4242
// locally for unit tests. We're reusing the buck builds for now and hopefully
4343
// someone (maybe you!) will fix this and get CMake to help us out.
44-
task buckBuild(type: Exec) {
44+
tasks.register('buckBuild', Exec) {
4545
workingDir rootDir
4646
environment BUCKVERSION: System.getenv('BUCKVERSION') ?: 'last'
4747
def buckPath = System.getenv('BUCK_PATH')

lib/yogajni/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ android {
2828
version '3.18.1'
2929
}
3030
}
31+
}
3132

32-
dependencies {
33-
// We want to export the Java APIs
34-
api project(':yoga')
35-
compileOnly deps.inferAnnotations
36-
}
33+
dependencies {
34+
// We want to export the Java APIs
35+
api project(':yoga')
36+
compileOnly deps.inferAnnotations
3737
}

litho-core/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ android {
5959
buildConfig true
6060
}
6161
namespace 'com.facebook.litho'
62+
// TODO(#62): Re-enable abort on error.
6263
lint {
6364
abortOnError false
6465
}
65-
66-
// TODO(#62): Re-enable abort on error.
6766
}
6867

6968
dependencies {

litho-coroutines-kotlin/build.gradle

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
18+
1719
apply plugin: 'com.android.library'
1820
apply plugin: 'kotlin-android'
1921
apply plugin: 'org.jetbrains.dokka'
@@ -28,23 +30,21 @@ android {
2830
}
2931

3032
testOptions {
31-
unitTests {
32-
includeAndroidResources = true
33+
unitTests.includeAndroidResources = true
3334

34-
all {
35-
// Because of native libraries loading (Yoga), we can never reuse a class loader and
36-
// need to fork a new process per class.
37-
forkEvery = 1
38-
maxParallelForks = 2
35+
unitTests.all {
36+
// Because of native libraries loading (Yoga), we can never reuse a class loader and
37+
// need to fork a new process per class.
38+
forkEvery = 1
39+
maxParallelForks = 2
3940

40-
testLogging {
41-
events 'skipped', 'failed', 'standardOut', 'standardError'
42-
showCauses = true
43-
showExceptions = true
44-
showStackTraces = true
45-
exceptionFormat = 'full'
46-
stackTraceFilters = []
47-
}
41+
testLogging {
42+
events 'skipped', 'failed', 'standardOut', 'standardError'
43+
showCauses = true
44+
showExceptions = true
45+
showStackTraces = true
46+
exceptionFormat = 'full'
47+
stackTraceFilters = []
4848
}
4949
}
5050
}
@@ -56,7 +56,7 @@ android {
5656
namespace 'com.facebook.litho.coroutines'
5757
}
5858

59-
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
59+
tasks.withType(KotlinCompile).configureEach {
6060
kotlinOptions {
6161
freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
6262
}

litho-editor-core/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ android {
2727
targetSdkVersion rootProject.targetSdkVersion
2828
}
2929

30-
// TODO(#62): Re-enable abort on error.
31-
32-
dependencies {
33-
api project(':litho-core')
34-
compileOnly deps.jsr305
35-
compileOnly deps.proguardAnnotations
36-
compileOnly deps.supportAnnotations
37-
compileOnly deps.inferAnnotations
38-
}
3930
namespace 'com.facebook.litho.editor'
31+
32+
// TODO(#62): Re-enable abort on error.
4033
lint {
4134
abortOnError false
4235
}
4336
}
4437

38+
dependencies {
39+
api project(':litho-core')
40+
compileOnly deps.jsr305
41+
compileOnly deps.proguardAnnotations
42+
compileOnly deps.supportAnnotations
43+
compileOnly deps.inferAnnotations
44+
}
45+
4546
apply plugin: "com.vanniktech.maven.publish"

litho-editor-flipper/build.gradle

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,8 @@ android {
2828
targetSdkVersion rootProject.targetSdkVersion
2929
}
3030

31-
// TODO(#62): Re-enable abort on error.
32-
33-
dependencies {
34-
kapt project(':litho-processor')
35-
kapt project(':litho-sections-processor')
36-
37-
implementation deps.kotlinStandardLib
38-
implementation project(':litho-core')
39-
implementation project(':litho-widget')
40-
implementation project(':litho-editor-core')
41-
implementation project(':litho-sections-core')
42-
implementation project(':litho-sections-debug')
43-
implementation deps.flipper
44-
implementation deps.supportAppCompat
45-
implementation deps.guava
46-
compileOnly deps.jsr305
47-
compileOnly deps.proguardAnnotations
48-
compileOnly project(':litho-annotations')
49-
compileOnly deps.inferAnnotations
50-
51-
testImplementation deps.junit
52-
testImplementation deps.robolectric
53-
testImplementation project(':litho-rendercore-testing')
54-
testImplementation project(':litho-testing')
55-
testImplementation project(':litho-widget-kotlin')
56-
testAnnotationProcessor project(':litho-processor')
57-
testImplementation deps.assertjCore
58-
testImplementation deps.supportRecyclerView
59-
testImplementation deps.supportTestJunit
60-
testImplementation deps.mockitokotlin
61-
testImplementation deps.supportTestCore
62-
63-
kaptTest project(':litho-processor')
64-
}
6531
namespace 'com.facebook.litho.editor.flipper'
32+
// TODO(#62): Re-enable abort on error.
6633
lint {
6734
abortOnError false
6835
}
@@ -72,4 +39,37 @@ kotlin {
7239
jvmToolchain(17)
7340
}
7441

42+
dependencies {
43+
kapt project(':litho-processor')
44+
kapt project(':litho-sections-processor')
45+
46+
implementation deps.kotlinStandardLib
47+
implementation project(':litho-core')
48+
implementation project(':litho-widget')
49+
implementation project(':litho-editor-core')
50+
implementation project(':litho-sections-core')
51+
implementation project(':litho-sections-debug')
52+
implementation deps.flipper
53+
implementation deps.supportAppCompat
54+
implementation deps.guava
55+
compileOnly deps.jsr305
56+
compileOnly deps.proguardAnnotations
57+
compileOnly project(':litho-annotations')
58+
compileOnly deps.inferAnnotations
59+
60+
testImplementation deps.junit
61+
testImplementation deps.robolectric
62+
testImplementation project(':litho-rendercore-testing')
63+
testImplementation project(':litho-testing')
64+
testImplementation project(':litho-widget-kotlin')
65+
testAnnotationProcessor project(':litho-processor')
66+
testImplementation deps.assertjCore
67+
testImplementation deps.supportRecyclerView
68+
testImplementation deps.supportTestJunit
69+
testImplementation deps.mockitokotlin
70+
testImplementation deps.supportTestCore
71+
72+
kaptTest project(':litho-processor')
73+
}
74+
7575
apply plugin: "com.vanniktech.maven.publish"

litho-fresco-kotlin/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
18+
1719
apply plugin: 'com.android.library'
1820
apply plugin: 'kotlin-android'
1921
apply plugin: 'com.facebook.kotlin.compilerplugins.dataclassgenerate'
@@ -33,7 +35,7 @@ android {
3335
namespace 'com.facebook.litho.fresco.kotlin'
3436
}
3537

36-
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
38+
tasks.withType(KotlinCompile).configureEach {
3739
kotlinOptions {
3840
freeCompilerArgs = ["-XXLanguage:+InlineClasses"]
3941
}

litho-fresco/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ android {
2424
minSdkVersion rootProject.minSdkVersion
2525
}
2626
namespace 'com.facebook.litho.fresco'
27+
// TODO(#62): Re-enable abort on error.
2728
lint {
2829
abortOnError false
2930
}
30-
31-
// TODO(#62): Re-enable abort on error.
3231
}
3332

3433
dependencies {

litho-intellij-plugin/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ apply plugin: "org.jetbrains.intellij"
2929
group 'com.facebook.litho.intellij'
3030

3131
sourceCompatibility = rootProject.sourceCompatibilityVersion
32+
targetCompatibility = rootProject.targetCompatibilityVersion
3233

3334
compileKotlin {
3435
kotlinOptions.jvmTarget = rootProject.targetCompatibilityVersion
@@ -67,7 +68,7 @@ intellij {
6768
plugins = ['java', 'org.jetbrains.kotlin',]
6869
}
6970

70-
task merge {
71+
tasks.register('merge') {
7172
doLast {
7273
def output = new File(project.buildDir, "patchedPluginXmlFiles/plugin.xml")
7374

0 commit comments

Comments
 (0)