message: Add functionality for flavor aware sentry properties in gradle
diff: @@ -24,12 +24,6 @@ gradle.projectsEvaluated {
  def bundleOutput = null;
  def sourcemapOutput = null;
  def reactRoot = props.get("workingDir");
  - def propertiesFile = "$reactRoot/android/sentry.properties";
  - Properties sentryProps = new Properties();
  - try {
  - sentryProps.load(new FileInputStream(propertiesFile));
  - } catch (FileNotFoundException e) {}
  - def cliExecutable = sentryProps.get("cli.executable", "$reactRoot/node_modules/sentry-cli-binary/bin/sentry-cli");
  cmdArgs.eachWithIndex{ String arg, int i ->
  if (arg == "--bundle-output") {
  @@ -50,12 +44,29 @@ gradle.projectsEvaluated {
  bundleTask.setProperty("commandLine", cmd);
  bundleTask.setProperty("args", cmdArgs);
  + if (project.hasProperty("flavoraware")) {
  + println "********************************"
  + println "*Flavor aware sentry properties*"
  + println "********************************"
  + }
  +
  releases.each { variant, releaseName, versionCodes ->
  def cliTask = tasks.create(
  name: bundleTask.getName() + variant + "SentryUpload",
  type: Exec) {
  description = "upload debug symbols to sentry"
  + def propertiesFile = "$reactRoot/android/sentry.properties";
  + if (project.hasProperty("flavoraware")) {
  + propertiesFile = "$reactRoot/android/sentry-$variant"+".properties"
  + println "For $variant using: $propertiesFile"
  + }
  + Properties sentryProps = new Properties();
  + try {
  + sentryProps.load(new FileInputStream(propertiesFile));
  + } catch (FileNotFoundException e) {}
  + def cliExecutable = sentryProps.get("cli.executable", "$reactRoot/node_modules/sentry-cli-binary/bin/sentry-cli");
  +
  workingDir reactRoot
  environment("SENTRY_PROPERTIES", propertiesFile)
  