Closed bmichotte closed 8 years ago
Very nice! May I suggest we rename the ios
directory into cocoa
then? It would make more sense as we use Foundation-level APIs that exist in all platforms. And we can support watchOS
and tvOS
similarly.
If we even need to call iOS-specific APIs in a library we could then adopt a subfolder strategy (ex. cocoa/ios
).
I like this idea ! Do you want I rename the directories into my PR ?
Also, with this change, we can get rid of osx.rb
and ios.rb
to cocoa.rb
and simply use Motion::Project::App.template
to load the right directories
Agreed. @jjaffeux do you also agree?
@lrz @bmichotte I don't know much about osx, however, I have one concern, how can people write gems on top of Flow, I'm wondering if this './app/xx' logic is not a bad idea and if we shouldn't go back to one of our ideas /xx/platform/xx
or some_class.platform.rb
Sorry this is a little bit out of context, but this is one of my concern atm, and still related to this.
I think I did not forget anything, please let me know (the current code is tested on an osx app)
@bmichotte
Indeed, the android config file and the template should be fixed.
mhh, have a problem with lib/cocoa.rb
how can I get the current template here when using the flow samples (from invoke_rake
in motion-flow.rb
) ?
I can't do
$:.unshift("/Library/RubyMotion/lib")
template = Motion::Project::App.template
require "motion/project/template/#{template}"
because Motion::Project::App
is not defined at this time
Mhhh, maybe with ENV
@bmichotte I think the best is to set a global variable in lib/motion-flow.rb with the template symbol and read it in lib/cocoa.rb.
@lrz I added an ENV var to the rake invocation and it works fine.
I'm currently writing a sample for OS X, but it's more difficult when you can't use Motion gems ;)
@bmichotte dont lose time with the sample :) I just want to be sure we can start an osx app, we can figure out the sample later
I agree with Joffrey we can do the sample later :)
Ok, so, you can try a rake osx:run
. You should get a window and a dump in your term
@bmichotte I can't run the spec atm :
cd test
rake ios:spec
No Rakefile found (looking for: config/cocoa.rb)
Once this is fixed, I think we can merge, if you could merge all your commit in one, that would be perfect.
I think the config file should remain platform-specific (ex. config/ios.rb, config/osx.rb, config/android.rb) as there the significant differences between an ios and osx project, config-wise.
I agree
This should be ok (also provide osx tests)
I can not get net tests passing because of thin which don't want to install, could you try everything is ok on your side @jjaffeux ?
@bmichotte ok thanks tests are passing for me, I will try to merge it tomorrow, if @lrz has nothing to add
I have nothing to add. Great work @bmichotte!!!1!1!111!!
@bmichotte merged :) thx, it's official we now have OSX in Flow... what have we done ?
Nothing fancy, just add support for OSX
Atm, everything in flow is completely similar to iOS, so we can use
ios
dirs. If something appears to be incompatible with iOS and need a specific API, a check onosx
dir instead ofios
could be added