I have a serious problem (!!!) about organizing my develop environment;
I have two apps: app1 and app2. This apps are written using OpenUI5 (but this detail is not important)
app1 and app2 are similar and share some code (for example the code to login). I use git (with git-flow) with two remote repo and I have all equal code duplicate. Now I want optimize my develop-flow sharing equal code (login code).
This is my first idea: have only one repo contains all my code in a structure of this type:
repo
|_____share
| |____login.js
|
|_____app1
| |_____index.html
| |_____resources
| |_________util1.js
|_____app2
|_____index.html
|_____resources
|_________util2.js
I have two time state:
- DEVELOP time where each index.html uses
resources/utilX.js
and../share/login.js
- RELEASE time where each index.html uses
resources/utilX.js
andresources/login.js
Good! I can create (using grunt?) a RELEASE for each app; for example the result of RELEASE is
app1
|_____index.html
|_____resources
|_________util1.js
|_________login.js.js
I can push app1 folder to my server and it works fine!
But now I have some doubt:
- Using git-flow I have master and develop branch; with only one repo I have only one mastes and consequently when on app1 I want to do a release I must tag the full master with a new release. I don't like it, I would like two apps with their own number version
- Is better have two separate repo (repo_app1 & repo_app2)? And in this case where are the share files?
- In other (compiled)language I can create release version whit only compiled files of an app. Grunt is the right way to prepare the app folder to push on my server?