From d6831019106d49fca1b82a98c6357727fff2511d Mon Sep 17 00:00:00 2001 From: Vladimir Kryachko Date: Mon, 6 May 2019 16:50:49 -0400 Subject: [PATCH] Initial refactor of the plugin structure. (#406) * Initial refactor of the plugin structure. The short-term/immediate goal is to introduce a place for projects to indicate whether javadoc needs to be generated for them, it's done here via `firebaseLibrary.publishJavadoc`. The long-term vision is to move all build and release logic be controlled via the 'firebase-library' plugin instead of it being injected into individual projects from the root-project. * Fixes * Update. * Fix formatting and license --- buildSrc/build.gradle | 4 ++ .../plugins/FirebaseLibraryExtension.java | 35 ++++++++++++ .../gradle/plugins/FirebaseLibraryPlugin.java | 54 +++++++++++++++++++ .../ci/device/FirebaseTestLabExtension.groovy | 19 ------- .../ci/device/FirebaseTestLabExtension.java | 53 ++++++++++++++++++ .../ci/device/FirebaseTestLabPlugin.groovy | 26 --------- .../ci/device/FirebaseTestLabPlugin.java | 40 ++++++++++++++ .../ci/device/FirebaseTestServer.groovy | 2 +- .../firebase-common-ktx.gradle | 6 ++- firebase-common/firebase-common.gradle | 12 +++-- .../firebase-database-collection.gradle | 8 ++- firebase-database/firebase-database.gradle | 10 +++- .../firebase-datatransport.gradle | 8 ++- firebase-datatransport/gradle.properties | 3 +- .../firebase-firestore-ktx.gradle | 6 ++- firebase-firestore/firebase-firestore.gradle | 12 +++-- firebase-functions/firebase-functions.gradle | 10 +++- .../firebase-inappmessaging-display.gradle | 9 +++- firebase-storage/firebase-storage.gradle | 11 +++- .../protolite-well-known-types.gradle | 9 ++-- transport/transport-api/gradle.properties | 3 +- transport/transport-api/transport-api.gradle | 6 ++- .../transport-backend-cct/gradle.properties | 3 +- .../transport-backend-cct.gradle | 8 ++- transport/transport-runtime/gradle.properties | 3 +- .../transport-runtime.gradle | 38 +++++++------ 26 files changed, 302 insertions(+), 96 deletions(-) create mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryExtension.java create mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java delete mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.groovy create mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.java delete mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.groovy create mode 100644 buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.java diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 37d064dec30..ebf569337ce 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -62,6 +62,10 @@ gradlePlugin { id = 'PublishingPlugin' implementationClass = 'com.google.firebase.gradle.plugins.publish.PublishingPlugin' } + firebaseLibraryPlugin { + id = 'firebase-library' + implementationClass = 'com.google.firebase.gradle.plugins.FirebaseLibraryPlugin' + } } } diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryExtension.java b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryExtension.java new file mode 100644 index 00000000000..8c92c23178a --- /dev/null +++ b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryExtension.java @@ -0,0 +1,35 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.firebase.gradle.plugins; + +import com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabExtension; +import javax.inject.Inject; +import org.gradle.api.Action; +import org.gradle.api.model.ObjectFactory; + +public class FirebaseLibraryExtension { + public boolean publishJavadoc = true; + public boolean publishSources; + public final FirebaseTestLabExtension testLab; + + @Inject + public FirebaseLibraryExtension(ObjectFactory objectFactory) { + this.testLab = new FirebaseTestLabExtension(objectFactory); + } + + void testLab(Action action) { + action.execute(testLab); + } +} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java new file mode 100644 index 00000000000..220de864985 --- /dev/null +++ b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/FirebaseLibraryPlugin.java @@ -0,0 +1,54 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.firebase.gradle.plugins; + +import com.android.build.gradle.LibraryExtension; +import com.google.common.collect.ImmutableMap; +import com.google.firebase.gradle.plugins.ci.device.FirebaseTestServer; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.tasks.bundling.Jar; + +public class FirebaseLibraryPlugin implements Plugin { + @Override + public void apply(Project project) { + project.apply(ImmutableMap.of("plugin", "com.android.library")); + + FirebaseLibraryExtension firebaseLibrary = + project + .getExtensions() + .create("firebaseLibrary", FirebaseLibraryExtension.class, project.getObjects()); + + LibraryExtension android = project.getExtensions().getByType(LibraryExtension.class); + + android.testServer(new FirebaseTestServer(project, firebaseLibrary.testLab)); + + // TODO(vkryachko): include sources in firebasePublish + project.afterEvaluate( + p -> { + if (firebaseLibrary.publishSources) { + + p.getTasks() + .create( + "sourcesJar", + Jar.class, + jar -> { + jar.from(android.getSourceSets().getByName("main").getJava().getSrcDirs()); + jar.setClassifier("sources"); + }); + } + }); + } +} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.groovy b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.groovy deleted file mode 100644 index 62f61f1e675..00000000000 --- a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.groovy +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.firebase.gradle.plugins.ci.device; - -class FirebaseTestLabExtension { - List devices = ['model=Pixel2,version=27,locale=en,orientation=portrait'] -} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.java b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.java new file mode 100644 index 00000000000..b4da30322f5 --- /dev/null +++ b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabExtension.java @@ -0,0 +1,53 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.firebase.gradle.plugins.ci.device; + + +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.SetProperty; + +import java.util.Collections; +import java.util.Set; + +import javax.inject.Inject; + +public class FirebaseTestLabExtension { + private final SetProperty devices; + private boolean enabled; + + @Inject + public FirebaseTestLabExtension(ObjectFactory objectFactory) { + devices = objectFactory.setProperty(String.class); + } + + public void setEnabled(boolean value) { + enabled = value; + } + + public boolean getEnabled() { + return enabled; + } + + public void device(String device) { + devices.add(device); + } + + Set getDevices() { + if( devices.get().isEmpty()) { + return Collections.singleton("model=Pixel2,version=27,locale=en,orientation=portrait"); + } + return devices.get(); + } +} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.groovy b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.groovy deleted file mode 100644 index 937f4c2bda8..00000000000 --- a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.groovy +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.firebase.gradle.plugins.ci.device - -import org.gradle.api.Plugin -import org.gradle.api.Project - -class FirebaseTestLabPlugin implements Plugin{ - @Override - void apply(Project project) { - def extension = project.extensions.create('firebaseTestLab', FirebaseTestLabExtension.class) - project.android.testServer(new FirebaseTestServer(project, extension)) - } -} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.java b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.java new file mode 100644 index 00000000000..713d624d95f --- /dev/null +++ b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestLabPlugin.java @@ -0,0 +1,40 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.firebase.gradle.plugins.ci.device; + +import com.android.build.gradle.BaseExtension; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; + +/** + * Firebase Test Lab Integration plugin. + * + * @deprecated For library projects use 'firebase-library' plugin instead. App projects should still + * use this plugin. + */ +@Deprecated +public class FirebaseTestLabPlugin implements Plugin { + @Override + public void apply(Project project) { + FirebaseTestLabExtension extension = + project + .getExtensions() + .create("firebaseTestLab", FirebaseTestLabExtension.class, project.getObjects()); + extension.setEnabled(true); + BaseExtension android = (BaseExtension) project.getExtensions().getByName("android"); + android.testServer(new FirebaseTestServer(project, extension)); + } +} diff --git a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.groovy b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.groovy index 100c296221f..9b744a1392b 100644 --- a/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.groovy +++ b/buildSrc/src/main/groovy/com/google/firebase/gradle/plugins/ci/device/FirebaseTestServer.groovy @@ -60,7 +60,7 @@ class FirebaseTestServer extends TestServer { @Override boolean isConfigured() { - return true + return extension.enabled } private List getResultUploadArgs() { diff --git a/firebase-common-ktx/firebase-common-ktx.gradle b/firebase-common-ktx/firebase-common-ktx.gradle index 5b5051b1f35..327435e1d21 100644 --- a/firebase-common-ktx/firebase-common-ktx.gradle +++ b/firebase-common-ktx/firebase-common-ktx.gradle @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +plugins { + id 'firebase-library' + id 'kotlin-android' +} android { compileSdkVersion project.targetSdkVersion diff --git a/firebase-common/firebase-common.gradle b/firebase-common/firebase-common.gradle index 2e427a667d2..e1f42e03904 100644 --- a/firebase-common/firebase-common.gradle +++ b/firebase-common/firebase-common.gradle @@ -12,8 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' +} + +firebaseLibrary { + testLab.enabled = true + publishJavadoc = true +} android { adbOptions { @@ -80,4 +86,4 @@ dependencies { } annotationProcessor 'com.google.auto.value:auto-value:1.6' -} +} \ No newline at end of file diff --git a/firebase-database-collection/firebase-database-collection.gradle b/firebase-database-collection/firebase-database-collection.gradle index 1ebe738445f..261a547da58 100644 --- a/firebase-database-collection/firebase-database-collection.gradle +++ b/firebase-database-collection/firebase-database-collection.gradle @@ -12,7 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' +plugins { + id 'firebase-library' +} + +firebaseLibrary { + publishJavadoc = true +} android { compileSdkVersion project.targetSdkVersion diff --git a/firebase-database/firebase-database.gradle b/firebase-database/firebase-database.gradle index 50ece209d2c..d38749720ae 100644 --- a/firebase-database/firebase-database.gradle +++ b/firebase-database/firebase-database.gradle @@ -12,8 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' +} + +firebaseLibrary { + testLab.enabled = true + publishJavadoc = true +} android { adbOptions { diff --git a/firebase-datatransport/firebase-datatransport.gradle b/firebase-datatransport/firebase-datatransport.gradle index 551a2b24caa..45401d8b584 100644 --- a/firebase-datatransport/firebase-datatransport.gradle +++ b/firebase-datatransport/firebase-datatransport.gradle @@ -12,7 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' +plugins { + id 'firebase-library' +} + +firebaseLibrary.publishJavadoc = false android { adbOptions { @@ -48,4 +52,4 @@ dependencies { testImplementation "org.robolectric:robolectric:$robolectricVersion" testImplementation 'junit:junit:4.12' testImplementation "com.google.truth:truth:$googleTruthVersion" -} \ No newline at end of file +} diff --git a/firebase-datatransport/gradle.properties b/firebase-datatransport/gradle.properties index 420bc8c4cb0..e1eda323ddf 100644 --- a/firebase-datatransport/gradle.properties +++ b/firebase-datatransport/gradle.properties @@ -1,2 +1,3 @@ version=16.0.0 -android.enableUnitTestBinaryResources=true \ No newline at end of file +android.enableUnitTestBinaryResources=true +firebaseJavadoc=false \ No newline at end of file diff --git a/firebase-firestore-ktx/firebase-firestore-ktx.gradle b/firebase-firestore-ktx/firebase-firestore-ktx.gradle index b363311767f..b166661ba7a 100644 --- a/firebase-firestore-ktx/firebase-firestore-ktx.gradle +++ b/firebase-firestore-ktx/firebase-firestore-ktx.gradle @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +plugins { + id 'firebase-library' + id 'kotlin-android' +} android { compileSdkVersion project.targetSdkVersion diff --git a/firebase-firestore/firebase-firestore.gradle b/firebase-firestore/firebase-firestore.gradle index fe780365d20..8d50b5ed753 100644 --- a/firebase-firestore/firebase-firestore.gradle +++ b/firebase-firestore/firebase-firestore.gradle @@ -12,9 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: 'com.google.protobuf' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' + id 'com.google.protobuf' +} + +firebaseLibrary { + testLab.enabled = true + publishJavadoc = true +} protobuf { // Configure the protoc executable diff --git a/firebase-functions/firebase-functions.gradle b/firebase-functions/firebase-functions.gradle index 6adfef3f07e..331124e4087 100644 --- a/firebase-functions/firebase-functions.gradle +++ b/firebase-functions/firebase-functions.gradle @@ -12,8 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' +} + +firebaseLibrary { + testLab.enabled = true + publishJavadoc = true +} android { adbOptions { diff --git a/firebase-inappmessaging-display/firebase-inappmessaging-display.gradle b/firebase-inappmessaging-display/firebase-inappmessaging-display.gradle index 5b3a0779a2f..14ab1935c91 100644 --- a/firebase-inappmessaging-display/firebase-inappmessaging-display.gradle +++ b/firebase-inappmessaging-display/firebase-inappmessaging-display.gradle @@ -12,8 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: "com.android.library" -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' +} + +firebaseLibrary { + testLab.enabled = true +} android { compileSdkVersion project.targetSdkVersion diff --git a/firebase-storage/firebase-storage.gradle b/firebase-storage/firebase-storage.gradle index 576ab4ee8fe..3c676a1f164 100644 --- a/firebase-storage/firebase-storage.gradle +++ b/firebase-storage/firebase-storage.gradle @@ -12,8 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' + id 'com.google.protobuf' +} + +firebaseLibrary { + testLab.enabled = true + publishJavadoc = true +} android { adbOptions { diff --git a/protolite-well-known-types/protolite-well-known-types.gradle b/protolite-well-known-types/protolite-well-known-types.gradle index fd54bd8bf20..3de9d754a2a 100644 --- a/protolite-well-known-types/protolite-well-known-types.gradle +++ b/protolite-well-known-types/protolite-well-known-types.gradle @@ -12,13 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: 'com.google.protobuf' - -ext { - firebaseSkipPreguard = true +plugins { + id 'firebase-library' + id 'com.google.protobuf' } + protobuf { protoc { artifact = 'com.google.protobuf:protoc:3.4.0' diff --git a/transport/transport-api/gradle.properties b/transport/transport-api/gradle.properties index acbca1349d9..b97bf5c2437 100644 --- a/transport/transport-api/gradle.properties +++ b/transport/transport-api/gradle.properties @@ -12,4 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=0.1.0 \ No newline at end of file +version=0.1.0 +firebaseJavadoc=false \ No newline at end of file diff --git a/transport/transport-api/transport-api.gradle b/transport/transport-api/transport-api.gradle index 5d43040b226..11dec7bd3c3 100644 --- a/transport/transport-api/transport-api.gradle +++ b/transport/transport-api/transport-api.gradle @@ -12,7 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' +plugins { + id 'firebase-library' +} + +firebaseLibrary.publishJavadoc = false android { compileSdkVersion 28 diff --git a/transport/transport-backend-cct/gradle.properties b/transport/transport-backend-cct/gradle.properties index b4387e3ea75..aad25bc4cfe 100644 --- a/transport/transport-backend-cct/gradle.properties +++ b/transport/transport-backend-cct/gradle.properties @@ -13,4 +13,5 @@ # limitations under the License. version=0.1.0 -firebaseSkipPreguard=false \ No newline at end of file +firebaseSkipPreguard=false +firebaseJavadoc=false \ No newline at end of file diff --git a/transport/transport-backend-cct/transport-backend-cct.gradle b/transport/transport-backend-cct/transport-backend-cct.gradle index 1a752363677..8ec86d99c95 100644 --- a/transport/transport-backend-cct/transport-backend-cct.gradle +++ b/transport/transport-backend-cct/transport-backend-cct.gradle @@ -12,8 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: 'com.google.protobuf' +plugins { + id 'firebase-library' + id 'com.google.protobuf' +} + +firebaseLibrary.publishJavadoc = false protobuf { // Configure the protoc executable diff --git a/transport/transport-runtime/gradle.properties b/transport/transport-runtime/gradle.properties index a938a295054..acd1aae2821 100644 --- a/transport/transport-runtime/gradle.properties +++ b/transport/transport-runtime/gradle.properties @@ -13,4 +13,5 @@ # limitations under the License. version=0.1.0 -android.enableUnitTestBinaryResources=true \ No newline at end of file +android.enableUnitTestBinaryResources=true +firebaseJavadoc=false \ No newline at end of file diff --git a/transport/transport-runtime/transport-runtime.gradle b/transport/transport-runtime/transport-runtime.gradle index 10b08b26ec2..9898ca12b39 100644 --- a/transport/transport-runtime/transport-runtime.gradle +++ b/transport/transport-runtime/transport-runtime.gradle @@ -12,8 +12,27 @@ // See the License for the specific language governing permissions and // limitations under the License. -apply plugin: 'com.android.library' -apply plugin: com.google.firebase.gradle.plugins.ci.device.FirebaseTestLabPlugin +plugins { + id 'firebase-library' +} + +firebaseLibrary { + publishJavadoc = false + testLab { + enabled = true + + device 'model=walleye,version=28' // Pixel2 + device 'model=walleye,version=27' // Pixel2 + device 'model=victara,version=19' // Moto X + device 'model=Nexus4,version=22' + device 'model=Nexus7,version=21' + device 'model=Nexus4,version=19' + device 'model=starqlteue,version=26' // Galaxy S9 + device 'model=m0,version=18' // Galaxy S3 + device 'model=hero2lte,version=23' // Galaxy S7 + device 'model=g3,version=19' // LG G3 + } +} android { compileSdkVersion 28 @@ -36,21 +55,6 @@ android { testOptions.unitTests.includeAndroidResources = true } -firebaseTestLab { - devices = [ - 'model=walleye,version=28', // Pixel2 - 'model=walleye,version=27', // Pixel2 - 'model=victara,version=19', // Moto X - 'model=Nexus4,version=22', - 'model=Nexus7,version=21', - 'model=Nexus4,version=19', - 'model=starqlteue,version=26', // Galaxy S9 - 'model=m0,version=18', // Galaxy S3 - 'model=hero2lte,version=23', // Galaxy S7 - 'model=g3,version=19', // LG G3 - ] -} - dependencies { implementation project(':transport:transport-api') implementation 'com.google.dagger:dagger:2.22'