diff --git a/.craft.yml b/.craft.yml index d864cce9e7..17989ba644 100644 --- a/.craft.yml +++ b/.craft.yml @@ -1,6 +1,21 @@ -minVersion: 0.23.1 +minVersion: 0.24.4 changelogPolicy: auto targets: + - name: symbol-collector + includeNames: /libsentry(-android)?\.so/ + batchType: android + bundleIdPrefix: sentry-android-ndk- + - name: maven + includeNames: /^sentry.*$/ + gradleCliPath: ./gradlew + mavenCliPath: scripts/mvnw + mavenSettingsPath: scripts/settings.xml + mavenRepoId: ossrh + mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2/ + android: + distDirRegex: /^sentry-android-.*$/ + fileReplaceeRegex: /\d\.\d\.\d(-\w+(\.\d)?)?(-SNAPSHOT)?/ + fileReplacerStr: release.aar - name: github excludeNames: /^libsentry.*\.so$/ - name: registry @@ -20,14 +35,3 @@ targets: maven:io.sentry:sentry-android-okhttp: maven:io.sentry:sentry-kotlin-extensions: maven:io:sentry:sentry-android-fragment: - - name: maven - includeNames: /^sentry.*$/ - gradleCliPath: ./gradlew - mavenCliPath: scripts/mvnw - mavenSettingsPath: scripts/settings.xml - mavenRepoId: ossrh - mavenRepoUrl: https://oss.sonatype.org/service/local/staging/deploy/maven2/ - android: - distDirRegex: /^sentry-android-.*$/ - fileReplaceeRegex: /\d\.\d\.\d(-\w+(\.\d)?)?(-SNAPSHOT)?/ - fileReplacerStr: release.aar diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index f04193af68..ae4281ddf7 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - release/** pull_request: branches: - '*' diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index 39da830dad..2b6b7fd054 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - release/** pull_request: branches: - '*' diff --git a/CHANGELOG.md b/CHANGELOG.md index 385c4fe564..17d9ab498d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ * Feat: Add request body extraction for Spring MVC integration (#1595) +## 5.1.0-beta.4 + +* Update sentry-native to 0.4.11 (#1591) + ## 5.1.0-beta.3 * Feat: Spring Webflux integration (#1529) diff --git a/Makefile b/Makefile index 24cb7a2ba5..213e900c1d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean compile dryRelease doRelease release update stop checkFormat format api +.PHONY: all clean compile dryRelease update stop checkFormat format api all: stop clean checkFormat compile dryRelease @@ -15,17 +15,6 @@ compile: dryRelease: ./gradlew publishToMavenLocal --no-daemon -# deploy the current build to maven central -# promotes the release to maven central -doRelease: - cd scripts - kotlinc -script release.kts -- -d ../distributions | sh - cd .. - ./gradlew closeAndReleaseRepository - -# clean, build, deploy and promote to maven central -release: clean checkFormat compile doRelease - # check for dependencies update update: ./gradlew dependencyUpdates -Drevision=release diff --git a/build.gradle.kts b/build.gradle.kts index d688c47a71..ac92e3cc17 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -79,12 +79,6 @@ subprojects { } } - val rootDir = this.project.rootProject.projectDir - val distDir = File("${rootDir}${sep}distributions") - - // create dir if it does not exist - distDir.mkdirs() - tasks.named("distZip").configure { this.dependsOn("publishToMavenLocal") this.doLast { @@ -92,12 +86,6 @@ subprojects { val file = File(distributionFilePath) if (!file.exists()) throw IllegalStateException("Distribution file: $distributionFilePath does not exist") if (file.length() == 0L) throw IllegalStateException("Distribution file: $distributionFilePath is empty") - - val newFile = File("${distDir}${sep}${file.name}") - file.copyTo(newFile, overwrite = true) - - UnzipUtils.unzip(newFile, distDir.path) - newFile.delete() } } diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index 549edcab04..748689f971 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -10,7 +10,7 @@ object Config { val springKotlinCompatibleLanguageVersion = "1.3" object BuildPlugins { - val androidGradle = "com.android.tools.build:gradle:4.2.1" + val androidGradle = "com.android.tools.build:gradle:4.2.2" val kotlinGradlePlugin = "gradle-plugin" val buildConfig = "com.github.gmazzo.buildconfig" val buildConfigVersion = "3.0.0" diff --git a/buildSrc/src/main/java/UnzipUtils.kt b/buildSrc/src/main/java/UnzipUtils.kt deleted file mode 100644 index 69c958a724..0000000000 --- a/buildSrc/src/main/java/UnzipUtils.kt +++ /dev/null @@ -1,64 +0,0 @@ -import java.io.BufferedOutputStream -import java.io.File -import java.io.FileOutputStream -import java.io.IOException -import java.io.InputStream -import java.util.zip.ZipFile - -/** - * UnzipUtils class extracts files and sub-directories of a standard zip file to - * a destination directory. - * - */ -object UnzipUtils { - /** - * @param zipFilePath - * @param destDirectory - * @throws IOException - */ - @Throws(IOException::class) - fun unzip(zipFilePath: File, destDirectory: String) { - val destDir = File(destDirectory) - if (!destDir.exists()) { - destDir.mkdir() - } - ZipFile(zipFilePath).use { zip -> - zip.entries().asSequence().forEach { entry -> - zip.getInputStream(entry).use { input -> - val filePath = destDirectory + File.separator + entry.name - - if (!entry.isDirectory) { - // if the entry is a file, extracts it - extractFile(input, filePath) - } else { - // if the entry is a directory, make the directory - val dir = File(filePath) - dir.mkdir() - } - } - } - } - } - - /** - * Extracts a zip entry (file entry) - * @param inputStream - * @param destFilePath - * @throws IOException - */ - @Throws(IOException::class) - private fun extractFile(inputStream: InputStream, destFilePath: String) { - val bos = BufferedOutputStream(FileOutputStream(destFilePath)) - val bytesIn = ByteArray(BUFFER_SIZE) - var read: Int - while (inputStream.read(bytesIn).also { read = it } != -1) { - bos.write(bytesIn, 0, read) - } - bos.close() - } - - /** - * Size of the buffer to read/write data - */ - private const val BUFFER_SIZE = 4096 -} diff --git a/gradle.properties b/gradle.properties index a8c4502a93..f26798e806 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,8 +5,8 @@ org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+H android.useAndroidX=true # Release information -buildVersionCode=20073 -versionName=5.1.0-beta.4-SNAPSHOT +buildVersionCode=20074 +versionName=5.1.0-beta.5-SNAPSHOT # disable renderscript, it's enabled by default android.defaults.buildfeatures.renderscript=false diff --git a/scripts/bump-version.sh b/scripts/bump-version.sh index e230d7487e..962d929627 100755 --- a/scripts/bump-version.sh +++ b/scripts/bump-version.sh @@ -7,9 +7,6 @@ cd $SCRIPT_DIR/.. OLD_VERSION="$1" NEW_VERSION="$2" -echo $OLD_VERSION -echo $NEW_VERSION - GRADLE_FILEPATH="gradle.properties" # Replace `versionName` with the given version diff --git a/scripts/post-release.sh b/scripts/post-release.sh index df8feb9412..19b054eaf4 100755 --- a/scripts/post-release.sh +++ b/scripts/post-release.sh @@ -7,6 +7,9 @@ cd $SCRIPT_DIR/.. OLD_VERSION="${1}" NEW_VERSION="${2}" +git checkout main +GRADLE_FILEPATH="gradle.properties" + # Add a new unreleased entry in the changelog sed -i "" 's/# Changelog/# Changelog\n\n## Unreleased/' CHANGELOG.md @@ -34,4 +37,8 @@ sed -i "" -e "s/$VERSION_NAME_PATTERN=.*$/$VERSION_NAME_PATTERN=$new_version-SNA VERSION_CODE_PATTERN="buildVersionCode" VERSION_NUMBER="$( awk "/$VERSION_CODE_PATTERN/" $GRADLE_FILEPATH | grep -o '[0-9]\+' )" ((VERSION_NUMBER++)) -sed -ie "s/$VERSION_CODE_PATTERN=.*$/$VERSION_CODE_PATTERN=$VERSION_NUMBER/g" $GRADLE_FILEPATH +sed -i "" e "s/$VERSION_CODE_PATTERN=.*$/$VERSION_CODE_PATTERN=$VERSION_NUMBER/g" $GRADLE_FILEPATH + +git add . +git commit -m "Prepare $new_version" +git push diff --git a/scripts/release.kts b/scripts/release.kts deleted file mode 100755 index 07a68ef207..0000000000 --- a/scripts/release.kts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Outputs the bash script that uploads packages to MavenCentral. - * - * This script assumes that all distrbution packages have been downloaded and unzipped in one directory. - * For example, all packages are in the "distributions" directory: - * - * distributions - * ├── sentry-3.1.2 - * ├── sentry-android-3.1.2 - * ├── sentry-android-core-3.1.2 - * ├── sentry-android-ndk-3.1.2 - * ├── sentry-android-timber-3.1.2 - * ├── sentry-log4j2-3.1.2 - * ├── sentry-logback-3.1.2 - * ├── sentry-servlet-3.1.2 - * ├── sentry-spring-3.1.2 - * └── sentry-spring-boot-starter-3.1.2 - * - * To execute the script two environment variables that are used by Maven have to be present: OSSRH_USERNAME, OSSRH_PASSWORD - * - * Example usage (assuming that the script is executed from the `/scripts` directory and the distribution files are in `/distributions`): - * $ kotlinc -script release.kts -- -d ../distributions | sh - * - */ -import java.io.File - -/** - * Path to a directory with unzipped distribution packages. - */ -val path = argOrDefault("d", ".") - -/** - * Path to Maven settings.xml containing MavenCentral username and api key. - */ -val settingsPath = argOrDefault("s", "./settings.xml") - -/** - * Maven repository URL. - */ -val repositoryUrl = argOrDefault("repositoryUrl", "https://oss.sonatype.org/service/local/staging/deploy/maven2/") - -/** - * Maven server id in the settings.xml file. - */ -val repositoryId = argOrDefault("repositoryId", "ossrh") - -File(path) - .listFiles { file -> file.isDirectory() } - .forEach { folder -> - val path = folder.path - val module = folder.name - - val file: String - - val androidFile = folder - .listFiles { it -> it.name.contains("release") && it.extension == "aar" } - .firstOrNull() - - if (androidFile != null) { - file = androidFile.path - } else { - file = "$path/$module.jar" - } - - val javadocFile = "$path/$module-javadoc.jar" - val sourcesFile = "$path/$module-sources.jar" - val pomFile = "$path/pom-default.xml" - - // requires GnuPG installed to sign files - // using 'gpg:sign-and-deploy-file' because 'deploy:deploy-file' does not upload - // .asc files. - // TODO: find out where to set keyId, password and secretKeyRingFile if you have - // more than one. - val command = "./mvnw gpg:sign-and-deploy-file " + - "-Dfile=$file " + - "-Dfiles=$javadocFile,$sourcesFile " + - "-Dclassifiers=javadoc,sources " + - "-Dtypes=jar,jar " + - "-DpomFile=$pomFile " + - "-DrepositoryId=$repositoryId " + - "-Durl=$repositoryUrl " + - "--settings $settingsPath" - println(command) - } - -/** - * Returns the value for a command line argument passed with -argName flag or throws an exception if not provided. - */ -fun Release.requiredArg(argName: String) = - if (args.contains("-$argName")) args[1 + args.indexOf("-$argName")] else throw Error("$argName parameter must be provided") - -/** - * Returns the value for a command line argument passed with -argName flag or returns the default value. - */ -fun Release.argOrDefault(argName: String, default: String) = - if (args.contains("-$argName")) args[1 + args.indexOf("-$argName")] else default diff --git a/sentry-android-ndk/sentry-native b/sentry-android-ndk/sentry-native index b3f2b6ddac..5afac54be8 160000 --- a/sentry-android-ndk/sentry-native +++ b/sentry-android-ndk/sentry-native @@ -1 +1 @@ -Subproject commit b3f2b6ddac886616b40cdccbb05b81af14b6adc9 +Subproject commit 5afac54be8c8956b58c9f5cefd0828948aa3563f