Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid eager initialization of bugsnag tasks #266

Merged
merged 23 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1e51e5b
Remove unused imports
ZacSweers Aug 11, 2020
5c420ce
Clean up createMappingFileProvider a bit
ZacSweers Aug 11, 2020
f1f42df
Inline findSharedObjectMappingFiles with idiomatic file lookup
ZacSweers Aug 11, 2020
e447415
Use lazy wiring for remaining plugin tasks and make assemble depend o…
ZacSweers Aug 11, 2020
6f8162e
Delete now-unused SharedObjectMappingFileProvider.kt
ZacSweers Aug 11, 2020
4f9c96b
Use more idiomatic sink hashing
ZacSweers Aug 11, 2020
40caf02
Clean up task registration
ZacSweers Aug 11, 2020
c8455d7
Use uploadNdkMappings
ZacSweers Aug 12, 2020
f68533d
Fix searchDirectories configuration
ZacSweers Aug 12, 2020
d096ce6
WIP plugin fixes
ZacSweers Aug 12, 2020
e6574c6
Fix inputfiles
ZacSweers Aug 12, 2020
ec5e95c
Update AGP versioning, match
ZacSweers Aug 13, 2020
88f1801
Clean up task registration
ZacSweers Aug 13, 2020
5c5add0
Detekt cleanups
ZacSweers Aug 13, 2020
00ca5ab
fix: use InputFiles rather than InputFile for mappingFile input
fractalwrench Aug 14, 2020
2b47be5
test: update E2E scenarios for request ordering change
fractalwrench Aug 14, 2020
933bd40
fix: add backwards compatible proguard upload task
fractalwrench Aug 14, 2020
7d7b1da
test: fix ndk AGP 4+ scenarios
fractalwrench Aug 14, 2020
cba71b7
test: fix ordering for NDK AGP4+
fractalwrench Aug 14, 2020
5056291
fix: workaround for AGP 3.5.0 tasks running before package
fractalwrench Aug 14, 2020
ec13cd6
fix: use ndk enabled method
fractalwrench Aug 17, 2020
246b95c
test: skip flaky tests on AGP 3.6
fractalwrench Aug 17, 2020
ba980b1
Update features/support/env.rb
fractalwrench Aug 17, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:4.1.0-beta04" // compile against 4.1.0-beta04, but maintain compat to 3.4.0
classpath "com.android.tools.build:gradle:4.1.0-rc01" // compile against 4.1.0-rc01, but maintain compat to 3.4.0
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.9.1"
}
Expand Down Expand Up @@ -58,7 +58,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
// Build dependencies
dependencies {
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.3"
compileOnly "com.android.tools.build:gradle:4.1.0-beta04"
compileOnly "com.android.tools.build:gradle:4.1.0-rc01"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"

// For uploading proguard/ndk files
Expand All @@ -73,7 +73,7 @@ dependencies {
// For multiple I/O use cases
implementation "com.squareup.okio:okio:2.7.0"

testImplementation "com.android.tools.build:gradle:4.0.0"
testImplementation "com.android.tools.build:gradle:4.1.0-rc01"
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.28.2"
testImplementation "com.squareup.okhttp3:mockwebserver:4.8.0"
Expand Down
75 changes: 38 additions & 37 deletions features/abi_apk_splits.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,66 @@ Scenario: ABI Splits project builds successfully
When I build "abi_splits" using the "standard" bugsnag config
Then I should receive 16 requests

And the request 15 is valid for the Build API
And the payload field "appVersionCode" equals "2" for request 15
And the request 0 is valid for the Build API
And the payload field "appVersionCode" equals "2" for request 0

And the request 14 is valid for the Build API
And the payload field "appVersionCode" equals "3" for request 14
And the request 1 is valid for the Build API
And the payload field "appVersionCode" equals "3" for request 1

And the request 13 is valid for the Build API
And the payload field "appVersionCode" equals "4" for request 13
And the request 2 is valid for the Build API
And the payload field "appVersionCode" equals "4" for request 2

And the request 12 is valid for the Build API
And the payload field "appVersionCode" equals "5" for request 12
And the request 3 is valid for the Build API
And the payload field "appVersionCode" equals "5" for request 3

And the request 11 is valid for the Build API
And the payload field "appVersionCode" equals "6" for request 11
And the request 4 is valid for the Build API
And the payload field "appVersionCode" equals "6" for request 4

And the request 10 is valid for the Build API
And the payload field "appVersionCode" equals "1" for request 10
And the request 5 is valid for the Build API
And the payload field "appVersionCode" equals "1" for request 5

And the request 9 is valid for the Build API
And the payload field "appVersionCode" equals "7" for request 9
And the request 6 is valid for the Build API
And the payload field "appVersionCode" equals "7" for request 6

And the request 8 is valid for the Build API
And the payload field "appVersionCode" equals "8" for request 8
And the payload field "appVersion" equals "1.0" for request 8
And the payload field "apiKey" equals "TEST_API_KEY" for request 8
And the request 7 is valid for the Build API
And the payload field "appVersionCode" equals "8" for request 7
And the payload field "appVersion" equals "1.0" for request 7
And the payload field "apiKey" equals "TEST_API_KEY" for request 7

And the request 7 is valid for the Android Mapping API
And the field "versionCode" for multipart request 7 equals "2"
And the request 8 is valid for the Android Mapping API
And the field "versionCode" for multipart request 8 equals "2"

And the request 6 is valid for the Android Mapping API
And the field "versionCode" for multipart request 6 equals "3"
And the request 9 is valid for the Android Mapping API
And the field "versionCode" for multipart request 9 equals "3"

And the request 5 is valid for the Android Mapping API
And the field "versionCode" for multipart request 5 equals "4"
And the request 10 is valid for the Android Mapping API
And the field "versionCode" for multipart request 10 equals "4"

And the request 4 is valid for the Android Mapping API
And the field "versionCode" for multipart request 4 equals "5"
And the request 11 is valid for the Android Mapping API
And the field "versionCode" for multipart request 11 equals "5"

And the request 3 is valid for the Android Mapping API
And the field "versionCode" for multipart request 3 equals "6"
And the request 12 is valid for the Android Mapping API
And the field "versionCode" for multipart request 12 equals "6"

And the request 2 is valid for the Android Mapping API
And the field "versionCode" for multipart request 2 equals "1"
And the request 13 is valid for the Android Mapping API
And the field "versionCode" for multipart request 13 equals "1"

And the request 1 is valid for the Android Mapping API
And the field "versionCode" for multipart request 1 equals "7"
And the request 14 is valid for the Android Mapping API
And the field "versionCode" for multipart request 14 equals "7"

And the request 0 is valid for the Android Mapping API
And the field "versionCode" for multipart request 0 equals "8"
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY"
And the field "versionName" for multipart request 0 equals "1.0"
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example"
And the request 15 is valid for the Android Mapping API
And the field "versionCode" for multipart request 15 equals "8"
And the field "apiKey" for multipart request 15 equals "TEST_API_KEY"
And the field "versionName" for multipart request 15 equals "1.0"
And the field "appId" for multipart request 15 equals "com.bugsnag.android.example"

@skip_agp4_1_or_higher
Scenario: ABI Splits automatic upload disabled
When I build "abi_splits" using the "all_disabled" bugsnag config
Then I should receive no requests

@skip_agp4_1_or_higher
@skip_agp3_5
Scenario: ABI Splits manual upload of build API
When I build the "Armeabi-release" variantOutput for "abi_splits" using the "all_disabled" bugsnag config
Then I should receive 1 request
Expand Down
6 changes: 3 additions & 3 deletions features/apk_splits_same_version.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Feature: Plugin integrated in project with APK splits
Scenario: APK splits avoid uploading duplicate requests for same version information
When I build "apk_splits" using the "standard" bugsnag config
Then I should receive 2 requests
And the request 0 is valid for the Android Mapping API
And the payload field "buildUUID" equals "same-build-uuid" for request 0
And the request 1 is valid for the Build API
And the request 1 is valid for the Android Mapping API
And the payload field "buildUUID" equals "same-build-uuid" for request 1
And the request 0 is valid for the Build API
74 changes: 38 additions & 36 deletions features/app_bundle.feature
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
Feature: Generating Android app bundles

@skip_agp3_5
Scenario: Single-module default app bundles successfully
When I bundle "default_app" using the "standard" bugsnag config
Then I should receive 2 requests

And the request 1 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 1
And the payload field "apiKey" equals "TEST_API_KEY" for request 1
And the payload field "builderName" is not null for request 1
And the payload field "buildTool" equals "gradle-android" for request 1
And the payload field "appVersionCode" equals "1" for request 1
And the payload field "sourceControl.provider" equals "github" for request 1
And the payload field "sourceControl.repository" equals "https://github.com/bugsnag/bugsnag-android-gradle-plugin.git" for request 1
And the payload field "sourceControl.revision" is not null for request 1
And the request 0 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 0
And the payload field "apiKey" equals "TEST_API_KEY" for request 0
And the payload field "builderName" is not null for request 0
And the payload field "buildTool" equals "gradle-android" for request 0
And the payload field "appVersionCode" equals "1" for request 0
And the payload field "sourceControl.provider" equals "github" for request 0
And the payload field "sourceControl.repository" equals "https://github.com/bugsnag/bugsnag-android-gradle-plugin.git" for request 0
And the payload field "sourceControl.revision" is not null for request 0

And the payload field "metadata.os_arch" is not null for request 1
And the payload field "metadata.os_name" is not null for request 1
And the payload field "metadata.os_version" is not null for request 1
And the payload field "metadata.java_version" is not null for request 1
And the payload field "metadata.gradle_version" is not null for request 1
And the payload field "metadata.git_version" is not null for request 1
And the payload field "metadata.os_arch" is not null for request 0
And the payload field "metadata.os_name" is not null for request 0
And the payload field "metadata.os_version" is not null for request 0
And the payload field "metadata.java_version" is not null for request 0
And the payload field "metadata.gradle_version" is not null for request 0
And the payload field "metadata.git_version" is not null for request 0

And the request 0 is valid for the Android Mapping API
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 0 equals "1"
And the field "versionName" for multipart request 0 equals "1.0"
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example"
And the field "overwrite" for multipart request 0 is null
And the request 1 is valid for the Android Mapping API
And the field "apiKey" for multipart request 1 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 1 equals "1"
And the field "versionName" for multipart request 1 equals "1.0"
And the field "appId" for multipart request 1 equals "com.bugsnag.android.example"
And the field "overwrite" for multipart request 1 is null

@skip_agp3_5
Scenario: Bundling multiple flavors automatically
When I bundle "flavors" using the "standard" bugsnag config
Then I should receive 4 requests

And the request 3 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 3
And the payload field "apiKey" equals "TEST_API_KEY" for request 3
And the payload field "appVersionCode" equals "1" for request 3
And the request 0 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 0
And the payload field "apiKey" equals "TEST_API_KEY" for request 0
And the payload field "appVersionCode" equals "1" for request 0

And the request 2 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 2
Expand All @@ -48,23 +50,23 @@ Scenario: Bundling multiple flavors automatically
And the field "versionName" for multipart request 1 equals "1.0"
And the field "appId" for multipart request 1 equals "com.bugsnag.android.example.bar"

And the request 0 is valid for the Android Mapping API
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 0 equals "1"
And the field "versionName" for multipart request 0 equals "1.0"
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example.foo"
And the request 3 is valid for the Android Mapping API
And the field "apiKey" for multipart request 3 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 3 equals "1"
And the field "versionName" for multipart request 3 equals "1.0"
And the field "appId" for multipart request 3 equals "com.bugsnag.android.example.foo"

Scenario: Bundling single flavor
When I bundle the "Foo" variantOutput for "flavors" using the "standard" bugsnag config
Then I should receive 2 requests

And the request 1 is valid for the Build API
And the request 0 is valid for the Build API

And the request 0 is valid for the Android Mapping API
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 0 equals "1"
And the field "versionName" for multipart request 0 equals "1.0"
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example.foo"
And the request 1 is valid for the Android Mapping API
And the field "apiKey" for multipart request 1 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 1 equals "1"
And the field "versionName" for multipart request 1 equals "1.0"
And the field "appId" for multipart request 1 equals "com.bugsnag.android.example.foo"

Scenario: Auto upload disabled
When I bundle "default_app" using the "all_disabled" bugsnag config
Expand Down
42 changes: 21 additions & 21 deletions features/default_app.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ Scenario: Single-module default app builds successfully
When I build "default_app" using the "standard" bugsnag config
Then I should receive 2 requests

And the request 1 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 1
And the payload field "apiKey" equals "TEST_API_KEY" for request 1
And the payload field "builderName" is not null for request 1
And the payload field "buildTool" equals "gradle-android" for request 1
And the payload field "appVersionCode" equals "1" for request 1
And the payload field "sourceControl.provider" equals "github" for request 1
And the payload field "sourceControl.repository" equals "https://github.com/bugsnag/bugsnag-android-gradle-plugin.git" for request 1
And the payload field "sourceControl.revision" is not null for request 1
And the request 0 is valid for the Build API
And the payload field "appVersion" equals "1.0" for request 0
And the payload field "apiKey" equals "TEST_API_KEY" for request 0
And the payload field "builderName" is not null for request 0
And the payload field "buildTool" equals "gradle-android" for request 0
And the payload field "appVersionCode" equals "1" for request 0
And the payload field "sourceControl.provider" equals "github" for request 0
And the payload field "sourceControl.repository" equals "https://github.com/bugsnag/bugsnag-android-gradle-plugin.git" for request 0
And the payload field "sourceControl.revision" is not null for request 0

And the payload field "metadata.os_arch" is not null for request 1
And the payload field "metadata.os_name" is not null for request 1
And the payload field "metadata.os_version" is not null for request 1
And the payload field "metadata.java_version" is not null for request 1
And the payload field "metadata.gradle_version" is not null for request 1
And the payload field "metadata.git_version" is not null for request 1
And the payload field "metadata.os_arch" is not null for request 0
And the payload field "metadata.os_name" is not null for request 0
And the payload field "metadata.os_version" is not null for request 0
And the payload field "metadata.java_version" is not null for request 0
And the payload field "metadata.gradle_version" is not null for request 0
And the payload field "metadata.git_version" is not null for request 0

And the request 0 is valid for the Android Mapping API
And the field "apiKey" for multipart request 0 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 0 equals "1"
And the field "versionName" for multipart request 0 equals "1.0"
And the field "appId" for multipart request 0 equals "com.bugsnag.android.example"
And the field "overwrite" for multipart request 0 is null
And the request 1 is valid for the Android Mapping API
And the field "apiKey" for multipart request 1 equals "TEST_API_KEY"
And the field "versionCode" for multipart request 1 equals "1"
And the field "versionName" for multipart request 1 equals "1.0"
And the field "appId" for multipart request 1 equals "com.bugsnag.android.example"
And the field "overwrite" for multipart request 1 is null
Loading