From 05d76f01a600730c83dca1bd524bab6519ff6321 Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 13 May 2026 11:39:49 +0200 Subject: [PATCH 1/4] Adjust release script --- README.md | 17 ++++++------ copy-sdks => bake-sdk-release | 49 +++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 28 deletions(-) rename copy-sdks => bake-sdk-release (84%) diff --git a/README.md b/README.md index 7b1abddb4..e7ac84992 100644 --- a/README.md +++ b/README.md @@ -84,25 +84,24 @@ Changes will appear against the [/sdks](sdks) directory. Make sure to include th ### Releasing SDKs -The [copy-sdks](copy-sdks) script copies built SDK files from [/sdks](sdks) into the [/repos](repos) directory, updates version numbers, commits, and pushes a release branch. +The [bake-sdk-release](bake-sdk-release) script copies built SDK files from [/sdks](sdks) into the [/repos](repos) directory, updates version numbers, commits, and pushes a release branch. You can release a single SDK with an explicit version: ```bash -./copy-sdks -t php -v 1.4.0 +./bake-sdk-release -t php -v 1.4.0 ``` -Or release multiple SDKs at once, with automatic version bumps (reads the current version from `repos/[SDK]/VERSION`): +Or release multiple SDKs at once. Without `-b` or `-v`, the current version from `repos/[SDK]/VERSION` is used as-is: ```bash -./copy-sdks -t python,node,ruby # specific SDKs, auto-bump minor -./copy-sdks -t all # all SDKs, auto-bump minor -./copy-sdks -t all -b patch # all SDKs, auto-bump patch -./copy-sdks -t all -b major # all SDKs, auto-bump major -./copy-sdks -t all -v 2.0.0 # all SDKs, explicit version +./bake-sdk-release -t all # all SDKs, keep current version +./bake-sdk-release -t all -b minor # all SDKs, bump minor +./bake-sdk-release -t all -b patch # all SDKs, bump patch +./bake-sdk-release -t all -v 2.0.0 # all SDKs, explicit version ``` -The `-b` flag accepts `major`, `minor` (default), or `patch`. +The `-b` flag accepts `major`, `minor`, or `patch`. The script shows a summary table of current and new versions and asks for confirmation before proceeding. diff --git a/copy-sdks b/bake-sdk-release similarity index 84% rename from copy-sdks rename to bake-sdk-release index 34f1186cd..5d8d86c30 100755 --- a/copy-sdks +++ b/bake-sdk-release @@ -7,7 +7,8 @@ SDKS=( dotnet java-v1 java-v2 node php python ruby ) SHOW_HELP=0 TARGET_SDK= TARGET_VERSION= -BUMP_TYPE=minor +BUMP_TYPE= +DRY_RUN=0 REPO_DOTNET="https://github.com/hellosign/dropbox-sign-dotnet.git" REPO_JAVA_V1="--branch v1 https://github.com/hellosign/dropbox-sign-java.git" @@ -19,7 +20,7 @@ REPO_RUBY="https://github.com/hellosign/dropbox-sign-ruby.git" REPO_MAIN_BRANCH="main" -while getopts ":t:v:b:h" opt; do +while getopts ":t:v:b:dh" opt; do case $opt in t) TARGET_SDK="$OPTARG" ;; @@ -27,6 +28,8 @@ while getopts ":t:v:b:h" opt; do ;; b) BUMP_TYPE="$OPTARG" ;; + d) DRY_RUN=1 + ;; h) SHOW_HELP=1 ;; \?) echo "Invalid option -$OPTARG" >&2 @@ -95,8 +98,10 @@ function main() { if [[ -n "${TARGET_VERSION}" ]]; then versions+=("${TARGET_VERSION}") - else + elif [[ -n "${BUMP_TYPE}" ]]; then versions+=("$(bump_version "$current_ver" "$BUMP_TYPE")") + else + versions+=("${current_ver}") fi done @@ -136,7 +141,7 @@ function main() { function show_help() { cat << EOF -Usage: copy-sdks [OPTION] +Usage: bake-sdk-release [OPTION] Copies build files for a given SDK into the repos/[SDK] directory. **WARNING** All files and directories present in the repos/[SDK] directory will @@ -146,15 +151,17 @@ Copies build files for a given SDK into the repos/[SDK] directory. valid: dotnet, java-v1, java-v2, node, php, python, ruby, all -v version of the SDK, ex: 1.4.0 if omitted, auto-bumps version from repos/[SDK]/VERSION --b bump type when -v is omitted: major, minor (default), or patch +-b bump version: major, minor, or patch + if omitted, uses current version from repos/[SDK]/VERSION +-d dry run: copy files and update versions but skip commit and push -h display this help and exit Examples: - copy-sdks -t php -v 1.4.0 # single SDK, explicit version - copy-sdks -t python,node,ruby # multiple SDKs, auto-bump minor - copy-sdks -t all # all SDKs, auto-bump minor - copy-sdks -t all -b patch # all SDKs, auto-bump patch - copy-sdks -t all -v 2.0.0 # all SDKs, same explicit version + bake-sdk-release -t php -v 1.4.0 # single SDK, explicit version + bake-sdk-release -t all -b minor # all SDKs, bump minor + bake-sdk-release -t all -b patch # all SDKs, bump patch + bake-sdk-release -t all # all SDKs, keep current version + bake-sdk-release -t python,node,ruby # specific SDKs, keep current version EOF exit 0 @@ -193,10 +200,12 @@ function copy_files() printf "Copying built files for the ${SDK} SDK to ${SDK_DIR}\n" pushd "${SDK_DIR}/" - git reset --hard origin/${REPO_MAIN_BRANCH} - git pull origin ${REPO_MAIN_BRANCH} - git checkout "release-${VERSION}" 2>/dev/null || git checkout -b "release-${VERSION}" - git rm -rf --cached . + git fetch origin + git checkout "release-${VERSION}" 2>/dev/null || { + git checkout ${REPO_MAIN_BRANCH} + git reset --hard origin/${REPO_MAIN_BRANCH} + git checkout -b "release-${VERSION}" + } popd @@ -207,8 +216,6 @@ function copy_files() pushd "${SDK_DIR}/" - git add . - rm -f "${SDK_DIR}/openapi-sdk.yaml" rm -rf "${SDK_DIR}/examples" mkdir -p "${SDK_DIR}/examples" @@ -233,9 +240,13 @@ function copy_files() php "${DIR}/bin/update-sdk-version.php" ${SDK} ${VERSION} - git add -A - git commit -m "Release ${VERSION}" - git push -u origin "release-${VERSION}" + if [[ "${DRY_RUN}" -eq 0 ]]; then + git add -A + git commit -m "Release ${VERSION}" + git push -u origin "release-${VERSION}" + else + printf "Dry run: skipping commit and push for %s\n" "$SDK" + fi popd } From 00645843903c45fcf0d7958c03e74ff88fa25dd6 Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 13 May 2026 11:59:25 +0200 Subject: [PATCH 2/4] Adjust release script --- bin/copy-examples-filtered | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/copy-examples-filtered b/bin/copy-examples-filtered index 424a9b809..82367c82e 100755 --- a/bin/copy-examples-filtered +++ b/bin/copy-examples-filtered @@ -31,6 +31,10 @@ for FILE in "${SRC_DIR}"/*."${EXT}"; do [ -f "$FILE" ] || continue BASENAME=$(basename "$FILE" ".$EXT") + if [[ "$BASENAME" != *Example ]]; then + continue + fi + SKIP=0 for PASCAL in "${HIDDEN_PASCALS[@]}"; do if [ "$BASENAME" = "${PASCAL}Example" ]; then From 3fc829b811d11824200d0bc6c7b7d328275c8ecd Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 13 May 2026 14:38:36 +0200 Subject: [PATCH 3/4] Fix java release --- README.md | 3 +- .../close-and-release-repository.yml | 6 +- .../.github/workflows/github-actions.yml | 19 +++-- sdks/java-v2/build.gradle | 84 +++---------------- 4 files changed, 29 insertions(+), 83 deletions(-) diff --git a/README.md b/README.md index e7ac84992..ae8934bf7 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,8 @@ Or release multiple SDKs at once. Without `-b` or `-v`, the current version from ./bake-sdk-release -t all # all SDKs, keep current version ./bake-sdk-release -t all -b minor # all SDKs, bump minor ./bake-sdk-release -t all -b patch # all SDKs, bump patch -./bake-sdk-release -t all -v 2.0.0 # all SDKs, explicit version +./bake-sdk-release -t all -v 2.0.0 # all SDKs, explicit version +./bake-sdk-release -t all -d # all SDKs, do a dry run - no commit, push ``` The `-b` flag accepts `major`, `minor`, or `patch`. diff --git a/sdks/java-v2/.github/workflows/close-and-release-repository.yml b/sdks/java-v2/.github/workflows/close-and-release-repository.yml index 4aed1f0c3..8f07b7ed9 100644 --- a/sdks/java-v2/.github/workflows/close-and-release-repository.yml +++ b/sdks/java-v2/.github/workflows/close-and-release-repository.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: repository: - description: 'Manually trigger gradle closeAndReleaseRepository task in case of timeout from previous publishing' + description: 'Manually trigger release in case of timeout from previous publishing' jobs: closeAndReleaseRepository: @@ -20,7 +20,9 @@ jobs: java-version: 11 - name: Publish Release to Maven Central - run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel --repository ${{ inputs.repository }} + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} diff --git a/sdks/java-v2/.github/workflows/github-actions.yml b/sdks/java-v2/.github/workflows/github-actions.yml index 8c8235f57..fb81028a6 100644 --- a/sdks/java-v2/.github/workflows/github-actions.yml +++ b/sdks/java-v2/.github/workflows/github-actions.yml @@ -47,23 +47,26 @@ jobs: distribution: 'zulu' java-version: 11 - - name: Upload Artifacts - run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + - name: Retrieve version + run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV + + - name: Publish to Maven Central + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} - - name: Retrieve version - run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV - - - name: Publish Release to Maven Central - run: ./gradlew releaseRepository --no-daemon --no-parallel - if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" + - name: Publish Snapshot + run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} # This job runs on merging to "main" branch # Creates a new tag using the value in the VERSION file diff --git a/sdks/java-v2/build.gradle b/sdks/java-v2/build.gradle index 8fc1583c4..b8a167cb5 100644 --- a/sdks/java-v2/build.gradle +++ b/sdks/java-v2/build.gradle @@ -1,44 +1,31 @@ - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' - } -} - plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = 'com.dropbox.sign' -archivesBaseName = 'dropbox-sign' version = '2.7-dev' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('dropbox-sign') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} repositories { mavenCentral() } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -68,53 +55,6 @@ artifacts { archives javadocJar, sourcesJar, fatJar } -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = 'dropbox-sign' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = 'scm:git:git://github.com/hellosign/dropbox-sign-java.git' - developerConnection = 'scm:git:git@github.com:hellosign/dropbox-sign-java.git' - url = 'https://github.com/hellosign/dropbox-sign-java' - } - - licenses { - license { - name = 'MIT License' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = 'Dropbox Sign API Team' - email = 'apisupport@hellosign.com' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} - ext { swagger_annotations_version = "1.6.5" jackson_version = "2.17.1" From a4a23d3be8c270219e0c60399097e40db9ad0fc5 Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 13 May 2026 15:13:47 +0200 Subject: [PATCH 4/4] Fix java release --- .../close-and-release-repository.yml | 6 +- .../.github/workflows/github-actions.yml | 19 +++-- sdks/java-v1/build.gradle | 82 +++---------------- .../libraries/jersey2/build.gradle.mustache | 79 ++++-------------- sdks/java-v2/build.gradle | 2 + .../libraries/jersey3/build.gradle.mustache | 79 ++++-------------- 6 files changed, 57 insertions(+), 210 deletions(-) diff --git a/sdks/java-v1/.github/workflows/close-and-release-repository.yml b/sdks/java-v1/.github/workflows/close-and-release-repository.yml index 4aed1f0c3..8f07b7ed9 100644 --- a/sdks/java-v1/.github/workflows/close-and-release-repository.yml +++ b/sdks/java-v1/.github/workflows/close-and-release-repository.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: repository: - description: 'Manually trigger gradle closeAndReleaseRepository task in case of timeout from previous publishing' + description: 'Manually trigger release in case of timeout from previous publishing' jobs: closeAndReleaseRepository: @@ -20,7 +20,9 @@ jobs: java-version: 11 - name: Publish Release to Maven Central - run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel --repository ${{ inputs.repository }} + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} diff --git a/sdks/java-v1/.github/workflows/github-actions.yml b/sdks/java-v1/.github/workflows/github-actions.yml index 913f790a6..8a5616e8d 100644 --- a/sdks/java-v1/.github/workflows/github-actions.yml +++ b/sdks/java-v1/.github/workflows/github-actions.yml @@ -47,23 +47,26 @@ jobs: distribution: 'zulu' java-version: 11 - - name: Upload Artifacts - run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + - name: Retrieve version + run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV + + - name: Publish to Maven Central + run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} - - name: Retrieve version - run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV - - - name: Publish Release to Maven Central - run: ./gradlew releaseRepository --no-daemon --no-parallel - if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" + - name: Publish Snapshot + run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace + if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')" env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} # This job runs on merging to "v1" branch # Creates a new tag using the value in the VERSION file diff --git a/sdks/java-v1/build.gradle b/sdks/java-v1/build.gradle index 163f24e24..f4d6098ee 100644 --- a/sdks/java-v1/build.gradle +++ b/sdks/java-v1/build.gradle @@ -1,44 +1,33 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' - } -} plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = 'com.dropbox.sign' -archivesBaseName = 'dropbox-sign' version = '1.11-dev' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('dropbox-sign') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} repositories { mavenCentral() } -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -68,53 +57,6 @@ artifacts { archives javadocJar, sourcesJar, fatJar } -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = 'dropbox-sign' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = 'scm:git:git://github.com/hellosign/dropbox-sign-java.git' - developerConnection = 'scm:git:git@github.com:hellosign/dropbox-sign-java.git' - url = 'https://github.com/hellosign/dropbox-sign-java' - } - - licenses { - license { - name = 'MIT License' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = 'Dropbox Sign API Team' - email = 'apisupport@hellosign.com' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} - ext { swagger_annotations_version = "1.6.5" jackson_version = "2.17.1" diff --git a/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache b/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache index deeb879cb..2339cfe0f 100644 --- a/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache +++ b/sdks/java-v1/templates/libraries/jersey2/build.gradle.mustache @@ -7,6 +7,7 @@ group = '{{groupId}}' version = '{{artifactVersion}}' {{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} buildscript { repositories { mavenCentral() @@ -14,30 +15,29 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' -{{^useCustomTemplateCode}} classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' -{{/useCustomTemplateCode}} } } +{{/useCustomTemplateCode}} {{#useCustomTemplateCode}} plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = '{{groupId}}' -archivesBaseName = '{{artifactId}}' version = '{{artifactVersion}}' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('{{artifactId}}') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} {{/useCustomTemplateCode}} repositories { @@ -123,16 +123,12 @@ if(hasProperty('target') && target == 'android') { } {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -161,53 +157,6 @@ processResources { artifacts { archives javadocJar, sourcesJar, fatJar } - -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = '{{artifactId}}' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = '{{scmConnection}}' - developerConnection = '{{scmDeveloperConnection}}' - url = '{{scmUrl}}' - } - - licenses { - license { - name = '{{licenseName}}' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = '{{developerName}}' - email = '{{developerEmail}}' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} {{/useCustomTemplateCode}} ext { diff --git a/sdks/java-v2/build.gradle b/sdks/java-v2/build.gradle index b8a167cb5..070450059 100644 --- a/sdks/java-v2/build.gradle +++ b/sdks/java-v2/build.gradle @@ -1,3 +1,5 @@ + + plugins { id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' diff --git a/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache b/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache index 8663e4b09..a154937ee 100644 --- a/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache +++ b/sdks/java-v2/templates/libraries/jersey3/build.gradle.mustache @@ -7,6 +7,7 @@ group = '{{groupId}}' version = '{{artifactVersion}}' {{/useCustomTemplateCode}} +{{^useCustomTemplateCode}} buildscript { repositories { mavenCentral() @@ -14,30 +15,29 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:2.3.+' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' -{{^useCustomTemplateCode}} classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.3.0' -{{/useCustomTemplateCode}} -{{#useCustomTemplateCode}} - classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.25.0' -{{/useCustomTemplateCode}} } } +{{/useCustomTemplateCode}} {{#useCustomTemplateCode}} plugins { + id 'java' id 'com.vanniktech.maven.publish' version '0.34.0' id 'com.diffplug.spotless' version '6.25.0' } -apply plugin: 'java' -apply plugin: 'maven-publish' -apply plugin: 'signing' - group = '{{groupId}}' -archivesBaseName = '{{artifactId}}' version = '{{artifactVersion}}' -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 + +base { + archivesName.set('{{artifactId}}') +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} {{/useCustomTemplateCode}} repositories { @@ -123,16 +123,12 @@ if(hasProperty('target') && target == 'android') { } {{/useCustomTemplateCode}} {{#useCustomTemplateCode}} -tasks.withType(JavaCompile) { +tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' } -if (JavaVersion.current().isJava8Compatible()) { - tasks.withType(Javadoc) { - // disable the crazy super-strict doclint tool in Java 8 - //noinspection SpellCheckingInspection +tasks.withType(Javadoc).configureEach { options.addStringOption('Xdoclint:none', '-quiet') - } } task javadocJar(type: Jar) { @@ -161,53 +157,6 @@ processResources { artifacts { archives javadocJar, sourcesJar, fatJar } - -publishing { - publications { - mavenJava(MavenPublication) { - pom { - name = 'Dropbox Sign' - packaging = 'jar' - // optionally artifactId can be defined here - artifactId = '{{artifactId}}' - description = 'Use the Dropbox SIgn Java SDK to connect your Java app to Dropbox Sign\'s service in microseconds!' - url = 'https://www.hellosign.com/' - - scm { - connection = '{{scmConnection}}' - developerConnection = '{{scmDeveloperConnection}}' - url = '{{scmUrl}}' - } - - licenses { - license { - name = '{{licenseName}}' - url = 'http://www.opensource.org/licenses/mit-license.php' - } - } - - developers { - developer { - name = '{{developerName}}' - email = '{{developerEmail}}' - url = 'https://www.hellosign.com' - } - } - } - } - } - repositories { - maven { - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username findProperty('ossrhUsername') - password findProperty('ossrhPassword') - } - } - } -} {{/useCustomTemplateCode}} ext {