diff --git a/.gitignore b/.gitignore index 1d8b1e78a..194149863 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ captures/ .idea/modules.xml # Comment next line if keeping position of elements in Navigation Editor is relevant for you .idea/navEditor.xml +.idea/jarRepositories.xml # Keystore files # Uncomment the following lines if you do not want to check your keystore files in. diff --git a/build.gradle b/build.gradle index 1940d3bb2..78d5bf00a 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ compileGroovy { dependencies { compileOnly gradleApi() compileOnly localGroovy() - compileOnly 'com.android.tools.build:gradle:3.6.2' + compileOnly 'com.android.tools.build:gradle:4.0.0' } publishing { diff --git a/download-sentry-cli.sh b/download-sentry-cli.sh index 47fd6d1bb..8e4bf2d93 100755 --- a/download-sentry-cli.sh +++ b/download-sentry-cli.sh @@ -1,7 +1,7 @@ #!/bin/bash cd $(dirname "$0") REPO=getsentry/sentry-cli -VERSION=1.52.1 +VERSION=1.54.0 PLATFORMS="Darwin-x86_64 Linux-i686 Linux-x86_64 Windows-i686" rm -f src/main/resources/bin/sentry-cli-* diff --git a/gradle.properties b/gradle.properties index f1538a415..a05fc5784 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,6 @@ version = 1.7.35-SNAPSHOT # disable daemon mode, required by uploadArchives org.gradle.daemon=false + +# for debugging +# org.gradle.logging.level=info \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2..490fda857 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 52d8b2319..7796d4df3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Apr 10 10:46:21 CEST 2020 +#Wed Jun 10 14:11:32 CEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy b/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy index d0301bf3d..72ac30ca3 100644 --- a/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy +++ b/src/main/groovy/io/sentry/android/gradle/SentryPlugin.groovy @@ -219,8 +219,8 @@ class SentryPlugin implements Plugin { project.android.applicationVariants.all { ApplicationVariant variant -> variant.outputs.each { variantOutput -> - def manifestPath = extension.manifestPath - if (manifestPath == null) { + def manifestFile = null + if (extension.manifestPath == null) { def dir = findAndroidManifestFileDir(project, variantOutput) if (dir != null) { project.logger.info("manifestDir: ${dir.path}") @@ -228,11 +228,11 @@ class SentryPlugin implements Plugin { project.logger.info("manifestDir is null") } - manifestPath = new File(new File(dir, variantOutput.dirName), "AndroidManifest.xml") - project.logger.info("manifestPath: ${manifestPath}") + manifestFile = new File(new File(dir, variantOutput.dirName), "AndroidManifest.xml") } else { - project.logger.info("manifestPath: ${manifestPath}") + manifestFile = new File(extension.manifestPath) } + project.logger.info("manifestFile: ${manifestFile.absolutePath}") def mappingFile = getMappingFile(variant, project) def transformerTask = getTransformerTask(project, variant) @@ -303,7 +303,7 @@ class SentryPlugin implements Plugin { cli, "upload-proguard", "--android-manifest", - manifestPath, + manifestFile, "--write-properties", debugMetaPropPath, mappingFile @@ -336,6 +336,17 @@ class SentryPlugin implements Plugin { enabled true } + // when running AS v4.x and split ABIs is enabled, AS generates + // only the files related to your device/emulator, and this breaks the plugin, + // so in case that the files don't exist for this variant, we skip it. + persistIdsTask.onlyIf { + def exist = manifestFile.exists() + if (!exist) { + project.logger.info("${manifestFile.absolutePath} doesn't exist, ${variant.name} won't upload-proguard files") + } + return exist + } + // create and hooks the uploading of native symbols task after the assembling task def variantOutputName = "${variant.name.capitalize()}${variantOutput.name.capitalize()}" def uploadNativeSymbolsTaskName = "uploadNativeSymbolsFor${variantOutputName}" @@ -414,7 +425,7 @@ class SentryPlugin implements Plugin { if (packageTask != null) { project.logger.info("packageTask ${packageTask.path}") } else { - packageTask.logger.info("packageTask is null") + project.logger.info("packageTask is null") } // the package task will only be executed if the persistIdsTask has already been executed. @@ -427,7 +438,7 @@ class SentryPlugin implements Plugin { if (assembleTask != null) { project.logger.info("assembleTask ${assembleTask.path}") } else { - assembleTask.logger.info("assembleTask is null") + project.logger.info("assembleTask is null") } // uploadNativeSymbolsTask only will be executed after the assemble task @@ -441,7 +452,7 @@ class SentryPlugin implements Plugin { bundleTask.finalizedBy uploadNativeSymbolsTask } } else { - assembleTask.logger.info("uploadNativeSymbolsTask won't be executed") + project.logger.info("uploadNativeSymbolsTask won't be executed") } } }