View unanswered posts | View active topics



Reply to topic  [ 5 posts ] 
Same project, compile for mobile or desktop 
Author Message
Member

Joined: Tue Mar 27, 2012 6:48 am
Posts: 50
Reply with quote
Hi there,

I've built many mobile projects so far using the "AS3 > AIR Mobile AS3 App" project template. I can get this to compile for iOS and Android from the same codebase. The automatic constant CONFIG::mobile is always true. As you all know, this is done by running PackageApp.bat

I've released several projects on the App Store and Google Play, but my next project will also be released on Steam for PC and Mac.

What is the best way to set up a single project so that I can compile for iOS/Android or for PC/Mac (.air) from a single codebase (preferably with CONFIG::mobile / CONFIG::desktop being set appropriately). I'm not asking about how to structure my AS3 code - I've got that covered - but how to set up the project and bat files?

Your help appreciated!
Peter


Fri Aug 05, 2016 9:32 am
Profile
Member

Joined: Tue Mar 27, 2012 6:48 am
Posts: 50
Reply with quote
So far I have:

1) Created two sub-folders under bat and place in correct files
bat\mobile\[batch files from new > AIR mobile AS3 app]
bat\desktop\[batch files from new > AIR AS3 projector]

2) Update all the batch files themselves to ensure paths to other batch files are correct

Now how do I get FD to do the right thing when I Run/Test?


Fri Aug 05, 2016 11:05 am
Profile
Member

Joined: Tue Mar 27, 2012 6:48 am
Posts: 50
Reply with quote
ok, new approach:

1) Created two sub-folders under bat and place in correct files
bat\mobile\[batch files from new > AIR mobile AS3 app]
bat\desktop\[batch files from new > AIR AS3 projector]

2) My precompile script detects my target platform (via compiler constant it reads from the .as3proj file), and then copies the files from bat\mobile or bat\desktop to bat\

Will see how that goes.


Fri Aug 05, 2016 10:16 pm
Profile
Member

Joined: Tue Mar 27, 2012 6:48 am
Posts: 50
Reply with quote
So, yep, that's basically working. I can create swf, ipa, apk and exe installer from the same project.
The only caveat is to create the dmg installer for mac I have to run adt on my mac, but that's not a big problem.


Sat Aug 06, 2016 6:29 am
Profile
Member

Joined: Thu Apr 10, 2014 7:51 am
Posts: 22
Reply with quote
Quote:
The automatic constant CONFIG::mobile is always true


This is set based on the value in Project > Properties > Platform. If you are targeting "AIR", CONFIG::mobile is false. If you are targeting "AIR Mobile", CONFIG::mobile is true.


Mon Oct 31, 2016 10:31 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.