title: variantOutput.getPackageApplication() is obsolete
body: <p>with Gradle <code>4.10.1</code> and the Android Gradle plugin updated to <code>3.3.0</code>, I get the following warning:</p>
  
  <blockquote>
    <p>WARNING: API '<code>variantOutput.getPackageApplication()</code>' is obsolete and has been replaced with '<code>variant.getPackageApplicationProvider()</code>'.</p>
  </blockquote>
  
  <p>the line, with the surrounding context (which is assigning output file-names by build variant): </p>
  
  <pre><code>applicationVariants.all { variant -&gt;
      variant.outputs.all { output -&gt;
  
          if (variant.getBuildType().getName() in rootProject.archiveBuildTypes) {
  
              def buildType = variant.getBuildType().getName()
              if (variant.versionName != null) {
  
                  def baseName = output.baseName.toLowerCase()
                  String fileName = "${rootProject.name}_${variant.versionName}-${baseName}.apk"
  
                  // this is the line:
                  outputFileName = new File(output.outputFile.parent, fileName).getName()
              }
          }
      }
  }
  </code></pre>
  
  <p>the <a href="https://docs.gradle.org/current/userguide/task_configuration_avoidance.html" rel="noreferrer">migration guide</a> isn't too helpful; while the <code>variant.outputs.all</code> might be at fault - just have no clue with what to replace that - and the migration guide refers to tasks and not to build variants. when disabling <code>File → Settings → Experimental → Gradle → Only sync the active variant</code>, I get even more deprecation warnings (the point is, that none of these methods are being called directly):</p>
  
  <pre><code>WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
  WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
  WARNING: API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
  WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.
  WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.
  WARNING: API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
  WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
  WARNING: API 'variantOutput.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'.
  </code></pre>
  
  <p>Q: how can these deprecation warnings be avoided by migration to the new API?</p>