diff --git a/build.gradle b/build.gradle index ce8cd3d18d33..c8b2a9ebbbbc 100644 --- a/build.gradle +++ b/build.gradle @@ -418,23 +418,33 @@ idea { } } -subprojects { - apply plugin: "com.diffplug.spotless" +subprojects { project -> + // Perform spotless lint in GeckoView projects only. + def projectName = project.getName() + if (projectName.startsWith('geckoview') + || projectName == 'annotations' + || projectName == 'exoplayer2' + || projectName == 'messaging_example' + || projectName == 'port_messaging_example' + || projectName == 'test_runner' + ) { + apply plugin: "com.diffplug.spotless" - spotless { - java { - target project.fileTree(project.projectDir) { - include '**/*.java' - exclude '**/thirdparty/**' + spotless { + java { + target project.fileTree(project.projectDir) { + include '**/*.java' + exclude '**/thirdparty/**' + } + googleJavaFormat('1.17.0') } - googleJavaFormat('1.17.0') - } - kotlin { - target project.fileTree(project.projectDir) { - include '**/*.kt' - exclude '**/thirdparty/**' + kotlin { + target project.fileTree(project.projectDir) { + include '**/*.kt' + exclude '**/thirdparty/**' + } + ktlint('0.49.1') } - ktlint('0.49.1') } }