Skip to content
Permalink
Browse files

JENKINS-30321: Unity Linux Editor Support (completely untested)

  • Loading branch information
lacostej committed Sep 7, 2015
1 parent 7009f4f commit 648a04680f9a6503ea46c8c5444a84adc161a7a8
@@ -0,0 +1,24 @@
package org.jenkinsci.plugins.unity3d;

class Functions2 {
public static boolean isMac() {
return IS_OS_MAC;
}
public static boolean isLinux() {
return IS_OS_LINUX;
}
private static final boolean IS_OS_LINUX = getOSMatchesName("Linux") || getOSMatchesName("LINUX");
private static final boolean IS_OS_MAC = getOSMatchesName("Mac");

private static final String OS_NAME = System.getProperty("os.name");

private static boolean getOSMatchesName(String osNamePrefix) {
return isOSNameMatch(OS_NAME, osNamePrefix);
}
static boolean isOSNameMatch(String osName, String osNamePrefix) {
if (osName == null) {
return false;
}
return osName.startsWith(osNamePrefix);
}
}
@@ -94,8 +94,10 @@ boolean isVariableExpanded() {
private static File getExeFile(File unityHome) {
if (Functions.isWindows()) {
return new File(unityHome, "Editor/Unity.exe");
} else { // mac assumed
} else if (Functions2.isMac()) {
return new File(unityHome, "Contents/MacOS/Unity");
} else { // Linux assumed
return new File(unityHome, "Editor/Unity");
}
}

@@ -170,9 +172,12 @@ private File getEditorLogFile(String customLogFile) {
}
File applocaldata = new File(localAppData);
return new File(applocaldata, "Unity/Editor/Editor.log");
} else { // mac assumed
} else if (Functions2.isMac()) {
File userhome = new File(EnvVars.masterEnvVars.get("HOME"));
return new File(userhome, "Library/Logs/Unity/Editor.log");
} else { // Linux assumed
File userhome = new File(EnvVars.masterEnvVars.get("HOME"));
return new File(userhome, ".config/unity3d/Editor.log");
}
}

0 comments on commit 648a046

Please sign in to comment.
You can’t perform that action at this time.