From a40739894d562684a3bc1ff1274921abcd7b6684 Mon Sep 17 00:00:00 2001 From: iker barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 13 Jul 2021 13:43:25 +0200 Subject: [PATCH 1/8] fix(release): Manage git state after post-release (#1588) From [Craft docs](https://github.com/getsentry/craft#post-release-script-conventions): > The script is responsible for any and all `git` state management as `craft` will simply exit after running this script as the final step. This means the script is responsible for committing and pushing any changes that it may have made. Git state isn't managed in the post-release script, meaning changes won't be pushed; this PR manages it. --- scripts/post-release.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/post-release.sh b/scripts/post-release.sh index 66e95d20d1..8b9fa212ed 100755 --- a/scripts/post-release.sh +++ b/scripts/post-release.sh @@ -7,6 +7,7 @@ cd $SCRIPT_DIR/.. OLD_VERSION="${1}" NEW_VERSION="${2}" +git checkout main GRADLE_FILEPATH="gradle.properties" # Add a new unreleased entry in the changelog @@ -37,3 +38,7 @@ 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 + +git add . +git commit -m "Prepare $new_version" +git push From ca2c5fd3d2fef2abb5c96f69af0bc5f75dbbad57 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 13 Jul 2021 13:51:15 +0200 Subject: [PATCH 2/8] downgrade minVersion craft --- .craft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.craft.yml b/.craft.yml index b647d74c6f..f1ab769a5b 100644 --- a/.craft.yml +++ b/.craft.yml @@ -1,4 +1,4 @@ -minVersion: 0.25.0 +minVersion: 0.24.4 changelogPolicy: auto targets: - name: symbol-collector From 33a1b1ecc0e0e86b49de4711bfa763d3152adbcc Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 13 Jul 2021 13:55:40 +0200 Subject: [PATCH 3/8] release: 5.1.0-beta.4 --- CHANGELOG.md | 2 +- gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 302937da54..5cd2710a60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 5.1.0-beta.4 * Update sentry-native to 0.4.11 (#1591) diff --git a/gradle.properties b/gradle.properties index a8c4502a93..610a88afb4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ android.useAndroidX=true # Release information buildVersionCode=20073 -versionName=5.1.0-beta.4-SNAPSHOT +versionName=5.1.0-beta.4 # disable renderscript, it's enabled by default android.defaults.buildfeatures.renderscript=false From 0ce4a18460fd8cf1dfb1af8fa7fcd33d2240392c Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 13 Jul 2021 14:28:01 +0200 Subject: [PATCH 4/8] Prepare 5.1.0-beta.5 --- CHANGELOG.md | 2 ++ gradle.properties | 4 ++-- gradle.propertiese | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 gradle.propertiese diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cd2710a60..5bc9091a8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 5.1.0-beta.4 * Update sentry-native to 0.4.11 (#1591) diff --git a/gradle.properties b/gradle.properties index 610a88afb4..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 +buildVersionCode=20074 +versionName=5.1.0-beta.5-SNAPSHOT # disable renderscript, it's enabled by default android.defaults.buildfeatures.renderscript=false diff --git a/gradle.propertiese b/gradle.propertiese new file mode 100644 index 0000000000..16f6e13d0c --- /dev/null +++ b/gradle.propertiese @@ -0,0 +1,45 @@ +# Daemon’s heap size +org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC + +# AndroidX required by AGP >= 3.6.x +android.useAndroidX=true + +# Release information +buildVersionCode=20073 +versionName=5.1.0-beta.5-SNAPSHOT + +# disable renderscript, it's enabled by default +android.defaults.buildfeatures.renderscript=false + +# disable shader compilation, it's enabled by default +android.defaults.buildfeatures.shaders=false + +# disable aidl files, it's enabled by default +android.defaults.buildfeatures.aidl=false + +# disable Resource Values generation +android.defaults.buildfeatures.resvalues=false + +# disable automatically adding Kotlin stdlib to compile dependencies +kotlin.stdlib.default.dependency=false + +# TODO: Enable Prefab https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html +# android.enablePrefab=true +# android.prefabVersion=1.0.0 + +# publication pom properties +POM_NAME=Sentry SDK +POM_DESCRIPTION=SDK for sentry.io +POM_URL=https://github.com/getsentry/sentry-java +POM_SCM_URL=https://github.com/getsentry/sentry-java +POM_SCM_CONNECTION=scm:git:git://github.com/getsentry/sentry-java.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/getsentry/sentry-java.git + +POM_LICENCE_NAME=MIT +POM_LICENCE_URL=http://www.opensource.org/licenses/mit-license.php + +POM_DEVELOPER_ID=getsentry +POM_DEVELOPER_NAME=Sentry Team and Contributors +POM_DEVELOPER_URL=https://github.com/getsentry/ + +systemProp.org.gradle.internal.http.socketTimeout=120000 From 739618447afa1ec1f80dd3440e5354402991c40b Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Tue, 13 Jul 2021 14:29:38 +0200 Subject: [PATCH 5/8] remove wrong file --- gradle.propertiese | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 gradle.propertiese diff --git a/gradle.propertiese b/gradle.propertiese deleted file mode 100644 index 16f6e13d0c..0000000000 --- a/gradle.propertiese +++ /dev/null @@ -1,45 +0,0 @@ -# Daemon’s heap size -org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:MaxMetaspaceSize=1536m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC - -# AndroidX required by AGP >= 3.6.x -android.useAndroidX=true - -# Release information -buildVersionCode=20073 -versionName=5.1.0-beta.5-SNAPSHOT - -# disable renderscript, it's enabled by default -android.defaults.buildfeatures.renderscript=false - -# disable shader compilation, it's enabled by default -android.defaults.buildfeatures.shaders=false - -# disable aidl files, it's enabled by default -android.defaults.buildfeatures.aidl=false - -# disable Resource Values generation -android.defaults.buildfeatures.resvalues=false - -# disable automatically adding Kotlin stdlib to compile dependencies -kotlin.stdlib.default.dependency=false - -# TODO: Enable Prefab https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html -# android.enablePrefab=true -# android.prefabVersion=1.0.0 - -# publication pom properties -POM_NAME=Sentry SDK -POM_DESCRIPTION=SDK for sentry.io -POM_URL=https://github.com/getsentry/sentry-java -POM_SCM_URL=https://github.com/getsentry/sentry-java -POM_SCM_CONNECTION=scm:git:git://github.com/getsentry/sentry-java.git -POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/getsentry/sentry-java.git - -POM_LICENCE_NAME=MIT -POM_LICENCE_URL=http://www.opensource.org/licenses/mit-license.php - -POM_DEVELOPER_ID=getsentry -POM_DEVELOPER_NAME=Sentry Team and Contributors -POM_DEVELOPER_URL=https://github.com/getsentry/ - -systemProp.org.gradle.internal.http.socketTimeout=120000 From 18fe3234600dad52b1635c274b54d1ae8efd389a Mon Sep 17 00:00:00 2001 From: iker barriocanal <32816711+iker-barriocanal@users.noreply.github.com> Date: Tue, 13 Jul 2021 14:56:21 +0200 Subject: [PATCH 6/8] fix(craft): Don't save `gradle.properties` backup (#1596) --- scripts/post-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/post-release.sh b/scripts/post-release.sh index 8b9fa212ed..19b054eaf4 100755 --- a/scripts/post-release.sh +++ b/scripts/post-release.sh @@ -37,7 +37,7 @@ 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" From 0d2e21a8ead2b7483b87fe8518f3f4a2ed2c5e00 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Tue, 13 Jul 2021 19:49:58 +0200 Subject: [PATCH 7/8] Remove unnecessary code after craft (#1598) --- .craft.yml | 2 +- .github/workflows/check-formatting.yml | 1 + .../workflows/gradle-wrapper-validation.yml | 1 + build.gradle.kts | 12 ---- buildSrc/src/main/java/UnzipUtils.kt | 64 ------------------- 5 files changed, 3 insertions(+), 77 deletions(-) delete mode 100644 buildSrc/src/main/java/UnzipUtils.kt diff --git a/.craft.yml b/.craft.yml index f1ab769a5b..17989ba644 100644 --- a/.craft.yml +++ b/.craft.yml @@ -4,7 +4,7 @@ targets: - name: symbol-collector includeNames: /libsentry(-android)?\.so/ batchType: android - bundleIdPrefix: android-ndk- + bundleIdPrefix: sentry-android-ndk- - name: maven includeNames: /^sentry.*$/ gradleCliPath: ./gradlew 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/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/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 -} From a545cbcfdab5f472aaa7d69919422411fe2acc61 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Date: Tue, 13 Jul 2021 20:33:19 +0200 Subject: [PATCH 8/8] Bump AGP to 4.2.2 (#1597) --- buildSrc/src/main/java/Config.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"