Skip to content

Commit

Permalink
Prepare gradle for publishing
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Domsch <[email protected]>

Prepare gradle for publishing

Signed-off-by: Matt Domsch <[email protected]>
  • Loading branch information
matt-domsch-sp committed May 7, 2021
1 parent 9c10830 commit 8c4f289
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 13 deletions.
93 changes: 81 additions & 12 deletions fastfed-java-sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.2.1/userguide/tutorial_java_projects.html
*/

plugins {
// Apply the java plugin to add support for Java
id 'java-library'
id 'java-library-distribution'
id 'maven-publish'
id 'signing'
}

version = '0.2.0-SNAPSHOT'

repositories {
mavenCentral()
}

version = '0.1.0'

jar {
manifest {
attributes('Implementation-Title': project.name,
Expand All @@ -28,7 +22,7 @@ jar {

distributions {
main {
baseName = 'fastfed-java-sdk'
baseName = 'openid-fastfed-sdk'
contents {
from 'src/main/resources/'
into "config"
Expand Down Expand Up @@ -67,4 +61,79 @@ allprojects {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
}

java {
modularity.inferModulePath = true
withJavadocJar()
withSourcesJar()
}

javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = 'openid-fastfed-sdk'
description = 'OpenID Fast Federation SDK for Java'
url = 'http://github.com/sailpoint-oss/fastfed-sdk'

licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'brian-rose-sp'
name = 'Brian Rose'
email = '[email protected]'
}
developer {
id = 'matt-domsch-sp'
name = 'Matt Domsch'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/sailpoint-oss/fastfed-sdk.git'
developerConnection = 'scm:git:ssh://github.com/sailpoint-oss/fastfed-sdk.git'
url = 'https://github.com/sailpoint-oss/fastfed-sdk/'
}
}
}
}
repositories {
maven {
name = 'myRepo'
url = "file://${buildDir}/repo"
}
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}
}

signing {
useGpgCmd()
sign publishing.publications.maven
}

group = 'com.sailpoint'
sourceCompatibility = 9;
targetCompatibility = 9;
2 changes: 1 addition & 1 deletion fastfed-java-sdk/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
* in the user manual at https://docs.gradle.org/5.2.1/userguide/multi_project_builds.html
*/

rootProject.name = 'fastfed-java-sdk'
rootProject.name = 'openid-fastfed-sdk'

0 comments on commit 8c4f289

Please sign in to comment.