Navigation Menu

Skip to content

Commit

Permalink
Preliminary support for iOS universal binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
sptramer committed Jan 21, 2011
1 parent 548ad70 commit d2072f2
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 34 deletions.
Binary file added Resources/images/iOS.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 16 additions & 16 deletions Resources/modules/packaging/js/packaging.js
Expand Up @@ -204,7 +204,9 @@ $MQL('l:tidev.projects.row_selected',function(msg)
var file = Titanium.Filesystem.getFile(Titanium.App.appURLToPath('modules/packaging/packaging.html'));
$('#tiui_content_right').get(0).innerHTML = file.read();

if (PackageProject.currentProject.type == 'mobile' || PackageProject.currentProject.type == 'ipad')
if (PackageProject.currentProject.type == 'mobile' ||
PackageProject.currentProject.type == 'ipad' ||
PackageProject.currentProject.type == 'universal')
{
PackageProject.setupMobileView();
}
Expand Down Expand Up @@ -288,7 +290,9 @@ PackageProject.setupView = function()
// get current project
PackageProject.currentProject = Projects.getProject();

if (PackageProject.currentProject.type == 'mobile' || PackageProject.currentProject.type == 'ipad')
if (PackageProject.currentProject.type == 'mobile' ||
PackageProject.currentProject.type == 'ipad' ||
PackageProject.currentProject.type == 'universal')
{
PackageProject.setupMobileView();
}
Expand Down Expand Up @@ -666,11 +670,7 @@ PackageProject.setupMobileView = function()
// check project for iphone
if (Titanium.Filesystem.getFile(PackageProject.currentProject.dir, 'build','iphone').exists() == true)
{
var deviceFamily = 'iphone'
if (PackageProject.currentProject.type == 'ipad')
{
deviceFamily = 'ipad';
}
var deviceFamily = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;

// setup distribution validation
PackageProject.iPhoneDistValidator = TiUI.validator('iphone_dist',function(valid)
Expand Down Expand Up @@ -925,7 +925,7 @@ PackageProject.setupMobileView = function()
var html = '';
for(var i=0;i<json.sdks.length;i++)
{
if (PackageProject.currentProject.type == 'ipad')
if (PackageProject.currentProject.type == 'ipad' || PackageProject.currentProject.type == 'universal')
{
// ipad started with 3.2
if (json.sdks[i].substring(0,3) == '3.2' || parseInt(json.sdks[i][0])>3)
Expand Down Expand Up @@ -1198,7 +1198,7 @@ PackageProject.setupMobileView = function()
var certName = PackageProject.getIPhoneAttribute('dist_name');
var location = $('#iphone_dist_location').val();
var sdk = $('#iphone_distribution_sdk').val();
var type = (PackageProject.currentProject.type=='mobile')?'iphone':'ipad';
var type = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;
Titanium.Analytics.featureEvent(type +'.distribute',{sdk:sdk,appid:PackageProject.currentProject.appid,name:PackageProject.currentProject.name,guid:PackageProject.currentProject.guid,certName:certName});
var x = TiDev.launchPython([Titanium.Filesystem.getFile(PackageProject.iPhoneEmulatorPath).toString(),'distribute','"'+sdk+'"', '"'+ PackageProject.currentProject.dir+ '"',PackageProject.currentProject.appid, '"' + PackageProject.currentProject.name+ '"', uuid,'"'+certName+'"','"'+location+'"', deviceFamily]);
var buffer = '';
Expand Down Expand Up @@ -1234,7 +1234,7 @@ PackageProject.setupMobileView = function()
if ($(this).hasClass('disabled')==false)
{
var sdk = $('#iphone_device_sdk').val();
var type = (PackageProject.currentProject.type=='mobile')?'iphone':'ipad';
var type = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;
Titanium.Analytics.featureEvent(type+'.install',{sdk:sdk,guid:PackageProject.currentProject.guid,devName:devName,appid:PackageProject.currentProject.appid,name:PackageProject.currentProject.name});
var x = TiDev.launchPython([Titanium.Filesystem.getFile(PackageProject.iPhoneEmulatorPath).toString(),'install','"'+sdk+'"', '"'+ PackageProject.currentProject.dir+ '"',PackageProject.currentProject.appid, '"' + PackageProject.currentProject.name+ '"','"'+uuid+'"', '"'+devName + '"', deviceFamily]);
var buffer = '';
Expand Down Expand Up @@ -1303,7 +1303,7 @@ PackageProject.setupMobileView = function()
PackageProject.inConsoleMode = true;

var sdk = $('#iphone_emulator_sdk').val();
var type = (PackageProject.currentProject.type=='mobile')?'iphone':'ipad';
var type = (PackageProject.currentProject.type=='mobile') ? 'iphone' : PackageProject.currentProject.type;
Titanium.Analytics.featureEvent(type+'.simulator',{sdk:sdk,appid:PackageProject.currentProject.appid,name:PackageProject.currentProject.name,guid:PackageProject.currentProject.guid});

// kill if still running
Expand Down Expand Up @@ -1876,7 +1876,8 @@ PackageProject.setupMobileView = function()
});

// setup ipad UI
if (PackageProject.currentProject.type == 'ipad')
if (PackageProject.currentProject.type == 'ipad' ||
PackageProject.currentProject.type == 'universal')
{
$('#tab_iphone_dev').css('display','none');
$('#tab_android_dev').css('display','none');
Expand All @@ -1888,10 +1889,7 @@ PackageProject.setupMobileView = function()
$('#mobile_emulator_iphone').click();
$('#tab_iphone_dev').click();
$('#tab_iphone_package').click();

}


};


Expand Down Expand Up @@ -2434,7 +2432,9 @@ PackageProject.initializeConsoleWidth = function()

if (PackageProject.currentProject==null)return;
// set container height
if (PackageProject.currentProject.type == 'mobile' || PackageProject.currentProject.type == 'ipad' )
if (PackageProject.currentProject.type == 'mobile' ||
PackageProject.currentProject.type == 'ipad' ||
PackageProject.currentProject.type == 'universal')
{
$(".detail").css('height',(height+94)+'px');
$('.debug_console').css('width',(rightWidth-320) + 'px').css('height',(height - 26) + 'px');
Expand Down
13 changes: 11 additions & 2 deletions Resources/modules/project_edit/js/project_edit.js
Expand Up @@ -73,19 +73,28 @@ EditProject.setFormData = function(p)
$('#edit_project_version').val(p.version);
$('#edit_project_copyright').val(p.copyright);

if (p.type == 'mobile' || p.type== 'ipad')
if (p.type == 'mobile' || p.type== 'ipad' || p.type == 'universal')
{
$('#edit_project_type').html('(Mobile Application)');
$('#language_modules').css('display','none');
if (p.type=='ipad')

if (p.type=='universal')
{
$('#mobile_icon').css('display','none');
$('#ipad_icon').css('display','none');
$('#ios_icon').css('display','inline');
}
else if (p.type=='ipad')
{
$('#mobile_icon').css('display','none');
$('#ipad_icon').css('display','inline');
$('#ios_icon').css('display','none');
}
else
{
$('#mobile_icon').css('display','inline');
$('#ipad_icon').css('display','none');
$('#ios_icon').css('display','none');
}
$('#desktop_icon').css('display','none');
$('#project_edit_lang_modules').css('display','none');
Expand Down
2 changes: 1 addition & 1 deletion Resources/modules/project_edit/project_edit.html
Expand Up @@ -6,7 +6,7 @@
<img src="modules/project_edit/images/desktop.png" id ="desktop_icon"/>
<img src="modules/project_edit/images/mobile.png" id="mobile_icon"/>
<img src="images/ipad.png" id="ipad_icon" id="ipad_icon"/>

<img src="images/iOS.png" id="ios_icon"/>
</span>
</td>
<td width="88%" valign="middle">
Expand Down
21 changes: 8 additions & 13 deletions Resources/perspectives/projects/js/projects.js
Expand Up @@ -1108,8 +1108,8 @@ Projects.handleNewProjectClick = function()
// set scripts for current sdk version
iPhonePrereqPath = Titanium.Filesystem.getFile(sdk.getPath(),'iphone/prereq.py');
androidPrereqPath = Titanium.Filesystem.getFile(sdk.getPath(),'android/prereq.py');

if ($(this).val()=='ipad')
if ($(this).val()=='ipad' || $(this).val()=='universal')
{
if (Titanium.platform != 'osx')
{
Expand All @@ -1121,7 +1121,6 @@ Projects.handleNewProjectClick = function()
$('#desktop_language_modules').css('display','none');
if (Projects.hasIPad ==false)
{

TiDev.setConsoleMessage('Checking for iPad prerequisites...');

// run ipad prereq check
Expand All @@ -1139,16 +1138,13 @@ Projects.handleNewProjectClick = function()
{
alert('The iPad requires version 3.2 of the iPhone SDK. Please install to continue');
$('#new_project_type').val('desktop')
return;
}
});
iPadCheck.launch();
}

}
else if ($(this).val() == 'mobile')
{

$('#mobile_platforms').css('display','block');
$('#desktop_language_modules').css('display','none');

Expand Down Expand Up @@ -1179,8 +1175,8 @@ Projects.handleNewProjectClick = function()
$('#iphone_sdk_true').css('display','block');
$('#iphone_sdk_false').css('display','none');

TiDev.setConsoleMessage('Success! Now checking for Android...');
Projects.hasIPhone = true;
TiDev.setConsoleMessage('Success! Now checking for Android...');
checkAndroid();
},1000);

Expand All @@ -1191,9 +1187,9 @@ Projects.handleNewProjectClick = function()
alert('XCode is not installed. It is required for iPhone.');
TiDev.setConsoleMessage('Checking for Android prerequisites...');
checkAndroid();

}
// no 3.0 SDK
// Handled for Universal by iPad iOS version check
else if (e == 2)
{
alert('You must have iPhone SDK installed. We cannot find it.');
Expand Down Expand Up @@ -1284,11 +1280,9 @@ Projects.handleNewProjectClick = function()
});
androidCheck.launch();
};


}
}
else
else
{
$('#mobile_platforms').css('display','none');
$('#desktop_language_modules').css('display','block');
Expand Down Expand Up @@ -1419,7 +1413,7 @@ Projects.handleNewProjectClick = function()
$('#new_project_type').bind('change',function()
{

if ($(this).val() == 'mobile' || $(this).val() == 'ipad')
if ($(this).val() == 'mobile' || $(this).val() == 'ipad' || $(this).val() == 'universal')
{
$('#language_modules').addClass('disabled');
$('#new_project_ruby').attr('disabled','true');
Expand Down Expand Up @@ -1588,6 +1582,7 @@ Projects.importProject = function(f)
alert('You are importing a '+options.type + ' project, but no Mobile SDK versions exist on your system');
return;
}
// TODO: Allow import support as a universal
// see if ipad is an option
if (Titanium.platform == 'osx' && Projects.hasIPad==false)
{
Expand Down Expand Up @@ -1728,7 +1723,7 @@ Projects.createProject = function(options, createProjectFiles)
else
{
var args = [options.name , options.id, options.dir];
if (options.iphone == true || options.type == 'ipad')
if (options.iphone == true || options.type == 'ipad' || options.type == 'universal')
{
args.push('iphone');
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/perspectives/projects/new_project.html
Expand Up @@ -16,7 +16,7 @@
<option value="desktop" selected>Desktop</option>
<option value="mobile">Mobile</option>
<option value="ipad">iPad</option>

<option value="universal">Universal iOS</option>
</select>
</div>
<div style="clear:both;height:10px"></div>
Expand Down
2 changes: 1 addition & 1 deletion tiapp.xml
Expand Up @@ -2,7 +2,7 @@
<ti:app xmlns:ti='http://ti.appcelerator.org'>
<id>com.appcelerator.titanium.developer</id>
<name>Titanium Developer</name>
<version>1.2.3</version>
<version>1.2.5</version>
<publisher>Appcelerator</publisher>
<url>http://www.appcelerator.com</url>
<icon>titanium.png</icon>
Expand Down

0 comments on commit d2072f2

Please sign in to comment.