Skip to content

Commit 1300f27

Browse files
committed
Merge branch 'master' into wuandy/JustEnoughDocReads
2 parents e86c069 + 5657f12 commit 1300f27

File tree

147 files changed

+5200
-2413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+5200
-2413
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Signature format: 2.0
2+
package com.google.firebase.appdistribution {
3+
4+
public abstract class AppDistributionRelease {
5+
ctor public AppDistributionRelease();
6+
method @NonNull public abstract com.google.firebase.appdistribution.BinaryType getBinaryType();
7+
method @NonNull public abstract String getDisplayVersion();
8+
method @Nullable public abstract String getReleaseNotes();
9+
method @NonNull public abstract long getVersionCode();
10+
}
11+
12+
public enum BinaryType {
13+
enum_constant public static final com.google.firebase.appdistribution.BinaryType AAB;
14+
enum_constant public static final com.google.firebase.appdistribution.BinaryType APK;
15+
}
16+
17+
public class FirebaseAppDistribution {
18+
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.appdistribution.AppDistributionRelease> checkForNewRelease();
19+
method @NonNull public static com.google.firebase.appdistribution.FirebaseAppDistribution getInstance();
20+
method public boolean isTesterSignedIn();
21+
method @NonNull public com.google.android.gms.tasks.Task<java.lang.Void> signInTester();
22+
method public void signOutTester();
23+
method @NonNull public com.google.firebase.appdistribution.UpdateTask updateApp();
24+
method @NonNull public com.google.firebase.appdistribution.UpdateTask updateIfNewReleaseAvailable();
25+
}
26+
27+
public class FirebaseAppDistributionException extends com.google.firebase.FirebaseException {
28+
method @NonNull public com.google.firebase.appdistribution.FirebaseAppDistributionException.Status getErrorCode();
29+
method @Nullable public com.google.firebase.appdistribution.AppDistributionRelease getRelease();
30+
}
31+
32+
public enum FirebaseAppDistributionException.Status {
33+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status APP_RUNNING_IN_PRODUCTION;
34+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status AUTHENTICATION_CANCELED;
35+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status AUTHENTICATION_FAILURE;
36+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status DOWNLOAD_FAILURE;
37+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status FOREGROUND_ACTIVITY_NOT_AVAILABLE;
38+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status INSTALLATION_CANCELED;
39+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status INSTALLATION_FAILURE;
40+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status INSTALLATION_FAILURE_SIGNATURE_MISMATCH;
41+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status NETWORK_FAILURE;
42+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status RELEASE_URL_EXPIRED;
43+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status UNKNOWN;
44+
enum_constant public static final com.google.firebase.appdistribution.FirebaseAppDistributionException.Status UPDATE_NOT_AVAILABLE;
45+
}
46+
47+
public interface OnProgressListener {
48+
method public void onProgressUpdate(@NonNull com.google.firebase.appdistribution.UpdateProgress);
49+
}
50+
51+
public abstract class UpdateProgress {
52+
ctor public UpdateProgress();
53+
method @NonNull public abstract long getApkBytesDownloaded();
54+
method @NonNull public abstract long getApkFileTotalBytes();
55+
method @NonNull public abstract com.google.firebase.appdistribution.UpdateStatus getUpdateStatus();
56+
}
57+
58+
public enum UpdateStatus {
59+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus DOWNLOADED;
60+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus DOWNLOADING;
61+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus DOWNLOAD_FAILED;
62+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus INSTALL_CANCELED;
63+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus INSTALL_FAILED;
64+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus NEW_RELEASE_CHECK_FAILED;
65+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus NEW_RELEASE_NOT_AVAILABLE;
66+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus PENDING;
67+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus REDIRECTED_TO_PLAY;
68+
enum_constant public static final com.google.firebase.appdistribution.UpdateStatus UPDATE_CANCELED;
69+
}
70+
71+
public abstract class UpdateTask extends com.google.android.gms.tasks.Task<java.lang.Void> {
72+
ctor public UpdateTask();
73+
method @NonNull public abstract com.google.firebase.appdistribution.UpdateTask addOnProgressListener(@NonNull com.google.firebase.appdistribution.OnProgressListener);
74+
method @NonNull public abstract com.google.firebase.appdistribution.UpdateTask addOnProgressListener(@Nullable java.util.concurrent.Executor, @NonNull com.google.firebase.appdistribution.OnProgressListener);
75+
}
76+
77+
}
78+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins {
16+
id 'firebase-library'
17+
}
18+
19+
android {
20+
compileSdkVersion project.targetSdkVersion
21+
22+
defaultConfig {
23+
minSdkVersion 16
24+
targetSdkVersion project.targetSdkVersion
25+
multiDexEnabled true
26+
versionName version
27+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
28+
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_1_8
31+
targetCompatibility JavaVersion.VERSION_1_8
32+
}
33+
testOptions {
34+
unitTests {
35+
includeAndroidResources = true
36+
}
37+
}
38+
}
39+
40+
dependencies {
41+
implementation 'org.jetbrains:annotations:15.0'
42+
implementation project(':firebase-components')
43+
implementation project(':firebase-common')
44+
implementation 'com.google.android.gms:play-services-tasks:17.0.0'
45+
46+
testImplementation 'junit:junit:4.13.2'
47+
testImplementation "com.google.truth:truth:$googleTruthVersion"
48+
testImplementation "org.robolectric:robolectric:$robolectricVersion"
49+
50+
compileOnly 'com.google.auto.value:auto-value-annotations:1.6.5'
51+
annotationProcessor 'com.google.auto.value:auto-value:1.6.5'
52+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
version=0.0.1
16+
latestReleasedVersion=0.0.1
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.appdistribution.ktx {
3+
4+
public final class FirebaseAppDistributionKt {
5+
ctor public FirebaseAppDistributionKt();
6+
method @NonNull public static com.google.firebase.appdistribution.FirebaseAppDistribution getAppDistribution(@NonNull com.google.firebase.ktx.Firebase);
7+
}
8+
9+
}
10+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
android.enableUnitTestBinaryResources=true
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
plugins {
16+
id 'firebase-library'
17+
id 'kotlin-android'
18+
}
19+
20+
firebaseLibrary {
21+
releaseWith project(':firebase-app-distribution-stub')
22+
testLab.enabled = true
23+
publishJavadoc = true
24+
publishSources = true
25+
}
26+
27+
android {
28+
compileSdkVersion project.targetSdkVersion
29+
defaultConfig {
30+
minSdkVersion 16
31+
multiDexEnabled true
32+
targetSdkVersion project.targetSdkVersion
33+
versionName version
34+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
35+
}
36+
sourceSets {
37+
main.java.srcDirs += 'src/main/kotlin'
38+
test.java {
39+
srcDir 'src/test/kotlin'
40+
}
41+
androidTest.java.srcDirs += 'src/androidTest/kotlin'
42+
}
43+
testOptions.unitTests.includeAndroidResources = true
44+
}
45+
46+
dependencies {
47+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
48+
49+
implementation project(':firebase-common')
50+
implementation project(':firebase-components')
51+
implementation project(':firebase-common:ktx')
52+
implementation 'androidx.annotation:annotation:1.1.0'
53+
implementation project(':firebase-app-distribution-stub')
54+
55+
testImplementation "org.robolectric:robolectric:$robolectricVersion"
56+
testImplementation 'junit:junit:4.12'
57+
testImplementation "com.google.truth:truth:$googleTruthVersion"
58+
testImplementation 'org.mockito:mockito-core:2.25.0'
59+
60+
androidTestImplementation 'junit:junit:4.12'
61+
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
62+
androidTestImplementation 'androidx.test:runner:1.2.0'
63+
androidTestImplementation 'androidx.test:core:1.2.0'
64+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.google.firebase.appdistribution.ktx">
3+
<!--Although the *SdkVersion is captured in gradle build files, this is required for non gradle builds-->
4+
<!--<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" />-->
5+
<uses-permission android:name="android.permission.INTERNET"/>
6+
<application>
7+
<uses-library android:name="android.test.runner" />
8+
</application>
9+
10+
<instrumentation
11+
android:name="androidx.test.runner.AndroidJUnitRunner"
12+
android:targetPackage="3com.google.firebase.appdistribution.ktx" />
13+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.appdistribution.ktx
16+
17+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
18+
import com.google.common.truth.Truth
19+
import com.google.firebase.appdistribution.FirebaseAppDistribution
20+
import com.google.firebase.ktx.Firebase
21+
import org.junit.Test
22+
import org.junit.runner.RunWith
23+
24+
@RunWith(AndroidJUnit4ClassRunner::class)
25+
class FirebaseAppDistributionTests {
26+
@Test
27+
fun appDistribution_default_returnsInstanceOfFirebaseAppDistribution() {
28+
Truth.assertThat(Firebase.appDistribution).isInstanceOf(FirebaseAppDistribution::class.java)
29+
}
30+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Copyright 2021 Google LLC -->
2+
<!-- -->
3+
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
4+
<!-- you may not use this file except in compliance with the License. -->
5+
<!-- You may obtain a copy of the License at -->
6+
<!-- -->
7+
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
8+
<!-- -->
9+
<!-- Unless required by applicable law or agreed to in writing, software -->
10+
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
11+
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
12+
<!-- See the License for the specific language governing permissions and -->
13+
<!-- limitations under the License. -->
14+
15+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
16+
package="com.google.firebase.appdistribution.ktx">
17+
<uses-sdk android:minSdkVersion="16"/>
18+
19+
<application>
20+
</application>
21+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2021 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.appdistribution.ktx
16+
17+
import com.google.firebase.appdistribution.FirebaseAppDistribution
18+
import com.google.firebase.ktx.Firebase
19+
20+
/** Returns the [FirebaseAppDistribution] instance of the default [FirebaseApp]. */
21+
val Firebase.appDistribution: FirebaseAppDistribution
22+
get() = FirebaseAppDistribution.getInstance()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2021 Google LLC -->
3+
<!-- -->
4+
<!-- Licensed under the Apache License, Version 2.0 (the "License"); -->
5+
<!-- you may not use this file except in compliance with the License. -->
6+
<!-- You may obtain a copy of the License at -->
7+
<!-- -->
8+
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
9+
<!-- -->
10+
<!-- Unless required by applicable law or agreed to in writing, software -->
11+
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
12+
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
13+
<!-- See the License for the specific language governing permissions and -->
14+
<!-- limitations under the License. -->
15+
16+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
17+
package="com.google.firebase.appdistribution">
18+
19+
<application>
20+
</application>
21+
</manifest>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.app.distribution;
15+
package com.google.firebase.appdistribution;
1616

1717
import androidx.annotation.NonNull;
1818
import androidx.annotation.Nullable;
@@ -31,8 +31,8 @@
3131
public abstract class AppDistributionRelease {
3232

3333
@NonNull
34-
public static Builder builder() {
35-
return new com.google.firebase.app.distribution.AutoValue_AppDistributionRelease.Builder();
34+
static Builder builder() {
35+
return new com.google.firebase.appdistribution.AutoValue_AppDistributionRelease.Builder();
3636
}
3737

3838
/** The short bundle version of this build (example 1.0.0) */
@@ -53,21 +53,21 @@ public static Builder builder() {
5353

5454
/** Builder for {@link AppDistributionRelease}. */
5555
@AutoValue.Builder
56-
public abstract static class Builder {
56+
abstract static class Builder {
5757

5858
@NonNull
59-
public abstract Builder setDisplayVersion(@NonNull String value);
59+
abstract Builder setDisplayVersion(@NonNull String value);
6060

6161
@NonNull
62-
public abstract Builder setVersionCode(@NonNull long value);
62+
abstract Builder setVersionCode(@NonNull long value);
6363

6464
@NonNull
65-
public abstract Builder setReleaseNotes(@Nullable String value);
65+
abstract Builder setReleaseNotes(@Nullable String value);
6666

6767
@NonNull
68-
public abstract Builder setBinaryType(@NonNull BinaryType value);
68+
abstract Builder setBinaryType(@NonNull BinaryType value);
6969

7070
@NonNull
71-
public abstract AppDistributionRelease build();
71+
abstract AppDistributionRelease build();
7272
}
7373
}

firebase-app-distribution/src/main/java/com/google/firebase/app/distribution/BinaryType.java renamed to firebase-app-distribution-stub/src/main/java/com/google/firebase/appdistribution/BinaryType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package com.google.firebase.app.distribution;
15+
package com.google.firebase.appdistribution;
1616

1717
/** Enum of Android App Binary types, used in AppDistributionRelease */
1818
public enum BinaryType {

0 commit comments

Comments
 (0)