Skip to content

Commit

Permalink
Remove use of indirect obsolete api usage
Browse files Browse the repository at this point in the history
Summary: `getOutputFile` calls `getPackageApplication` which is obsolete. `getOutputFile` isn't our code, but we can work around this to get rid of the warning.

Reviewed By: sjkirby

Differential Revision: D17989008

fbshipit-source-id: 127eef28467d47ac5f284b00ebfc94dfa199f85c
  • Loading branch information
xiphirx authored and facebook-github-bot committed Oct 18, 2019
1 parent a97d05f commit e00973d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ open class PullScreenshotsTask : ScreenshotTask() {

override fun init(variant: TestVariant, extension: ScreenshotsPluginExtension) {
super.init(variant, extension)
apkPath = variant.outputs.find { it is ApkVariantOutput }!!.outputFile
val output = variant.outputs.find { it is ApkVariantOutput } as? ApkVariantOutput
?: throw IllegalArgumentException("Can't find APK output")
val packageTask = variant.packageApplicationProvider.orNull
?: throw IllegalArgumentException("Can't find package application provider")

apkPath = File(packageTask.outputDirectory, output.outputFileName)
}

@TaskAction
Expand Down

0 comments on commit e00973d

Please sign in to comment.