Skip to content

Commit

Permalink
修改adb 路径获取错误
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhichao committed Jun 4, 2021
1 parent ee2149a commit 5efca5c
Show file tree
Hide file tree
Showing 11 changed files with 2,216 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions .idea/artifacts/apicloud_intelliJ_plugin.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 1 addition & 17 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/inspectionProfiles/Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2,146 changes: 2,146 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.net.URL;
import java.util.Properties;
import java.util.Random;

Expand Down Expand Up @@ -163,6 +164,10 @@ public ApicloudProjectPeer createPeer() {
*/
@Override
public Icon getIcon() {
return new ImageIcon(getClass().getResource("/com/apicloud/plugin/icons/apicloud.png"));
URL url = getClass().getResource("/com/apicloud/plugin/icons/apicloud.png");
ImageIcon icon = new ImageIcon(url);
RunProperties.pluginsPath = url.getPath().split("!")[0].replace("file:", "").replace("ApicloudPlugins.jar", "");
System.out.println( "pluginsPath--> "+ RunProperties.pluginsPath);
return icon;
}
}
22 changes: 13 additions & 9 deletions src/com/apicloud/plugin/ui/createApp/CreateAppFrom.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.apicloud.plugin.run.WebStorm;
import com.apicloud.plugin.util.ProjectData;
import com.apicloud.plugin.util.RunProperties;
import com.intellij.ide.plugins.cl.PluginClassLoader;
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
import com.intellij.openapi.ui.TextBrowseFolderListener;
Expand Down Expand Up @@ -73,17 +74,20 @@ protected void onFileChosen(@NotNull VirtualFile chosenFile) {
}
}
});
Properties properties = System.getProperties();
String systemPath = properties.getProperty("idea.plugins.path");
WebStorm storm = RunProperties.getWebStorm("create");
String path = "";
if (storm.isMacOS()) {
path = systemPath + "/ApicloudPlugins/lib/tools/adb-ios";
} else if (storm.isLinux()) {
path = systemPath + "/ApicloudPlugins/lib/tools/adb-linux";
} else {
path = systemPath + "/ApicloudPlugins/lib/tools/adb.exe";
String path = null;
try {
if (storm.isMacOS()) {
path = RunProperties.pluginsPath + "/tools/adb-ios";
} else if (storm.isLinux()) {
path = RunProperties.pluginsPath + "/tools/adb-linux";
} else {
path = RunProperties.pluginsPath + "/tools/adb.exe";
}
} catch (Exception e) {

}

textField1.setText(path);

kongPanel.addMouseListener(new MouseAdapter() {
Expand Down
2 changes: 2 additions & 0 deletions src/com/apicloud/plugin/util/RunProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,6 @@ private static void openTcp(String[] devs, WebStorm webStorm, String projectName
}
}


public static String pluginsPath;
}

0 comments on commit 5efca5c

Please sign in to comment.