mirror of
https://github.com/ethauvin/CompileOnlyPlugin.git
synced 2025-04-24 16:37:10 -07:00
Merge pull request #2 from ethauvin/master
Added support for inclusion in the Grade Plugin Portal to build.gradle.
This commit is contained in:
commit
bf9b61b3f6
2 changed files with 51 additions and 6 deletions
14
README.md
14
README.md
|
@ -1,13 +1,13 @@
|
||||||
CompileOnlyPlugin
|
CompileOnlyPlugin
|
||||||
=================
|
=================
|
||||||
|
|
||||||
Adds a _compileOnly_ configuration to a Java based gradle build.
|
Adds a _compileOnly_ configuration to a Java based Gradle build.
|
||||||
|
|
||||||
The plugin will also take care of registering the _compilyOnly_ dependencies to the matching scopes of IntelliJ Idea and Eclipse
|
The plugin will also take care of registering the _compilyOnly_ dependencies to the matching scopes of IntelliJ Idea and Eclipse
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
Add the following lines to your gradle build script
|
Add the following lines to your Gradle build script:
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -23,3 +23,13 @@ Add the following lines to your gradle build script
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly <dependencies>
|
compileOnly <dependencies>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
or if using Gradle 2.1 or higher:
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'com.coders-kitchen.compileonlyplugin' version '1.0.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compileOnly <dependencies>
|
||||||
|
}
|
43
build.gradle
43
build.gradle
|
@ -1,15 +1,37 @@
|
||||||
import org.gradle.api.artifacts.maven.MavenDeployment
|
import org.gradle.api.artifacts.maven.MavenDeployment
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "java-gradle-plugin"
|
||||||
|
id "com.gradle.plugin-publish" version "0.9.4"
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'groovy'
|
apply plugin: 'groovy'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
|
||||||
|
def mvnName = 'CompileOnlyPlugin'
|
||||||
|
def mvnUrl = 'http://coders-kitchen.github.com' // 404, maybe use https://github.com/coders-kitchen/CompileOnlyPlugin instead?
|
||||||
|
def mvnDescription = 'Adds a compile only configuration to the Java plugin of Gradle'
|
||||||
|
def pluginId = 'com.coders-kitchen.compileonlyplugin'
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile gradleApi()
|
compile gradleApi()
|
||||||
compile localGroovy()
|
compile localGroovy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gradlePlugin {
|
||||||
|
plugins {
|
||||||
|
compileOnlyPlugin {
|
||||||
|
id = pluginId
|
||||||
|
implementationClass = "com.coderskitchen.compileonly.CompileOnlyPlugin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
task sourcesJar(type: Jar) {
|
task sourcesJar(type: Jar) {
|
||||||
from sourceSets.main.allSource
|
from sourceSets.main.allSource
|
||||||
classifier = 'sources'
|
classifier = 'sources'
|
||||||
|
@ -32,7 +54,8 @@ artifacts {
|
||||||
archives sourcesJar
|
archives sourcesJar
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasProperty('sonatypeUsername')) {
|
if (hasProperty('sonatypeUsername'))
|
||||||
|
{
|
||||||
signing {
|
signing {
|
||||||
sign configurations.archives
|
sign configurations.archives
|
||||||
}
|
}
|
||||||
|
@ -47,10 +70,10 @@ if (hasProperty('sonatypeUsername')) {
|
||||||
}
|
}
|
||||||
pom {
|
pom {
|
||||||
project {
|
project {
|
||||||
name 'CompileOnlyPlugin'
|
name mvnName
|
||||||
packaging 'jar'
|
packaging 'jar'
|
||||||
description 'Adds a compile only configuration to the Java plugin of Gradle'
|
description mvnDescription
|
||||||
url 'http://coders-kitchen.github.com'
|
url mvnUrl
|
||||||
|
|
||||||
scm {
|
scm {
|
||||||
url 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git'
|
url 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git'
|
||||||
|
@ -81,4 +104,16 @@ if (hasProperty('sonatypeUsername')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pluginBundle {
|
||||||
|
website = mvnUrl
|
||||||
|
vcsUrl = 'https://github.com/coders-kitchen/CompileOnlyPlugin'
|
||||||
|
description = mvnDescription
|
||||||
|
tags = ['compile', 'compileOnly', 'java']
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
compileOnlyPlugin {
|
||||||
|
id = pluginId
|
||||||
|
displayName = mvnName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue