diff --git a/src/main/groovy/wooga/gradle/unity/UnityPluginConventions.groovy b/src/main/groovy/wooga/gradle/unity/UnityPluginConventions.groovy index 9afd6b7e..1091d27a 100644 --- a/src/main/groovy/wooga/gradle/unity/UnityPluginConventions.groovy +++ b/src/main/groovy/wooga/gradle/unity/UnityPluginConventions.groovy @@ -52,6 +52,12 @@ class UnityPluginConventions implements PlatformUtilsImpl { */ static File UNITY_LICENSE_DIRECTORY_MAC_OS = new File("/Library/Application Support/Unity/") + /** + * {@code File} to Unity license directory on macOS. + * @value "/Library/Application Support/Unity/" + */ + static File UNITY_LICENSE_DIRECTORY_LINUX = new File("${unixUserHomePath}/share/unity3d/Unity/") + /** * {@code File} to Unity license directory on windows. * @value "C:\ProgramData\Unity" @@ -66,7 +72,7 @@ class UnityPluginConventions implements PlatformUtilsImpl { /** * The path to the Unity Editor executable */ - static final PropertyLookup unityPath = new PropertyLookup(["UNITY_UNITY_PATH","UNITY_PATH"], "unity.unityPath", { getPlatformUnityPath().absolutePath }) + static final PropertyLookup unityPath = new PropertyLookup(["UNITY_UNITY_PATH", "UNITY_PATH"], "unity.unityPath", { getPlatformUnityPath().absolutePath }) /** * Used for authentication with Unity's servers */ @@ -118,9 +124,9 @@ class UnityPluginConventions implements PlatformUtilsImpl { licensePath = UnityPluginConventions.UNITY_LICENSE_DIRECTORY_WIN } else if (isMac()) { licensePath = UnityPluginConventions.UNITY_LICENSE_DIRECTORY_MAC_OS - } - else{ - licensePath = new File("") + } else { + licensePath = UnityPluginConventions.UNITY_LICENSE_DIRECTORY_LINUX + } licensePath diff --git a/src/main/groovy/wooga/gradle/unity/utils/PlatformUtils.groovy b/src/main/groovy/wooga/gradle/unity/utils/PlatformUtils.groovy index 62ca9bae..da2cbf13 100644 --- a/src/main/groovy/wooga/gradle/unity/utils/PlatformUtils.groovy +++ b/src/main/groovy/wooga/gradle/unity/utils/PlatformUtils.groovy @@ -59,6 +59,14 @@ trait PlatformUtilsImpl { } path } + + /** + * Returns the pat to the usr directory in UNIX + * @return + */ + static String getUnixUserHomePath() { + System.getProperty("user.home") + } } class PlatformUtils implements PlatformUtilsImpl {