com.lingocoder.plugin.jarexec.JarExecExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jarexec.plugin Show documentation
Show all versions of jarexec.plugin Show documentation
A Gradle plugin that executes Java Jar files
The newest version!
/**
* A Gradle plugin that executes Java Jar files.
*
* Copyright (C) 2019 lingocoder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package com.lingocoder.plugin.jarexec;
import org.gradle.api.Project;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTree;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.provider.Property;
import java.io.File;
import java.util.List;
/**
* Provides properties for configuring the {@link ExecJar} Gradle task;
*/
public class JarExecExtension {
private final ListProperty args;
private final Property classpath;
private final Property jar;
private final Property mainClass;
private final Property watchInFile;
private final Property watchInFiles;
private final Property watchOutDir;
public JarExecExtension(Project project) {
this.args = project.getObjects().listProperty(String.class);
this.classpath = project.getObjects().property(FileCollection.class);
this.jar = project.getObjects().property(File.class);
this.mainClass = project.getObjects().property(String.class);
this.watchInFile = project.getObjects().property(File.class);
this.watchInFiles = project.getObjects().property(FileTree.class);
this.watchOutDir = project.getObjects().property(File.class);
}
public List getArgs() { return args.get(); }
public ListProperty getArgsProvider() {
return args;
}
public void setArgs(List args) {
this.args.set(args);
}
public FileCollection getClasspath() {
return classpath.get();
}
public Property getClasspathProvider() {
return classpath;
}
public void setClasspath(FileCollection classpath) {
this.classpath.set(classpath);
}
public File getJar() { return jar.get(); }
public Property getJarProvider() { return jar; }
public void setJar(File jar) { this.jar.set(jar); }
public String getMainClass() { return mainClass.get(); }
public Property getMainClassProvider() { return mainClass; }
public void setMainClass(String mainClass) { this.mainClass.set(mainClass); }
public File getWatchInFile() { return watchInFile.get(); }
public Property getWatchInFileProvider() { return watchInFile; }
public void setWatchInFile(File watchInFile) { this.watchInFile.set(watchInFile); }
public FileTree getWatchInFiles() { return watchInFiles.get(); }
public Property getWatchInFilesProvider() { return watchInFiles; }
public void setWatchInFiles(FileTree watchInFiles) { this.watchInFiles.set(watchInFiles); }
public File getWatchOutDir() { return watchOutDir.get(); }
public Property getWatchOutDirProvider() { return watchOutDir; }
public void setWatchOutDir(File watchOutDir) { this.watchOutDir.set(watchOutDir); }
}