-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload to plugins.gradle.org / Update sphinx-maven-plugin to 2.2.2 / …
…Remove unnecessary sections about how to use an extension
- Loading branch information
Showing
5 changed files
with
38 additions
and
331 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
plugins { | ||
id 'com.gradle.plugin-publish' version '0.9.10' | ||
} | ||
|
||
apply plugin: 'groovy' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
sourceCompatibility = 1.6 | ||
targetCompatibility = 1.6 | ||
|
@@ -15,16 +17,14 @@ repositories { | |
mavenCentral() | ||
} | ||
|
||
configurations { | ||
all*.exclude module: 'maven-filtering' | ||
all*.exclude module: 'maven-reporting-api' | ||
all*.exclude module: 'maven-reporting-impl' | ||
} | ||
|
||
dependencies { | ||
compile gradleApi() | ||
compile localGroovy() | ||
compile group: 'kr.motd.maven', name: 'sphinx-maven-plugin', version: '2.2.2' | ||
compile(group: 'kr.motd.maven', name: 'sphinx-maven-plugin', version: '2.2.2') { | ||
exclude group: 'org.apache.maven.shared', module: 'maven-filtering' | ||
exclude group: 'org.apache.maven.reporting', module: 'maven-reporting-api' | ||
exclude group: 'org.apache.maven.reporting', module: 'maven-reporting-impl' | ||
} | ||
|
||
testCompile group: 'junit', name: 'junit', version: '4.12' | ||
} | ||
|
@@ -45,136 +45,24 @@ artifacts { | |
archives javadocJar | ||
} | ||
|
||
signing { | ||
required { signatory != null && project.ext.isReleaseVersion } | ||
sign configurations.archives | ||
} | ||
|
||
publishing { | ||
repositories { | ||
maven { | ||
if (project.ext.isReleaseVersion) { | ||
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | ||
} else { | ||
url 'https://oss.sonatype.org/content/repositories/snapshots/' | ||
} | ||
|
||
credentials { | ||
username = project.properties.ossrhUsername | ||
password = project.properties.ossrhPassword | ||
} | ||
pluginBundle { | ||
website = 'https://trustin.github.io/sphinx-gradle-plugin/' | ||
vcsUrl = 'https://github.com/trustin/sphinx-gradle-plugin' | ||
plugins { | ||
sphinxPlugin { | ||
id = 'kr.motd.sphinx' | ||
displayName = "${project.name}" | ||
description = 'Sphinx site generation plugin for Gradle' | ||
tags = ['documentation', 'generator', 'python', 'site', 'site-generator', 'sphinx'] | ||
} | ||
} | ||
publications { | ||
jar(MavenPublication) { | ||
pom.withXml { | ||
NodeList children = asNode().children() | ||
Node dependencies = children.find { it.name().localPart == 'dependencies' } as Node | ||
|
||
children[children.indexOf(dependencies) - 1] + { | ||
resolveStrategy = Closure.DELEGATE_FIRST | ||
name "${project.name}" | ||
description 'Sphinx site generation plugin for Gradle' | ||
url 'http://trustin.github.io/sphinx-gradle-plugin/' | ||
licenses { | ||
license { | ||
name 'The Apache License, Version 2.0' | ||
url 'http://www.apache.org/license/LICENSE-2.0.txt' | ||
distribution 'repo' | ||
} | ||
} | ||
inceptionYear 2016 | ||
organization { | ||
name 'Trustin Lee et al' | ||
url 'http://trustin.github.io/sphinx-maven-plugin/' | ||
} | ||
developers { | ||
developer { | ||
id 'trustin' | ||
name 'Trustin Lee' | ||
url 'https://github.com/trustin' | ||
} | ||
} | ||
scm { | ||
url 'https://github.com/trustin/sphinx-gradle-plugin' | ||
connection 'scm:git:https://github.com/trustin/sphinx-gradle-plugin.git' | ||
developerConnection 'scm:git:ssh://[email protected]/trustin/sphinx-gradle-plugin.git' | ||
} | ||
} | ||
|
||
// Exclude Maven-related transitive dependencies. | ||
dependencies.children().find { it.artifactId.text() == 'sphinx-maven-plugin' } | ||
.children().last() + { | ||
|
||
resolveStrategy = Closure.DELEGATE_FIRST | ||
exclusions { | ||
exclusion { | ||
groupId 'org.apache.maven.shared' | ||
artifactId 'maven-filtering' | ||
} | ||
exclusion { | ||
groupId 'org.apache.maven.reporting' | ||
artifactId 'maven-reporting-api' | ||
} | ||
exclusion { | ||
groupId 'org.apache.maven.reporting' | ||
artifactId 'maven-reporting-impl' | ||
} | ||
} | ||
} | ||
} | ||
|
||
from components.java | ||
|
||
artifact(sourceJar) { | ||
classifier = 'sources' | ||
} | ||
artifact(javadocJar) { | ||
classifier = 'javadoc' | ||
} | ||
|
||
// Sign the pom.xml and artifacts. | ||
if (signing.required) { | ||
// Sign the pom.xml. | ||
pom.withXml { | ||
writeTo(project.ext.pomFile) | ||
def pomAscFile = signing.sign(project.ext.pomFile).signatureFiles[0] | ||
artifact(pomAscFile) { | ||
classifier = null | ||
extension = 'pom.asc' | ||
} | ||
project.ext.pomFile.delete() | ||
} | ||
|
||
// Sign the artifacts. | ||
project.tasks.signArchives.signatureFiles.each { | ||
artifact(it) { | ||
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/ | ||
if (matcher.find()) { | ||
classifier = matcher.group(1) | ||
} else { | ||
classifier = null | ||
} | ||
extension = 'jar.asc' | ||
} | ||
} | ||
} | ||
} | ||
mavenCoordinates { | ||
groupId = "${project.group}" | ||
artifactId = "${project.name}" | ||
} | ||
} | ||
|
||
model { | ||
tasks.publishJarPublicationToMavenLocal { | ||
dependsOn(project.tasks.signArchives) | ||
} | ||
tasks.publishJarPublicationToMavenRepository { | ||
dependsOn(project.tasks.signArchives) | ||
} | ||
} | ||
|
||
task install(dependsOn: publishToMavenLocal) | ||
|
||
task site(type: JavaExec, dependsOn: install) { | ||
task site(type: JavaExec, dependsOn: tasks.check) { | ||
inputs.dir "${project.projectDir}/src/sphinx" | ||
outputs.dir "${project.buildDir}/site" | ||
classpath sourceSets.test.runtimeClasspath | ||
|
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
Oops, something went wrong.