blob: aea4b7ac27505c53344e79c321f73ddf2b8ad623 [file] [log] [blame]
* Copyright (c) 2015 the original author or authors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* Contributors:
* Donát Csikós (Gradle Inc.) - initial API and implementation and initial documentation
package eclipsebuild
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin
* Gradle plug-in for building Eclipse features.
* <p/>
* It validates the existence of the files feature.xml,,, and META-INF/MANIFEST.MF. It also
* adds all files and folders that are defined by the bin.includes entry in the file to the feature jar.
class FeaturePlugin implements Plugin<Project> {
public void apply(Project project) {
// apply the Java plugin to have the life-cycle tasks
// sync jar content with the file
// validate the content
static void validateRequiredFilesExist(Project project) {
project.gradle.taskGraph.whenReady {
// make sure the required descriptors exist
assert project.file('').exists()
// TODO - do features really need a MANIFEST.MF?
// assert project.file('META-INF/MANIFEST.MF').exists()
assert project.file('feature.xml').exists()
assert project.file('').exists()