Skip to content

Commit fa88eee

Browse files
authored
Port app.get() check from errorprone to lint (#4434)
* Port app.get() check from errorprone to lint Motivation: Make sure the check works for kotlin, not only java. * Add copyrights
1 parent eb7480b commit fa88eee

File tree

15 files changed

+277
-382
lines changed

15 files changed

+277
-382
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseJavaLibraryPlugin.java

-7
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ private static void setupStaticAnalysis(Project project, FirebaseLibraryExtensio
6868
.getConfigurations()
6969
.all(
7070
c -> {
71-
if ("annotationProcessor".equals(c.getName())) {
72-
for (String checkProject : library.staticAnalysis.errorproneCheckProjects) {
73-
project
74-
.getDependencies()
75-
.add("annotationProcessor", project.project(checkProject));
76-
}
77-
}
7871
if ("lintChecks".equals(c.getName())) {
7972
for (String checkProject :
8073
library.staticAnalysis.androidLintCheckProjects) {

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseLibraryExtension.java

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public FirebaseLibraryExtension(Project project, LibraryType type) {
9191

9292
private FirebaseStaticAnalysis initializeStaticAnalysis(Project project) {
9393
return new FirebaseStaticAnalysis(
94-
projectsFromProperty(project, "firebase.checks.errorproneProjects"),
9594
projectsFromProperty(project, "firebase.checks.lintProjects"));
9695
}
9796

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java

-7
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@ private static void setupStaticAnalysis(Project project, FirebaseLibraryExtensio
213213
.getConfigurations()
214214
.all(
215215
c -> {
216-
if ("annotationProcessor".equals(c.getName())) {
217-
for (String checkProject : library.staticAnalysis.errorproneCheckProjects) {
218-
project
219-
.getDependencies()
220-
.add("annotationProcessor", project.project(checkProject));
221-
}
222-
}
223216
if ("lintChecks".equals(c.getName())) {
224217
for (String checkProject :
225218
library.staticAnalysis.androidLintCheckProjects) {

buildSrc/src/main/java/com/google/firebase/gradle/plugins/FirebaseStaticAnalysis.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@
1717
import java.util.Set;
1818

1919
public class FirebaseStaticAnalysis {
20-
public Set<String> errorproneCheckProjects;
2120
public Set<String> androidLintCheckProjects;
2221

23-
public FirebaseStaticAnalysis(
24-
Set<String> errorproneCheckProjects, Set<String> androidLintCheckProjects) {
25-
this.errorproneCheckProjects = errorproneCheckProjects;
22+
public FirebaseStaticAnalysis(Set<String> androidLintCheckProjects) {
2623
this.androidLintCheckProjects = androidLintCheckProjects;
2724
}
2825
}

gradle.properties

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ org.gradle.jvmargs=-Xmx8g -XX:MaxPermSize=8g
1616
org.gradle.parallel=true
1717
org.gradle.caching=true
1818

19-
firebase.checks.errorproneProjects=:tools:errorprone
2019
firebase.checks.lintProjects=:tools:lint
2120

2221
systemProp.illegal-access=warn

subprojects.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ encoders:protoc-gen-firebase-encoders:tests
6767

6868
integ-testing
6969

70-
tools:errorprone
7170
tools:lint
7271

7372
transport

tools/errorprone/errorprone.gradle

-26
This file was deleted.

tools/errorprone/src/main/java/com/google/firebase/errorprone/ComponentsAppGetCheck.java

-146
This file was deleted.

tools/errorprone/src/test/java/com/google/firebase/FirebaseApp.java

-22
This file was deleted.

tools/errorprone/src/test/java/com/google/firebase/errorprone/ComponentsAppGetCheckTest.java

-42
This file was deleted.

tools/errorprone/src/test/resources/com/google/firebase/errorprone/FirebaseUseExplicitDependenciesNegativeCases.java

-74
This file was deleted.

0 commit comments

Comments
 (0)