{"id":18307452,"url":"https://github.com/devgeeks/grunt-init-cordova","last_synced_at":"2025-04-05T17:31:56.393Z","repository":{"id":6870076,"uuid":"8119072","full_name":"devgeeks/grunt-init-cordova","owner":"devgeeks","description":"Grunt init template for Apache Cordova cli-generated projects","archived":false,"fork":false,"pushed_at":"2014-01-13T00:10:40.000Z","size":189,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T08:05:49.509Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devgeeks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-10T04:34:13.000Z","updated_at":"2020-07-06T13:22:20.000Z","dependencies_parsed_at":"2022-08-26T09:22:27.842Z","dependency_job_id":null,"html_url":"https://github.com/devgeeks/grunt-init-cordova","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeeks%2Fgrunt-init-cordova","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeeks%2Fgrunt-init-cordova/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeeks%2Fgrunt-init-cordova/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgeeks%2Fgrunt-init-cordova/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgeeks","download_url":"https://codeload.github.com/devgeeks/grunt-init-cordova/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247374799,"owners_count":20928894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T16:04:17.601Z","updated_at":"2025-04-05T17:31:56.100Z","avatar_url":"https://github.com/devgeeks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-init-cordova\n\n#### Grunt init template to create a Grunt-based build/workflow for Apache Cordova cli-generated projects\n\n## Requirements\n\n- Node and npm - [http://nodejs.org/](http://nodejs.org/)\n- Cordova CLI - [https://github.com/apache/cordova-cli/](https://github.com/apache/cordova-cli/)\n- Grunt - [http://gruntjs.com/](http://gruntjs.com/)\n- Grunt-init - [https://github.com/gruntjs/grunt-init](https://github.com/gruntjs/grunt-init) – see: [http://gruntjs.com/project-scaffolding](http://gruntjs.com/project-scaffolding)\n\nThen install the global npm dependencies – depending how you installed node.js, you might need to use `sudo` before any of the `-g` – global – npm installs:\n\n- `npm install -g cordova` (assuming you haven't already, this is all you need to create cordova projects)\n- `npm install -g grunt-cli` - this will give us the `grunt` command that will be the backbone of our build set-up\n- `npm install -g grunt-init` - this is the tool for initialising a Grunt.js workflow in your project using templates like this one.\n\n## Installation\n\n#### Start by cloning this repo:\n\n- `git clone https://github.com/devgeeks/grunt-init-cordova.git`\n\nNow, if you run `grunt-init`, under \"currently-available init templates\" you should now have an entry called \"cordova\"\n\nIf everything worked and you have the cordova template available, you are ready to use it with the [cordova-cli](https://github.com/apache/cordova-cli/) tool to get your new project up and running.\n\n#### Create a new cordova project using the cli tool:\n\nThe `cordova create` command takes a path / destination dir, a package ID (in reverse-domain format) and the name of the app.\n\n- `cordova create ./MyNewProject org.devgeeks.mynewproject MyNewProject` \n- `cd ./MyNewProject`\n- `cordova platform add ios` and/or `cordova platform add android`, etc\n\n*NOTE: this init template uses a folder called `./src` as the source folder if you choose to have one. It then sets up Grunt tasks to concatenate and minify those files and place the concatenated and minified files in `./www/js/MyNewProject.js` and  `./www/js/MyNewProject.min.js` respectively. You will also have to answer \"y\" to the init question about concatenation. If this doesn't suit your workflow, but you do still wish to be set up for concatenation and/or minification – i.e.: you don't have a `./src` folder – it will just create empty tasks for concatenation and minification for you to fill out.*\n\n#### Next, it's time to init the project with grunt:\n\n- `grunt-init \u003cpath/to/this/repo\u003e`\n  - This will ask you some questions about your project (usually, the defaults are fine) and create some files like a `Gruntfile.js` file and a `package.json` file.\n\n#### After initialising, you need to install the dependencies:\n\n- `npm install` - This should install some grunt task plugins and their requirements\n\n#### That's it! You are ready to roll:\n\n##### Commands:\n\n`grunt` (default command): runs the lint task, the concat and min tasks (if you decided you wanted them) and runs the jasmine tests that come with the cordova default example project created in the `www` folder when creating the project.\n\n`grunt jshint`: lints the files in `www/js` using jshint.\n\n`grunt debug:ios`: runs `cordova build ios \u0026\u0026 cordova emulate ios` to run up your project in the iOS Simulator (requires [ios-sim](https://github.com/phonegap/ios-sim)).\n\n`grunt debug:android`: runs `cordova build android \u0026\u0026 cordova emulate android` to run up your project in the Android Emulator.\n\n`grunt debug:blackberry10`: runs `cordova build blackberry10 \u0026\u0026 cordova emulate blackberry10` to run up your project in the Blackberry environment (NOTE: this still needs the flags added...).\n\n`grunt watch`: watches the files in you jshint list for changes and runs `grunt jshint` – and concatenation and minification, if you chose it – when triggered.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgeeks%2Fgrunt-init-cordova","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgeeks%2Fgrunt-init-cordova","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgeeks%2Fgrunt-init-cordova/lists"}