File tree 2 files changed +22
-33
lines changed
buildSrc/src/main/groovy/com/google/firebase/gradle/plugins
2 files changed +22
-33
lines changed Original file line number Diff line number Diff line change 20
20
import com .google .firebase .gradle .plugins .ci .device .FirebaseTestServer ;
21
21
import org .gradle .api .Plugin ;
22
22
import org .gradle .api .Project ;
23
- import org .gradle .api .tasks .bundling .Jar ;
24
23
import org .jetbrains .kotlin .gradle .tasks .KotlinCompile ;
25
24
26
25
public class FirebaseLibraryPlugin implements Plugin <Project > {
@@ -33,6 +32,28 @@ public void apply(Project project) {
33
32
34
33
LibraryExtension android = project .getExtensions ().getByType (LibraryExtension .class );
35
34
35
+ // In the case of and android library signing config only affects instrumentation test APK.
36
+ // We need it signed with default debug credentials in order for FTL to accept the APK.
37
+ android .buildTypes (
38
+ types ->
39
+ types
40
+ .getByName ("release" )
41
+ .setSigningConfig (types .getByName ("debug" ).getSigningConfig ()));
42
+
43
+ // skip debug tests in CI
44
+ // TODO(vkryachko): provide ability for teams to control this if needed
45
+ if (System .getenv ().containsKey ("FIREBASE_CI" )) {
46
+ android .setTestBuildType ("release" );
47
+ project
48
+ .getTasks ()
49
+ .all (
50
+ task -> {
51
+ if ("testDebugUnitTest" .equals (task .getName ())) {
52
+ task .setEnabled (false );
53
+ }
54
+ });
55
+ }
56
+
36
57
android .testServer (new FirebaseTestServer (project , firebaseLibrary .testLab ));
37
58
38
59
// reduce the likelihood of kotlin module files colliding.
Original file line number Diff line number Diff line change @@ -140,38 +140,6 @@ configure(subprojects) {
140
140
}
141
141
}
142
142
143
- /**
144
- * Disable "debug" build type for all subprojects.
145
- *
146
- * They are identical to "release" and are not used in either release or smoke tests. Disabling them
147
- * to reduce the number of tests we run on pre/post-submit.
148
- */
149
- configure(subprojects) {
150
- afterEvaluate { Project sub ->
151
- if (! sub. plugins. hasPlugin(' com.android.library' ) && ! sub. plugins. hasPlugin(' com.android.application' )) {
152
- return
153
- }
154
-
155
- // skip debug unit tests in CI
156
- // TODO(vkryachko): provide ability for teams to control this if needed
157
- if (System . getenv(). containsKey(" FIREBASE_CI" )) {
158
- sub. tasks. all {Task task ->
159
- if (task. name == ' testDebugUnitTest' ) {
160
- task. enabled = false
161
- }
162
- }
163
- }
164
- sub. android {
165
- testBuildType " release"
166
-
167
- buildTypes {
168
- // In the case of and android library signing config only affects instrumentation test APK.
169
- // We need it signed with default debug credentials in order for FTL to accept the APK.
170
- release. signingConfig = debug. signingConfig
171
- }
172
- }
173
- }
174
- }
175
143
176
144
/**
177
145
* Configure "Preguarding" and Desugaring for the subprojects.
You can’t perform that action at this time.
0 commit comments