mirror of
https://github.com/ethauvin/CompileOnlyPlugin.git
synced 2025-04-25 00:37:14 -07:00
It adds the java plugin automatically if the java or the groovy plugin is missing. When the idea or eclipse plugin is used, it also adds the new dependencies to their provided scope
84 lines
1.7 KiB
Groovy
84 lines
1.7 KiB
Groovy
import org.gradle.api.artifacts.maven.MavenDeployment
|
|
|
|
apply plugin: 'groovy'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'signing'
|
|
|
|
|
|
dependencies {
|
|
compile gradleApi()
|
|
compile localGroovy()
|
|
}
|
|
|
|
task sourcesJar(type: Jar) {
|
|
from sourceSets.main.allSource
|
|
classifier = 'sources'
|
|
archiveName = archiveName.toLowerCase()
|
|
}
|
|
|
|
jar {
|
|
archiveName = archiveName.toLowerCase()
|
|
}
|
|
|
|
task javadocJar(type: Jar, dependsOn: groovydoc) {
|
|
from 'build/docs/groovydoc'
|
|
classifier = 'javadoc'
|
|
archiveName = archiveName.toLowerCase()
|
|
}
|
|
|
|
artifacts {
|
|
archives jar
|
|
archives javadocJar
|
|
archives sourcesJar
|
|
}
|
|
|
|
if (hasProperty('sonatypeUsername')) {
|
|
signing {
|
|
sign configurations.archives
|
|
}
|
|
|
|
uploadArchives {
|
|
repositories {
|
|
mavenDeployer {
|
|
beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
|
|
|
|
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
|
|
authentication(userName: sonatypeUsername, password: sonatypePassword)
|
|
}
|
|
pom {
|
|
project {
|
|
name 'CompileOnlyPlugin'
|
|
packaging 'jar'
|
|
description 'Adds a compile only configuration to the Java plugin of Gradle'
|
|
url 'http://coders-kitchen.github.com'
|
|
|
|
scm {
|
|
url 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git'
|
|
connection 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git'
|
|
developerConnection 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git'
|
|
}
|
|
|
|
licenses {
|
|
license {
|
|
name 'The MIT License (MIT)'
|
|
url 'http://opensource.org/licenses/MIT'
|
|
distribution 'repo'
|
|
}
|
|
}
|
|
|
|
|
|
developers {
|
|
developer {
|
|
id 'peterdaum'
|
|
name 'Peter Daum'
|
|
}
|
|
}
|
|
}
|
|
artifactId = project.name.toLowerCase()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|