use of org.gradle.api.internal.plugins.StartScriptGenerator in project gradle by gradle.
the class CreateStartScripts method generate.
@TaskAction
public void generate() {
StartScriptGenerator generator = new StartScriptGenerator(unixStartScriptGenerator, windowsStartScriptGenerator);
JavaModuleDetector javaModuleDetector = getJavaModuleDetector();
generator.setApplicationName(getApplicationName());
generator.setMainClassName(fullMainArgument());
generator.setDefaultJvmOpts(getDefaultJvmOpts());
generator.setOptsEnvironmentVar(getOptsEnvironmentVar());
generator.setExitEnvironmentVar(getExitEnvironmentVar());
generator.setClasspath(getRelativePath(javaModuleDetector.inferClasspath(mainModule.isPresent(), getClasspath())));
generator.setModulePath(getRelativePath(javaModuleDetector.inferModulePath(mainModule.isPresent(), getClasspath())));
if (StringUtils.isEmpty(getExecutableDir())) {
generator.setScriptRelPath(getUnixScript().getName());
} else {
generator.setScriptRelPath(getExecutableDir() + "/" + getUnixScript().getName());
}
generator.generateUnixScript(getUnixScript());
generator.generateWindowsScript(getWindowsScript());
}
use of org.gradle.api.internal.plugins.StartScriptGenerator in project gradle by gradle.
the class Wrapper method generate.
@TaskAction
void generate() {
File jarFileDestination = getJarFile();
File unixScript = getScriptFile();
FileResolver resolver = getFileLookup().getFileResolver(unixScript.getParentFile());
String jarFileRelativePath = resolver.resolveAsRelativePath(jarFileDestination);
writeProperties(getPropertiesFile());
writeWrapperTo(jarFileDestination);
StartScriptGenerator generator = new StartScriptGenerator();
generator.setApplicationName("Gradle");
generator.setMainClassName(GradleWrapperMain.class.getName());
generator.setClasspath(WrapUtil.toList(jarFileRelativePath));
generator.setOptsEnvironmentVar("GRADLE_OPTS");
generator.setExitEnvironmentVar("GRADLE_EXIT_CONSOLE");
generator.setAppNameSystemProperty("org.gradle.appname");
generator.setScriptRelPath(unixScript.getName());
generator.setDefaultJvmOpts(ImmutableList.of("-Xmx64m", "-Xms64m"));
generator.generateUnixScript(unixScript);
generator.generateWindowsScript(getBatchScript());
}
Aggregations