All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jdroid.gradle.GradleProjectPlugin.groovy Maven / Gradle / Ivy

There is a newer version: 0.18.0
Show newest version
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 getExtensionClass() {
		return GradleProjectExtension.class;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy