Closed amirrajan closed 6 years ago
(If we can have https://github.com/hipbyte/rubymotion up to date :) )
Presuming that the idea is for the community to write more templates like ios-admob-rewarded-ads
, I think it's worth considering keeping the templates for extensions within the RubyMotion repo and separate out non-"standard" ones like ios-admob-rewarded-ads
into https://github.com/amirrajan/rubymotion-templates. Extension templates tend to be harder to get right and are more time-sensitive. We can still run our own fork of the rubymotion tools anyway if we want to tweak the "standard" templates and then submit a PR like before?
Is there a particular reason to want to push those into rubymotion-templates
too?
(If we can have https://github.com/hipbyte/rubymotion up to date :) )
Yes definitely, but I just think it may be better if templates were always updated from a git repo when you run the motion create
action. So the hipbyte/rubymotion public repo would be updated, but the templates
directory would be (essentially) removed and all future templates would come from rubymotion-templates
.
Extension templates tend to be harder to get right and are more time-sensitive.
Agreed. Definitely not saying that RubyMotion will stop supporting these. The reason I want to have them pull from a GH repo is so they can be quickly updated (as opposed to me having to push a release). Here's how lib/motion/project/template.rb
would be updated:
community_templates = File.expand_path(File.join("~", '.rubymotion-community-templates'))
begin
unless File.directory?(community_templates)
puts "Cloning approved community templates. Feel free to browse ~/.rubymotion-community-templates to see how their built."
`git clone https://github.com/amirrajan/rubymotion-templates #{community_templates}`
else
Dir.chdir(community_templates) do
`git pull`
end
end
rescue => exception
puts "#{exception}"
puts "Retrieval of community templates from https://github.com/amirrajan/rubymotion-templates didn't work. Skipping for now."
end
Paths = [
local_templates,
community_templates,
File.expand_path(File.join(ENV['HOME'], 'Library/RubyMotion/template'))
]
Ok, makes sense 💯
💯% on board with moving ALL templates into a git repo. I’d love for the templates to auto-update like homebrew does.
I'm totally okay with moving everything over too actually. @hboon ?
In essense, RubyMotion wont technically "ship" with any templates. They will all download when you type motion create
. This will allow extremely fast updates to templates w/o having to do an RM release.
Just 1 thought: would the templates ever need to be tied to an RM version?
But I suppose if we have a command like motion update-project-templates <commit-or-tag>
, that would fix it.
Otherwise sounds good!
New features will result in new templates. Templates should indicate the first iOS/RM version in which they are supported, so they don't appear when using older versions (and you can add stuff during betas without confusing everyone on the officially supported release).
@hboon @wndxlori Not to worried about that honestly. Specifically: You're creating a new project.... why would you want to use an old template/old version of RM/old version of XCode?
I think it's better to answer this question (very specifically), and figure out a solution around that. I'm still leaning towards "lets just do it, what's the worst that could happen?"
Yes, let's do it! (or make it so :P )
git commit -m "make it so"
There are a lot of starter templates. There need to be more. But I (and hopefully you) will want to be able to iterate on them quickly and update them independent of a RubyMotion release.
So, aside from the
gem
,osx
,ios
,watchos
,tvos
, andandroid
templates. I want to move the rest of them here.When you run
motion create
with no parameters. Here is the new list you'll get: