Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a minimized patch based on the work by @mrmcduff-stripe here: #416
- Loading branch information
Showing
12 changed files
with
461 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ tags | |
target | ||
.idea | ||
*.iml | ||
|
||
# Gradle files | ||
.gradle/* | ||
build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
language: java | ||
|
||
addons: | ||
hosts: | ||
- short-hostname | ||
hostname: short-hostname | ||
|
||
matrix: | ||
include: | ||
- jdk: openjdk7 | ||
dist: precise | ||
- jdk: oraclejdk7 | ||
dist: precise | ||
- jdk: oraclejdk8 | ||
- jdk: oraclejdk9 | ||
|
||
install: mvn install -Dgpg.skip=true -DskipTests | ||
|
||
notifications: | ||
email: | ||
on_success: never | ||
|
||
sudo: false | ||
|
||
script: | ||
- ./gradlew clean test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'maven' | ||
|
||
sourceCompatibility = 1.7 | ||
targetCompatibility = 1.7 | ||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
configurations.all { | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
//Add only for SNAPSHOT versions | ||
//maven { url "http://oss.sonatype.org/content/repositories/snapshots/" } | ||
} | ||
dependencies { | ||
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.11.0" | ||
} | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
compile group: 'com.google.code.gson', name: 'gson', version:'2.2.4' | ||
testCompile group: 'com.google.guava', name: 'guava', version:'18.0' | ||
testCompile group: 'junit', name: 'junit', version:'4.10' | ||
testCompile group: 'org.mockito', name: 'mockito-all', version:'1.10.19' | ||
} | ||
|
||
apply from: 'deploy.gradle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* | ||
* Based on the example at Chris Banes's repository that allows signing | ||
* without manually creating a maven file. | ||
* | ||
* The original can be found at | ||
* https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle | ||
*/ | ||
|
||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
apply plugin: 'io.codearte.nexus-staging' | ||
|
||
nexusStaging { | ||
packageGroup = GROUP | ||
} | ||
|
||
def isReleaseBuild() { | ||
return VERSION_NAME.contains("SNAPSHOT") == false | ||
} | ||
|
||
def getReleaseRepositoryUrl() { | ||
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL | ||
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
} | ||
|
||
def getSnapshotRepositoryUrl() { | ||
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL | ||
: "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
|
||
def getRepositoryUsername() { | ||
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" | ||
} | ||
|
||
def getRepositoryPassword() { | ||
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" | ||
} | ||
|
||
afterEvaluate { project -> | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
pom.groupId = GROUP | ||
pom.artifactId = POM_ARTIFACT_ID | ||
pom.version = VERSION_NAME | ||
|
||
repository(url: getReleaseRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
|
||
snapshotRepository(url: getSnapshotRepositoryUrl()) { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
|
||
pom.project { | ||
name POM_NAME | ||
description POM_DESCRIPTION | ||
url POM_URL | ||
packaging POM_PACKAGING | ||
|
||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
licenses { | ||
license { | ||
name POM_LICENCE_NAME | ||
url POM_LICENCE_URL | ||
distribution POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
email POM_DEVELOPER_EMAIL | ||
} | ||
} | ||
|
||
organization { | ||
name POM_DEVELOPER_NAME | ||
url POM_ORGANIZATION_URL | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { isReleaseBuild() && | ||
(gradle.taskGraph.hasTask("uploadArchives") || gradle.taskGraph.hasTask("publish"))} | ||
sign configurations.archives | ||
} | ||
|
||
task makeJavadocs(type: Javadoc) { | ||
source = sourceSets.main.allJava | ||
classpath = configurations.compile | ||
failOnError = true | ||
} | ||
|
||
task makeJavadocsJar(type: Jar, dependsOn: makeJavadocs) { | ||
classifier = 'javadoc' | ||
from makeJavadocs.destinationDir | ||
} | ||
|
||
task sourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
from sourceSets.main.java | ||
} | ||
|
||
artifacts { | ||
archives jar | ||
archives sourcesJar | ||
archives makeJavadocsJar | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
GROUP=com.stripe | ||
VERSION_NAME=5.22.0 | ||
|
||
POM_URL=https://github.com/stripe/stripe-java | ||
POM_SCM_URL=git@github.com:stripe/stripe-java.git | ||
POM_SCM_CONNECTION=scm:git:git@github.com:stripe/stripe-java.git | ||
POM_SCM_DEV_CONNECTION=scm:git:git@github.com:stripe/stripe-java.git | ||
POM_LICENCE_NAME=The MIT License | ||
POM_LICENCE_URL=https://opensource.org/licenses/MIT | ||
POM_LICENCE_DIST=repo | ||
POM_DEVELOPER_ID=stripe | ||
POM_DEVELOPER_NAME=Stripe | ||
POM_DEVELOPER_EMAIL=support+java@stripe.com | ||
|
||
POM_DESCRIPTION=Stripe Java Bindings | ||
POM_NAME=stripe-java | ||
POM_ARTIFACT_ID=stripe-java | ||
POM_PACKAGING=jar | ||
POM_ORGANIZATION_URL=https://stripe.com |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip |
Oops, something went wrong.