Skip to content

Commit 8d4335f

Browse files
daymxnyifanyang
authored andcommitted
Upgrade Gradle to 6.9 (#3744)
* Migrate from deprecated api usage in Coverage script * Fix bugs preventing 6.9 upgrade * oops, that shouldn't have been there still * Fixed old usage of Gradle BOM support (or lack-there-of) * Fixed some minor gradle consistencies, and added firehorn to gitignore * Added distribution versioning back * Explicitly depend on appdistribution-api Co-authored-by: Yifan Yang <[email protected]>
1 parent 41d69da commit 8d4335f

File tree

23 files changed

+191
-75
lines changed

23 files changed

+191
-75
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ _artifacts
99
.DS_Store
1010
firebase-crashlytics-ndk/.externalNativeBuild/
1111
firebase-crashlytics-ndk/.cxx/
12+
smoke-test-logs/
13+
smoke-tests/build-debug-headGit-smoke-test
14+
smoke-tests/firehorn.log
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck.debug.testing {
3+
4+
public final class DebugAppCheckTestHelper {
5+
method @NonNull public static com.google.firebase.appcheck.debug.testing.DebugAppCheckTestHelper fromInstrumentationArgs();
6+
method public <E extends java.lang.Throwable> void withDebugProvider(@NonNull com.google.firebase.appcheck.debug.testing.DebugAppCheckTestHelper.MaybeThrowingRunnable<E>) throws E;
7+
method public <E extends java.lang.Throwable> void withDebugProvider(@NonNull com.google.firebase.FirebaseApp, @NonNull com.google.firebase.appcheck.debug.testing.DebugAppCheckTestHelper.MaybeThrowingRunnable<E>) throws E;
8+
}
9+
10+
public static interface DebugAppCheckTestHelper.MaybeThrowingRunnable<E extends java.lang.Throwable> {
11+
method public void run() throws E;
12+
}
13+
14+
}
15+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck.debug {
3+
4+
public class DebugAppCheckProviderFactory implements com.google.firebase.appcheck.AppCheckProviderFactory {
5+
method @NonNull public com.google.firebase.appcheck.AppCheckProvider create(@NonNull com.google.firebase.FirebaseApp);
6+
method @NonNull public static com.google.firebase.appcheck.debug.DebugAppCheckProviderFactory getInstance();
7+
}
8+
9+
}
10+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck {
3+
4+
public abstract class AppCheckTokenResult {
5+
ctor public AppCheckTokenResult();
6+
method @Nullable public abstract com.google.firebase.FirebaseException getError();
7+
method @NonNull public abstract String getToken();
8+
}
9+
10+
}
11+
12+
package com.google.firebase.appcheck.interop {
13+
14+
public interface AppCheckTokenListener {
15+
method public void onAppCheckTokenChanged(@NonNull com.google.firebase.appcheck.AppCheckTokenResult);
16+
}
17+
18+
public interface InternalAppCheckTokenProvider {
19+
method public void addAppCheckTokenListener(@NonNull com.google.firebase.appcheck.interop.AppCheckTokenListener);
20+
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.appcheck.AppCheckTokenResult> getToken(boolean);
21+
method public void removeAppCheckTokenListener(@NonNull com.google.firebase.appcheck.interop.AppCheckTokenListener);
22+
}
23+
24+
}
25+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck.playintegrity {
3+
4+
public class PlayIntegrityAppCheckProviderFactory implements com.google.firebase.appcheck.AppCheckProviderFactory {
5+
ctor public PlayIntegrityAppCheckProviderFactory();
6+
method @NonNull public com.google.firebase.appcheck.AppCheckProvider create(@NonNull com.google.firebase.FirebaseApp);
7+
method @NonNull public static com.google.firebase.appcheck.playintegrity.PlayIntegrityAppCheckProviderFactory getInstance();
8+
}
9+
10+
}
11+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck.safetynet {
3+
4+
public class SafetyNetAppCheckProviderFactory implements com.google.firebase.appcheck.AppCheckProviderFactory {
5+
method @NonNull public com.google.firebase.appcheck.AppCheckProvider create(@NonNull com.google.firebase.FirebaseApp);
6+
method @NonNull public static com.google.firebase.appcheck.safetynet.SafetyNetAppCheckProviderFactory getInstance();
7+
}
8+
9+
}
10+

appcheck/firebase-appcheck/api.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appcheck {
3+
4+
public interface AppCheckProvider {
5+
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.appcheck.AppCheckToken> getToken();
6+
}
7+
8+
public interface AppCheckProviderFactory {
9+
method @NonNull public com.google.firebase.appcheck.AppCheckProvider create(@NonNull com.google.firebase.FirebaseApp);
10+
}
11+
12+
public abstract class AppCheckToken {
13+
ctor public AppCheckToken();
14+
method public abstract long getExpireTimeMillis();
15+
method @NonNull public abstract String getToken();
16+
}
17+
18+
public abstract class FirebaseAppCheck implements com.google.firebase.appcheck.interop.InternalAppCheckTokenProvider {
19+
ctor public FirebaseAppCheck();
20+
method public abstract void addAppCheckListener(@NonNull com.google.firebase.appcheck.FirebaseAppCheck.AppCheckListener);
21+
method @NonNull public abstract com.google.android.gms.tasks.Task<com.google.firebase.appcheck.AppCheckToken> getAppCheckToken(boolean);
22+
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck getInstance();
23+
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck getInstance(@NonNull com.google.firebase.FirebaseApp);
24+
method public abstract void installAppCheckProviderFactory(@NonNull com.google.firebase.appcheck.AppCheckProviderFactory);
25+
method public abstract void installAppCheckProviderFactory(@NonNull com.google.firebase.appcheck.AppCheckProviderFactory, boolean);
26+
method public abstract void removeAppCheckListener(@NonNull com.google.firebase.appcheck.FirebaseAppCheck.AppCheckListener);
27+
method public abstract void setTokenAutoRefreshEnabled(boolean);
28+
}
29+
30+
public static interface FirebaseAppCheck.AppCheckListener {
31+
method public void onAppCheckTokenChanged(@NonNull com.google.firebase.appcheck.AppCheckToken);
32+
}
33+
34+
}
35+

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
plugins {
16-
id "org.gradle.kotlin.kotlin-dsl" version "1.2.9"
16+
id "org.gradle.kotlin.kotlin-dsl" version "1.4.9"
1717
id "org.jlleitschuh.gradle.ktlint" version "9.2.1"
1818
id 'com.github.sherter.google-java-format' version '0.9'
1919
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ private static void setupApiInformationAnalysis(Project project) {
117117
task -> {
118118
task.setOutputFile(metalavaOutputJarFile);
119119
});
120+
120121
File apiTxt =
121122
project.file("api.txt").exists()
122123
? project.file("api.txt")

buildSrc/src/main/java/com/google/firebase/gradle/plugins/Metalava.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import org.gradle.api.Project
2121
import org.gradle.api.artifacts.Configuration
2222
import org.gradle.api.file.FileCollection
2323
import org.gradle.api.tasks.InputFiles
24+
import org.gradle.api.tasks.Nested
2425
import org.gradle.api.tasks.OutputDirectory
2526
import org.gradle.api.tasks.SourceSet
2627
import org.gradle.api.tasks.TaskAction
@@ -50,7 +51,8 @@ fun Project.runMetalavaWithArgs(
5051

5152
abstract class GenerateStubsTask : DefaultTask() {
5253
/** Source files against which API signatures will be validated. */
53-
lateinit var sourceSet: Object
54+
@Nested
55+
lateinit var sourceSet: Any
5456

5557
@get:InputFiles
5658
lateinit var classPath: FileCollection

buildSrc/src/main/java/com/google/firebase/gradle/plugins/apiinfo/ApiInformationTask.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.gradle.api.tasks.Input;
3131
import org.gradle.api.tasks.InputFile;
3232
import org.gradle.api.tasks.InputFiles;
33+
import org.gradle.api.tasks.Nested;
3334
import org.gradle.api.tasks.OutputFile;
3435
import org.gradle.api.tasks.SourceSet;
3536
import org.gradle.api.tasks.TaskAction;
@@ -46,6 +47,7 @@ public abstract class ApiInformationTask extends DefaultTask {
4647
@InputFile
4748
abstract File getApiTxt();
4849

50+
@Nested
4951
abstract Object getSourceSet();
5052

5153
@InputFiles

buildSrc/src/main/java/com/google/firebase/gradle/plugins/apiinfo/GenerateApiTxtFileTask.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.gradle.api.file.FileCollection;
2727
import org.gradle.api.tasks.Input;
2828
import org.gradle.api.tasks.InputFiles;
29+
import org.gradle.api.tasks.Nested;
2930
import org.gradle.api.tasks.OutputFile;
3031
import org.gradle.api.tasks.SourceSet;
3132
import org.gradle.api.tasks.TaskAction;
@@ -35,32 +36,33 @@ public abstract class GenerateApiTxtFileTask extends DefaultTask {
3536
@Input
3637
abstract String getMetalavaJarPath();
3738

39+
public abstract void setMetalavaJarPath(String value);
40+
3841
@OutputFile
3942
abstract File getApiTxt();
4043

44+
public abstract void setApiTxt(File value);
45+
46+
@Nested
4147
abstract Object getSourceSet();
4248

49+
public abstract void setSourceSet(Object value);
50+
4351
@InputFiles
4452
public abstract FileCollection getClassPath();
4553

54+
public abstract void setClassPath(FileCollection value);
55+
4656
@OutputFile
4757
abstract File getBaselineFile();
4858

59+
public abstract void setBaselineFile(File value);
60+
4961
@Input
5062
abstract boolean getUpdateBaseline();
5163

52-
public abstract void setSourceSet(Object value);
53-
54-
public abstract void setClassPath(FileCollection value);
55-
56-
public abstract void setBaselineFile(File value);
57-
5864
public abstract void setUpdateBaseline(boolean value);
5965

60-
public abstract void setMetalavaJarPath(String value);
61-
62-
public abstract void setApiTxt(File value);
63-
6466
private Set<File> getSourceDirs() {
6567
if (getSourceSet() instanceof SourceSet) {
6668
return ((SourceSet) getSourceSet()).getJava().getSrcDirs();

buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/Coverage.java

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.gradle.testing.jacoco.tasks.JacocoReport;
2727

2828
public final class Coverage {
29+
2930
private Coverage() {}
3031

3132
public static void apply(FirebaseLibraryExtension firebaseLibrary) {
@@ -66,28 +67,31 @@ public static void apply(FirebaseLibraryExtension firebaseLibrary) {
6667
.add("**Manifest*.*")
6768
.build();
6869

69-
task.setClassDirectories(
70-
project.files(
71-
project.fileTree(
72-
ImmutableMap.of(
73-
"dir",
74-
project.getBuildDir() + "/intermediates/javac/release",
75-
"excludes",
76-
excludes)),
70+
task.getClassDirectories()
71+
.setFrom(
72+
project.files(
73+
project.fileTree(
74+
ImmutableMap.of(
75+
"dir",
76+
project.getBuildDir() + "/intermediates/javac/release",
77+
"excludes",
78+
excludes)),
79+
project.fileTree(
80+
ImmutableMap.of(
81+
"dir",
82+
project.getBuildDir() + "/tmp/kotlin-classes/release",
83+
"excludes",
84+
excludes))));
85+
task.getSourceDirectories()
86+
.setFrom(project.files("src/main/java", "src/main/kotlin"));
87+
task.getExecutionData()
88+
.setFrom(
7789
project.fileTree(
7890
ImmutableMap.of(
7991
"dir",
80-
project.getBuildDir() + "/tmp/kotlin-classes/release",
81-
"excludes",
82-
excludes))));
83-
task.setSourceDirectories(project.files("src/main/java", "src/main/kotlin"));
84-
task.setExecutionData(
85-
project.fileTree(
86-
ImmutableMap.of(
87-
"dir",
88-
project.getBuildDir(),
89-
"includes",
90-
ImmutableList.of("jacoco/*.exec"))));
92+
project.getBuildDir(),
93+
"includes",
94+
ImmutableList.of("jacoco/*.exec"))));
9195
task.reports(
9296
reports -> {
9397
reports

firebase-annotations/api.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.annotations {
3+
4+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface PreviewApi {
5+
}
6+
7+
}
8+

firebase-appdistribution-api/firebase-appdistribution-api.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dependencies {
4747
testImplementation "com.google.truth:truth:$googleTruthVersion"
4848
testImplementation 'androidx.test:core:1.2.0'
4949
testImplementation 'org.mockito:mockito-inline:3.4.0'
50+
testImplementation project(':firebase-appdistribution-api')
5051
androidTestImplementation "org.mockito:mockito-android:3.4.0"
5152
compileOnly 'com.google.auto.value:auto-value-annotations:1.6.5'
5253
annotationProcessor 'com.google.auto.value:auto-value:1.6.5'

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/UpdateProgress.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public interface UpdateProgress {
2424
* @returns the number of bytes downloaded, or -1 if called when updating to an AAB or if no new
2525
* release is available.
2626
*/
27+
@NonNull
2728
long getApkBytesDownloaded();
2829

2930
/**
@@ -32,6 +33,7 @@ public interface UpdateProgress {
3233
* @returns the file size in bytes, or -1 if called when updating to an AAB or if no new release
3334
* is available.
3435
*/
36+
@NonNull
3537
long getApkFileTotalBytes();
3638

3739
/** Returns the current {@link UpdateStatus} of the update. */

firebase-dynamic-links/api.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ package com.google.firebase.dynamiclinks {
116116
public abstract class FirebaseDynamicLinks {
117117
ctor public FirebaseDynamicLinks();
118118
method @NonNull public abstract com.google.firebase.dynamiclinks.DynamicLink.Builder createDynamicLink();
119-
method @NonNull public abstract com.google.android.gms.tasks.Task<com.google.firebase.dynamiclinks.PendingDynamicLinkData> getDynamicLink(@NonNull android.content.Intent);
119+
method @NonNull public abstract com.google.android.gms.tasks.Task<com.google.firebase.dynamiclinks.PendingDynamicLinkData> getDynamicLink(@Nullable android.content.Intent);
120120
method @NonNull public abstract com.google.android.gms.tasks.Task<com.google.firebase.dynamiclinks.PendingDynamicLinkData> getDynamicLink(@NonNull android.net.Uri);
121121
method @NonNull public static com.google.firebase.dynamiclinks.FirebaseDynamicLinks getInstance();
122122
method @NonNull public static com.google.firebase.dynamiclinks.FirebaseDynamicLinks getInstance(@NonNull com.google.firebase.FirebaseApp);

gradle/wrapper/gradle-wrapper.jar

3.5 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)