From 188517f0bc133b87598dc342651f9f75608dcdc8 Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Fri, 2 Jul 2021 09:47:33 +0200 Subject: [PATCH] Remove maven release from make file in favor of craft --- .craft.yml | 2 +- Makefile | 13 +----- scripts/release.kts | 96 --------------------------------------------- 3 files changed, 2 insertions(+), 109 deletions(-) delete mode 100755 scripts/release.kts diff --git a/.craft.yml b/.craft.yml index c81d7d8ddf0..ff04ab8dd16 100644 --- a/.craft.yml +++ b/.craft.yml @@ -1,4 +1,4 @@ -minVersion: 0.23.1 +minVersion: 0.25.0 changelogPolicy: auto targets: - name: github diff --git a/Makefile b/Makefile index 24cb7a2ba5f..213e900c1d7 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/scripts/release.kts b/scripts/release.kts deleted file mode 100755 index 07a68ef2074..00000000000 --- 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