Skip to content

Commit

Permalink
Merge pull request #1 from shnewto/packaging
Browse files Browse the repository at this point in the history
Add gradle publish staging artifact logic
  • Loading branch information
shnewto authored Dec 13, 2020
2 parents 9a9e9de + 45f5092 commit 671494f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![](https://github.com/shnewto/bqjson/workflows/CI/badge.svg?branch=main)

![GitHub Actions CI](https://github.com/shnewto/bqjson/workflows/CI/badge.svg?branch=main)
[![Sonatype Nexus (Releases)](https://img.shields.io/nexus/r/com.github.shnewto/bqjson?server=https%3A%2F%2Foss.sonatype.org%2F)](https://search.maven.org/artifact/com.github.shnewto/bqjson)
# bqjson
Serialize/Deserialize BigQuery TableResults (and TableResult adjacent types) to/from JSON.

Expand Down
81 changes: 68 additions & 13 deletions build.gradle
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 {
Expand All @@ -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'
Expand All @@ -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)
}
}
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
ossrhUsername=
ossrhPassword=

0 comments on commit 671494f

Please sign in to comment.