PermissionManager updated to new android tools structure
This commit is contained in:
+16
-8
@@ -19,6 +19,9 @@ package org.jetbrains.kotlin.android.tests.run;
|
|||||||
import com.intellij.execution.configurations.GeneralCommandLine;
|
import com.intellij.execution.configurations.GeneralCommandLine;
|
||||||
import com.intellij.openapi.util.SystemInfo;
|
import com.intellij.openapi.util.SystemInfo;
|
||||||
import org.jetbrains.kotlin.android.tests.PathManager;
|
import org.jetbrains.kotlin.android.tests.PathManager;
|
||||||
|
import org.jetbrains.kotlin.android.tests.download.SDKDownloader;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
public class PermissionManager {
|
public class PermissionManager {
|
||||||
private PermissionManager() {
|
private PermissionManager() {
|
||||||
@@ -26,15 +29,20 @@ public class PermissionManager {
|
|||||||
|
|
||||||
public static void setPermissions(PathManager pathManager) {
|
public static void setPermissions(PathManager pathManager) {
|
||||||
if (!SystemInfo.isWindows) {
|
if (!SystemInfo.isWindows) {
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getPlatformToolsFolderInAndroidSdk() + "/aapt"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getPlatformToolsFolderInAndroidSdk() + "/adb"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getPlatformToolsFolderInAndroidSdk() + "/dx"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getToolsFolderInAndroidSdk() + "/emulator"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getToolsFolderInAndroidSdk() + "/ddms"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getToolsFolderInAndroidSdk() + "/android"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getToolsFolderInAndroidSdk() + "/emulator-arm"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getToolsFolderInAndroidSdk() + "/zipalign"));
|
|
||||||
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
|
RunUtils.execute(generateChmodCmd(pathManager.getAntBinDirectory() + "/ant"));
|
||||||
|
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
|
||||||
|
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setExecPermissionForSimpleNamedFiles(File folder) {
|
||||||
|
File[] files = folder.listFiles();
|
||||||
|
if (files != null) {
|
||||||
|
for (File file : files) {
|
||||||
|
if (file.isFile() && !file.getName().contains(".")) {
|
||||||
|
file.setExecutable(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user