Skip to content

Commit

Permalink
use Ti.Filesystem.getFileStream so we're backwards compatible with
Browse files Browse the repository at this point in the history
Desktop 1.0, also check platform-tools for adb when validating the
Android SDK [#88] [#90 state:fixed-in-qa]
  • Loading branch information
marshall committed Dec 12, 2010
1 parent 53a06d9 commit 1d0f5f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Resources/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ TiDev.validateAndroidSDK = function(sdkDir, callback)
var addons = Titanium.Filesystem.getFile(sdkDir, "add-ons");
var platforms = Titanium.Filesystem.getFile(sdkDir, "platforms");
var tools = Titanium.Filesystem.getFile(sdkDir, "tools");
var platformTools = Titanium.Filesystem.getFile(sdkDir, 'platform-tools');

var isSDK = addons.exists() && platforms.exists() && tools.exists();
if (!isSDK)
Expand All @@ -1454,6 +1455,10 @@ TiDev.validateAndroidSDK = function(sdkDir, callback)

var adbFile = Titanium.Filesystem.getFile(tools, adb);
var androidFile = Titanium.Filesystem.getFile(tools, android);
if (!adbFile.exists())
{
adbFile = Titanium.Filesystem.getFile(platformTools, adb);
}

var toolsExist = adbFile.exists() && androidFile.exists();
if (!toolsExist)
Expand Down
12 changes: 6 additions & 6 deletions Resources/perspectives/projects/js/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ $('#new_project_button').click(function()
Projects.importProject = function(f)
{
var dir = f;
var file = TFS.getFile(dir,'manifest');
var file = TFS.getFile(dir, 'manifest');
if (file.exists() == false)
{
alert('This directory does not contain valid Titanium project. Please try again.');
Expand All @@ -1483,11 +1483,11 @@ Projects.importProject = function(f)
options.dir = dir;

// read manifest values to create new db record
var line = file.readLine(true);
while (line != null)
var stream = TFS.getFileStream(dir, 'manifest');
stream.open();
for (var line = stream.readLine(); line != null; line = stream.readLine())
{
var entry = Titanium.Project.parseEntry(line);
var line = file.readLine(false);
var entry = Titanium.Project.parseEntry(line.toString());
if (entry == null)
continue;

Expand Down Expand Up @@ -1544,7 +1544,7 @@ Projects.importProject = function(f)
options.php = 'on';
}
}
//stream.close();
stream.close();

// Settings in tiapp.xml always override the manifest.
var xmlDocument = (new DOMParser()).parseFromString(
Expand Down

0 comments on commit 1d0f5f6

Please sign in to comment.