-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from shnewto/packaging
Add gradle publish staging artifact logic
- Loading branch information
Showing
3 changed files
with
72 additions
and
15 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
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,15 +1,16 @@ | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This generated file contains a sample Java Library project to get you started. | ||
* For more details take a look at the Java Libraries chapter in the Gradle | ||
* User Manual available at https://docs.gradle.org/6.5.1/userguide/java_library_plugin.html | ||
*/ | ||
|
||
plugins { | ||
// Apply the java-library plugin to add support for Java Library | ||
id 'java-library' | ||
id 'info.solidsoft.pitest' version '1.5.1' | ||
id 'maven-publish' | ||
id 'signing' | ||
} | ||
|
||
group = 'com.github.shnewto' | ||
version = '1.0.1' | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
repositories { | ||
|
@@ -19,12 +20,9 @@ repositories { | |
} | ||
|
||
dependencies { | ||
// This dependency is exported to consumers, that is to say found on their compile classpath. | ||
api 'org.apache.commons:commons-math3:3.6.1' | ||
|
||
implementation 'com.google.cloud:google-cloud-bigquery:1.126.1' | ||
implementation 'com.google.code.gson:gson:2.8.6' | ||
implementation 'org.slf4j:slf4j-log4j12:1.7.30' | ||
implementation 'org.slf4j:slf4j-api:1.7.2' | ||
|
||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1' | ||
testImplementation 'org.junit.platform:junit-platform-runner:1.7.0' | ||
|
@@ -44,3 +42,60 @@ pitest { | |
} | ||
|
||
build.dependsOn 'pitest' | ||
|
||
def ossrhUsername=project.properties['ossrhUsername'] ?: "" | ||
def ossrhPassword=project.properties['ossrhPassword'] ?: "" | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = 'bqjson' | ||
from components.java | ||
pom { | ||
name = 'bqjson' | ||
description = 'Serialize/Deserialize BigQuery TableResults (and TableResult adjacent types) to/from JSON.' | ||
url = 'https://github.com/shnewto/bqjson' | ||
licenses { | ||
license { | ||
name = 'MIT License' | ||
url = 'https://github.com/shnewto/bqjson/blob/main/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'shnewto' | ||
name = 'Shea Newton' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com/shnewto/bqjson.git' | ||
developerConnection = 'scm:git:ssh://github.com/shnewto/bqjson.git' | ||
url = 'http://github.com/shnewto/bqjson/' | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
// change URLs to point to your repos, e.g. http://my.org/repo | ||
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 ossrhUsername | ||
password ossrhPassword | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
javadoc { | ||
if(JavaVersion.current().isJava9Compatible()) { | ||
options.addBooleanOption('html5', true) | ||
} | ||
} |
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