Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/close-and-release-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
19 changes: 11 additions & 8 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
82 changes: 12 additions & 70 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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.0'
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) {
Expand Down Expand Up @@ -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"
Expand Down
79 changes: 14 additions & 65 deletions templates/libraries/jersey2/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,37 @@ group = '{{groupId}}'
version = '{{artifactVersion}}'
{{/useCustomTemplateCode}}

{{^useCustomTemplateCode}}
buildscript {
repositories {
mavenCentral()
}
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 {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down
Loading