message: fix: Parse current build variant from task name
  Fixes
diff: import org.apache.tools.ant.taskdefs.condition.Os
  +import java.util.regex.Matcher
  +import java.util.regex.Pattern
  +
  def config = project.hasProperty("sentry") ? project.sentry : [];
  gradle.projectsEvaluated {
  @@ -7,12 +10,10 @@ gradle.projectsEvaluated {
  android.applicationVariants.each { variant ->
  def releaseName = "${variant.getApplicationId()}-${variant.getVersionName()}";
  variant.outputs.each { output ->
  - def processTask = output.getProcessResources();
  def versionCode = output.getVersionCode();
  - releases[releaseName] = [output.getName(), releaseName, versionCode];
  + releases[variant.getName()] = [output.getName(), releaseName, versionCode];
  }
  }
  -
  // separately we then hook into the bundle task of react native to inject
  // sourcemap generation parameters. In case for whatever reason no release
  // was found for the asset folder we just bail.
  @@ -59,10 +60,26 @@ gradle.projectsEvaluated {
  // .findAll{!['class', 'active'].contains(it.key)}
  // .join('\n')
  + def currentVariant = "";
  + def pattern = Pattern.compile("bundle([A-Z][A-Za-z]+)JsAndAssets")
  + Matcher matcher = pattern.matcher(bundleTask.name)
  + if (matcher.find()) {
  + def match = matcher.group(1);
  + currentVariant = match.substring(0, 1).toLowerCase() + match.substring(1);
  + }
  +
  + def currentRelease = null;
  releases.each { key, release ->
  - def variant = release[0]
  - def releaseName = release[1]
  - def versionCodes = release[2]
  + if (key == currentVariant) {
  + currentRelease = release;
  + }
  + }
  +
  + if (currentRelease == null) return;
  +
  + def variant = currentRelease[0]
  + def releaseName = currentRelease[1]
  + def versionCodes = currentRelease[2]
  def cliTask = tasks.create(
  name: bundleTask.getName() + variant + "SentryUpload",
  @@ -140,4 +157,3 @@ gradle.projectsEvaluated {
  cliTask.dependsOn(bundleTask)
  }
  }
  -}
  