|
|
@ -12,8 +12,9 @@ import java.io.OutputStream; |
|
|
|
import java.io.OutputStreamWriter; |
|
|
|
import java.io.OutputStreamWriter; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.logging.Level; |
|
|
|
|
|
|
|
import java.util.logging.Logger; |
|
|
|
import org.netbeans.api.project.Project; |
|
|
|
import org.netbeans.api.project.Project; |
|
|
|
import org.netbeans.api.project.ProjectInformation; |
|
|
|
|
|
|
|
import org.openide.DialogDisplayer; |
|
|
|
import org.openide.DialogDisplayer; |
|
|
|
import org.openide.NotifyDescriptor; |
|
|
|
import org.openide.NotifyDescriptor; |
|
|
|
import org.openide.NotifyDescriptor.Message; |
|
|
|
import org.openide.NotifyDescriptor.Message; |
|
|
@ -220,6 +221,7 @@ public class AndroidSdkTool { |
|
|
|
outReader.start(); |
|
|
|
outReader.start(); |
|
|
|
errReader.start(); |
|
|
|
errReader.start(); |
|
|
|
proc.waitFor(); |
|
|
|
proc.waitFor(); |
|
|
|
|
|
|
|
folder.refresh(); |
|
|
|
String mainActName = "mobile/src/" + packag.replaceAll("\\.", "/") + "/MainActivity.java"; |
|
|
|
String mainActName = "mobile/src/" + packag.replaceAll("\\.", "/") + "/MainActivity.java"; |
|
|
|
FileObject mainAct = project.getProjectDirectory().getFileObject(mainActName); |
|
|
|
FileObject mainAct = project.getProjectDirectory().getFileObject(mainActName); |
|
|
|
if (mainAct != null) { |
|
|
|
if (mainAct != null) { |
|
|
@ -229,7 +231,7 @@ public class AndroidSdkTool { |
|
|
|
out.close(); |
|
|
|
out.close(); |
|
|
|
lock.releaseLock(); |
|
|
|
lock.releaseLock(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new IOException("Cannot find " + mainActName); |
|
|
|
Logger.getLogger(AndroidSdkTool.class.getName()).log(Level.WARNING, "Cannot find {0}", mainActName); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (InterruptedException ex) { |
|
|
|
} catch (InterruptedException ex) { |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
@ -264,6 +266,7 @@ public class AndroidSdkTool { |
|
|
|
outReader.start(); |
|
|
|
outReader.start(); |
|
|
|
errReader.start(); |
|
|
|
errReader.start(); |
|
|
|
proc.waitFor(); |
|
|
|
proc.waitFor(); |
|
|
|
|
|
|
|
folder.refresh(); |
|
|
|
} catch (InterruptedException ex) { |
|
|
|
} catch (InterruptedException ex) { |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
|
Exceptions.printStackTrace(ex); |
|
|
|
} catch (IOException ex) { |
|
|
|
} catch (IOException ex) { |
|
|
@ -275,6 +278,7 @@ public class AndroidSdkTool { |
|
|
|
private static void updateAndroidManifest(Project project) { |
|
|
|
private static void updateAndroidManifest(Project project) { |
|
|
|
FileObject manifest = project.getProjectDirectory().getFileObject("mobile/AndroidManifest.xml"); |
|
|
|
FileObject manifest = project.getProjectDirectory().getFileObject("mobile/AndroidManifest.xml"); |
|
|
|
if (manifest == null) { |
|
|
|
if (manifest == null) { |
|
|
|
|
|
|
|
Logger.getLogger(AndroidSdkTool.class.getName()).log(Level.WARNING, "Could not find AndroidManifest.xml"); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
InputStream in = null; |
|
|
|
InputStream in = null; |
|
|
|