From 27d884db7b45acab4f4bdc6ab5d23890a73143ed Mon Sep 17 00:00:00 2001 From: Paul Taykalo Date: Fri, 24 Oct 2014 14:57:58 +0300 Subject: [PATCH] Revert "Feature/appcode3 xcodepath" --- Scripts/dyci-recompile.py | 16 ++++----- .../dyci/DyciRecompileAndInjectAction.java | 36 +------------------ 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/Scripts/dyci-recompile.py b/Scripts/dyci-recompile.py index ec3d3db..45f649f 100755 --- a/Scripts/dyci-recompile.py +++ b/Scripts/dyci-recompile.py @@ -162,15 +162,13 @@ def copyResource(source, dyci): os.chdir(workingDir) params = params[:-1] -if len(args)>1: - xcodeLocation = args[2] -else: - # Searching where is Xcode with it's Clang located - process = Popen(["xcode-select","-print-path"], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - xcodeLocation, err = process.communicate() - xcodeLocation = xcodeLocation.rstrip(os.linesep) + +# Searching where is Xcode with it's Clang located +process = Popen(["xcode-select","-print-path"], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) +xcodeLocation, err = process.communicate() +xcodeLocation = xcodeLocation.rstrip(os.linesep) compileString = [xcodeLocation + '/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-real'] \ + params diff --git a/Support/AppCode/Dyci/src/com/stanfy/dyci/DyciRecompileAndInjectAction.java b/Support/AppCode/Dyci/src/com/stanfy/dyci/DyciRecompileAndInjectAction.java index 0f7de45..5ee2ec6 100644 --- a/Support/AppCode/Dyci/src/com/stanfy/dyci/DyciRecompileAndInjectAction.java +++ b/Support/AppCode/Dyci/src/com/stanfy/dyci/DyciRecompileAndInjectAction.java @@ -15,13 +15,9 @@ import java.io.BufferedReader; import java.io.File; -import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; -import javax.xml.xpath.*; -import org.xml.sax.InputSource; - /** * Created with IntelliJ IDEA. * User: paultaykalo @@ -52,24 +48,6 @@ public void actionPerformed(final AnActionEvent actionEvent) { this.injectFile(actionEvent, path); - } - - private String xcodePath(java.io.FileReader fileReader){ - String xpathExpression = "/application/component[@name='XcodeSettings']/option[@name='selectedXcode']/@value"; - - XPathFactory xpathFactory = XPathFactory.newInstance(); - XPath xpath = xpathFactory.newXPath(); - try{ - XPathExpression expr = xpath.compile(xpathExpression); - InputSource inputSource = new InputSource(fileReader); - String result = expr.evaluate(inputSource); - return result; - - } catch(Exception e){ - LOG.error("Exception getting Xcode path: " + e.getMessage()); - this.showMessageBubble(actionEvent, MessageType.ERROR, "Failed to run injection script"); - } - } private void injectFile(final AnActionEvent actionEvent, final String path) { @@ -91,21 +69,9 @@ private void injectFile(final AnActionEvent actionEvent, final String path) { this.showMessageBubble(actionEvent, MessageType.ERROR, "Cannot run injection. No Dyci scripts were found. Make sure, that you've ran install.sh"); return; } - - String appcodeOptionsFilename = System.getProperty("user.home") + "/Library/Preferences/appCode30/options/other.xml"; - - String[] commands; - try { - FileReader appcodeOptions = new FileReader(appcodeOptionsFilename); - String xcodePath = xcodePath(appcodeOptions); - commands = new String[] {dyciScriptLocation, path, xcodePath}; - } catch(IOException e) { - // If the file cannot be found, it might not be a problem (user has appcode 2 or maybe the setting wasn't saved) - // We'll just leave it up to the dyci script to find Xcode. - commands = new String[] {dyciScriptLocation, path}; - } Runtime rt = Runtime.getRuntime(); + String[] commands = {dyciScriptLocation, path}; try { Process proc = rt.exec(commands);