forked from lacostej/jenkins-unity3d-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JENKINS-30321: Unity Linux Editor Support (completely untested)
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/java/org/jenkinsci/plugins/unity3d/Functions2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters