use of org.gradle.nativeplatform.toolchain.Gcc in project gradle by gradle.
the class InstallExecutable method installWindows.
private void installWindows() {
final File executable = getExecutableFile().get().getAsFile();
installToDir(getLibDirectory().get().getAsFile());
StringBuilder toolChainPath = new StringBuilder();
NativeToolChain toolChain = getToolChain().get();
if (toolChain instanceof Gcc) {
// Gcc on windows requires the path to be set
toolChainPath.append("SET PATH=");
for (File pathEntry : ((Gcc) toolChain).getPath()) {
toolChainPath.append(pathEntry.getAbsolutePath()).append(";");
}
toolChainPath.append("%PATH%");
}
String runScriptText = "\n@echo off" + "\nSETLOCAL" + "\n" + toolChainPath + "\nCALL \"%~dp0lib\\" + executable.getName() + "\" %*" + "\nEXIT /B %ERRORLEVEL%" + "\nENDLOCAL" + "\n";
GFileUtils.writeFile(runScriptText, getRunScriptFile().get().getAsFile());
}
use of org.gradle.nativeplatform.toolchain.Gcc in project gradle by gradle.
the class InstallExecutable method installWindows.
private void installWindows(File executable, File runScript) {
StringBuilder toolChainPath = new StringBuilder();
NativeToolChain toolChain = getToolChain().get();
if (toolChain instanceof Gcc) {
// Gcc on windows requires the path to be set
toolChainPath.append("SET PATH=");
for (File pathEntry : ((Gcc) toolChain).getPath()) {
toolChainPath.append(pathEntry.getAbsolutePath()).append(";");
}
toolChainPath.append("%PATH%");
}
String runScriptText = "\n@echo off" + "\nSETLOCAL" + "\n" + toolChainPath + "\nCALL \"%~dp0lib\\" + executable.getName() + "\" %*" + "\nEXIT /B %ERRORLEVEL%" + "\nENDLOCAL" + "\n";
GFileUtils.writeFile(runScriptText, runScript);
}
Aggregations