com.jdroid.gradle.GradleProjectPlugin.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdroid-gradle-project-plugin Show documentation
Show all versions of jdroid-gradle-project-plugin Show documentation
Gradle Plugin for Gradle Plugin projects
package com.jdroid.gradle
import com.jdroid.gradle.commons.JavaBaseGradlePlugin
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.Project
public class GradleProjectPlugin extends JavaBaseGradlePlugin {
public void apply(Project project) {
super.apply(project)
project.ext.PACKAGING = 'jar'
project.apply plugin: 'groovy'
project.apply plugin: 'java-gradle-plugin'
project.dependencies {
compile localGroovy()
}
Boolean isOpenSourceEnabled = jdroid.getBooleanProp("OPEN_SOURCE_ENABLED", true)
if (isOpenSourceEnabled) {
project.task('javadocJar', type: Jar) {
classifier = 'javadoc'
from project.javadoc
}
project.task('sourcesJar', type: Jar) {
classifier = 'sources'
from project.sourceSets.main.allSource
}
project.artifacts {
archives project.tasks.javadocJar, project.tasks.sourcesJar
}
}
}
protected Class extends GradleProjectExtension> getExtensionClass() {
return GradleProjectExtension.class;
}
}