Code Monkey home page Code Monkey logo

Comments (7)

diegonetto avatar diegonetto commented on June 23, 2024

Since the www directory is built by grunt I would leave it out of the repository. Now the platforms are built by cordova but some people modify code in platforms/ directory. My experience is that this should be a last resort.

Take a look at including the merges/ directory with your repo if you haven't already - http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface_customize_each_platform

Let's leave this open so others can chime in if they so desire.

from generator-ionic.

diegonetto avatar diegonetto commented on June 23, 2024

Here's a cool approach that uses a Cordova hook to install the plugins needed for a platform, so you can ignore the plugins directory as well.

http://stackoverflow.com/questions/21791323/cordova-cli-using-git-and-saving-plugins-platforms

This might be a good addition to the generator to help enforce best practices.

from generator-ionic.

aaronksaunders avatar aaronksaunders commented on June 23, 2024

it is a little trickier than that, cordova is kinda finicky about updating the proper files. We are working with multiple developers and getting everyone's environment to stay consistent is really a pain in the ass.

it is almost like we need to recreate the entire platform every time a new person checks the code out. delete the platform directory, add it again, remove and reinstall all plugins and re-copy the icons & splash directory back into platforms.

if we don't follow this process, something usually doesn't work.

i am certain some combination of scripts and hooks will make this work, but haven't had the time to get a script created to handle everything

from generator-ionic.

asgeo1 avatar asgeo1 commented on June 23, 2024

I think there should be a .gitkeep file in the platforms directory, but still have the contents of the platforms directory git-ignored by default.

Because if you clone the project from git, and then try to run the cordova build command, or the platform add command, you'll get an error. The platforms directory must exist before running those commands, so that directory should probably be committed to git, (but just not the contents by default).

from generator-ionic.

diegonetto avatar diegonetto commented on June 23, 2024

Since the entire platforms/ directory is built by Cordova, you should never manually modify its contents! Best practices dictate not committing assets that are generated by a build system.

If you need to modify files inside of platforms/ you should really be using Cordova hooks. Specifically, after_platform is great for installing plugins, and after_prepare for copying icons and splashscreens are quite useful.

This way you can commit your hooks/ and merges/ directories, and each developer cloning your repository will be able to run grunt platform:add:<target> and be ready to get to work.

Here's a great post on Cordova Hooks by one of Adobe's Developer Evangelists - http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/

I'm thinking of opening a new enhancement issue because I think it would benefit the community if these hooks were installed as part of the generator. Thoughts?

from generator-ionic.

mulyoved avatar mulyoved commented on June 23, 2024

hooks were installed as part of the generator
+1

from generator-ionic.

diegonetto avatar diegonetto commented on June 23, 2024

Opened #72

from generator-ionic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.