mirror of
https://github.com/LukeHagar/plexjava.git
synced 2025-12-10 04:20:58 +00:00
121 lines
3.4 KiB
Groovy
121 lines
3.4 KiB
Groovy
|
|
plugins {
|
|
// Apply the java-library plugin for API and implementation separation.
|
|
id 'java-library'
|
|
id 'maven-publish'
|
|
id 'signing'
|
|
}
|
|
|
|
compileJava.options.encoding = "UTF-8"
|
|
compileTestJava.options.encoding = "UTF-8"
|
|
|
|
repositories {
|
|
// Use Maven Central for resolving dependencies.
|
|
mavenCentral()
|
|
}
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
|
|
model {
|
|
tasks.generatePomFileForMavenPublication {
|
|
destination = file("$buildDir/pom.xml")
|
|
}
|
|
}
|
|
|
|
jar {
|
|
dependsOn(":$project.name:generatePomFileForMavenPublication")
|
|
|
|
into("META-INF/maven/lukehagar.plexapi/plexapi") {
|
|
from("$buildDir/pom.xml")
|
|
}
|
|
}
|
|
|
|
javadoc {
|
|
options.encoding = "UTF-8"
|
|
|
|
if(JavaVersion.current().isJava9Compatible()) {
|
|
options.addBooleanOption('html5', true)
|
|
}
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
}
|
|
|
|
|
|
tasks.withType(Javadoc) {
|
|
failOnError false
|
|
options.addStringOption('Xdoclint:none', '-quiet')
|
|
}
|
|
publishing {
|
|
repositories {
|
|
maven {
|
|
name = "OSSRH"
|
|
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
|
|
credentials {
|
|
username = System.getenv("MAVEN_USERNAME")
|
|
password = System.getenv("MAVEN_PASSWORD")
|
|
}
|
|
}
|
|
}
|
|
|
|
publications {
|
|
maven(MavenPublication) {
|
|
groupId = 'lukehagar.plexapi'
|
|
artifactId = 'plexapi'
|
|
version = '0.0.1'
|
|
|
|
from components.java
|
|
|
|
pom {
|
|
name = 'My Company Java SDK'
|
|
description = 'SDK enabling Java developers to easily integrate with the My Company API.'
|
|
url = 'https://github.com/owner/repo'
|
|
scm {
|
|
url = 'github.com/owner/repo'
|
|
connection = 'scm:git:ssh://git@github.com/owner/repo.git'
|
|
}
|
|
licenses {
|
|
license {
|
|
name = 'The MIT License (MIT)'
|
|
url = 'https://mit-license.org/'
|
|
}
|
|
}
|
|
developers {
|
|
developer {
|
|
name = 'My Company'
|
|
organization = 'My Company'
|
|
email = 'info@mycompany.com'
|
|
}
|
|
}
|
|
organization {
|
|
name = 'My Company'
|
|
url = 'www.mycompany.com'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!project.hasProperty('skip.signing')) {
|
|
signing {
|
|
def signingKey = findProperty("signingKey")
|
|
def signingPassphrase = findProperty("signingPassphrase")
|
|
useInMemoryPgpKeys(signingKey, signingPassphrase)
|
|
sign publishing.publications.maven
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.14.1'
|
|
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.1'
|
|
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
|
|
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1'
|
|
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1'
|
|
implementation 'org.apache.httpcomponents:httpcore:4.4.15'
|
|
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
|
|
implementation 'org.apache.httpcomponents:httpmime:4.5.13'
|
|
}
|
|
|