Skip to content

Commit

Permalink
Added resources to ios
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Votsikas committed Aug 3, 2015
1 parent 00285de commit 13908c7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/tasks/build/after/local/ios.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ module.exports = ios = (grunt) ->
tasks =
buildIcons: require('./ios/icons')(grunt).build
buildScreens: require('./ios/screens')(grunt).build
buildResources: require('./ios/resources')(grunt).build
setStatusBar: require('./ios/plist')(grunt).setStatusBar

run: (fn) ->
fluid(tasks)
.buildIcons()
.buildScreens()
.buildResources()
.setStatusBar()
.go (err, result) ->
if err then grunt.fatal err
Expand Down
23 changes: 23 additions & 0 deletions src/tasks/build/after/local/ios/resources.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
path = require 'path'

module.exports = resources = (grunt) ->
helpers = require('../../../../helpers')(grunt)

build: (fn) ->
resources = helpers.config 'resources'
phonegapPath = helpers.config 'path'
appName = helpers.config 'name'

dest = path.join phonegapPath, 'platforms', 'ios', appName

if resources?.ios
for resource in resources?.ios
console.log 'resource from:'+resource.from+", to:"+resource.to
grunt.file.recurse resource.from, (file, root, filepath, filename) ->
console.log "copying "+file+ ","+root+","+filepath+","+filename
if filepath
grunt.file.copy file, path.join dest, resource.to, filepath, filename
else
grunt.file.copy file, path.join dest, resource.to, filename

if fn then fn()
3 changes: 2 additions & 1 deletion tasks/build/after/local/ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
tasks = {
buildIcons: require('./ios/icons')(grunt).build,
buildScreens: require('./ios/screens')(grunt).build,
buildResources: require('./ios/resources')(grunt).build,
setStatusBar: require('./ios/plist')(grunt).setStatusBar
};
return {
run: function(fn) {
return fluid(tasks).buildIcons().buildScreens().setStatusBar().go(function(err, result) {
return fluid(tasks).buildIcons().buildScreens().buildResources().setStatusBar().go(function(err, result) {
if (err) {
grunt.fatal(err);
}
Expand Down
38 changes: 38 additions & 0 deletions tasks/build/after/local/ios/resources.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13908c7

Please sign in to comment.