Skip to content

Commit

Permalink
Preparing cordova
Browse files Browse the repository at this point in the history
  • Loading branch information
grassick committed Jul 29, 2013
1 parent 1e1826a commit 2077798
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dist
node_modules
test/tests.js
forms/forms.js
cordova
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ module.exports = function(grunt) {
},
cordova_config: {
expand: true,
cwd: 'cordova/',
cwd: 'app/',
src: 'config.xml',
dest: 'cordova/www/'
},
Expand Down
1 change: 1 addition & 0 deletions cordova/config.xml → app/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<author email="[email protected]" href="http://mwater.co">
mWater Team
</author>
<content src="launch_cordova.html" />
<icon src="icon.png"/>
<access origin="*" />
<preference name="fullscreen" value="false" />
Expand Down
2 changes: 2 additions & 0 deletions app/js/launcher.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ exports.createAppUpdater = (success, error) ->
, error

exports.launch = () ->
console.log("Launcher called")
exports.createAppUpdater (appUpdater) ->
appUpdater.launch (url) ->
# Create full url to index.html
indexUrl = url + "index.html?cordova=" + origUrl
console.log("Launcher redirecting to " + indexUrl)
window.location.href = indexUrl
, (err) ->
alert("Failed to launch app: " + err)
Expand Down
15 changes: 15 additions & 0 deletions setup_cordova.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
rm -r cordova
cordova create cordova co.mwater.clientapp ClientApp
cd cordova
cordova platform add android
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
cordova plugin add https://github.com/mWater/cordova-plugin-camera-foreground.git
rm platforms/android/res/drawable-hdpi/icon.png
rm platforms/android/res/drawable-ldpi/icon.png
rm platforms/android/res/drawable-mdpi/icon.png
rm platforms/android/res/drawable-xhdpi/icon.png
cp ../dist/img/mwater-large.png platforms/android/res/drawable/icon.png
rm -r www/*.*

0 comments on commit 2077798

Please sign in to comment.