Author Topic: How to properly maintain 2 projects?  (Read 1990 times)

0 Members and 1 Guest are viewing this topic.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
How to properly maintain 2 projects?
« on: April 26, 2015, 08:40:30 am »
I have 1 main project which I'm developing and maintaining and I will need to fork another project from it, essentially the functionality of the forked project will be the same, only some assets (text, icons...) will be changed. So how can I maintain the main project and how could those changes reflect on the forked project?
I was thinking to do checks at runtime based on what some constant would indicate what to compile as, but there are some things that cannot be controlled at runtime, only at compile time. The project is an android app and I'm using Eclipse.

The only solution I came up with is to develop the main project and copy/paste changes into the forked project :P but there must be a better solution...

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: How to properly maintain 2 projects?
« Reply #1 on: April 26, 2015, 10:35:25 am »
Can't u just use git for that ? special repo only for the parts you want updated both sides ?
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline HTH

  • Official EZ Slut
  • Administrator
  • Knight
  • *
  • Posts: 395
  • Cookies: 158
  • EZ Titan
    • View Profile
Re: How to properly maintain 2 projects?
« Reply #2 on: April 26, 2015, 11:01:28 am »
Well, without knowing exactly what you're doing it's hard to say but the smartest thing to do, since its just icons and text and whatnot would be to design the classes in such a way that  there is a core application and an overlay

IE: APplication1 = Core +Overlay1
     Application2 = Core +Overlay2

Except for some very weird projects this SHOULD be possible.

Your next best option (or bhest option if a substantial amount of functionality will change) would be runtime and compile time checks, maintaining two projects via the copy paste method is a real pain in the ass.
<ande> HTH is love, HTH is life
<TurboBorland> hth is the only person on this server I can say would successfully spitefuck peoples women

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: How to properly maintain 2 projects?
« Reply #3 on: April 26, 2015, 06:13:19 pm »
Can't u just use git for that ? special repo only for the parts you want updated both sides ?
I thought of that, but could you explain more?

Your next best option (or bhest option if a substantial amount of functionality will change) would be runtime and compile time checks...
I don't think you can do that with android and Eclipse or any other IDE. The core functionality wouldn't change, only some parts of the code. I have no problem with icons and text, however the problem arises for app name and icon, package names (android apps are distinguished by package names, not just app names) and other stuff. So I need to somehow make changes in 1 project, and partially (or fully without destroying the code that is needed by that other project) reflect the changes.

Offline HTH

  • Official EZ Slut
  • Administrator
  • Knight
  • *
  • Posts: 395
  • Cookies: 158
  • EZ Titan
    • View Profile
Re: How to properly maintain 2 projects?
« Reply #4 on: April 26, 2015, 09:46:38 pm »
Compile time checks for things like that are definitely possible in Eclipse... Use Maven or Ant

And runtime checks are possible in any language lol.
« Last Edit: April 26, 2015, 09:47:43 pm by HTH »
<ande> HTH is love, HTH is life
<TurboBorland> hth is the only person on this server I can say would successfully spitefuck peoples women

Offline jstacks

  • NULL
  • Posts: 2
  • Cookies: 0
    • View Profile
Re: How to properly maintain 2 projects?
« Reply #5 on: May 07, 2015, 01:26:50 am »
Use git.
1) develop to master
2) create branches for each variation
3) merge master into each branch by rebasing the branch commits over the master


done and easy to maintain.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: How to properly maintain 2 projects?
« Reply #6 on: May 07, 2015, 07:21:59 am »
Use git.
1) develop to master
2) create branches for each variation
3) merge master into each branch by rebasing the branch commits over the master


done and easy to maintain.
But the merge will overwrite what needs to be kept in another project...

Compile time checks for things like that are definitely possible in Eclipse... Use Maven or Ant

And runtime checks are possible in any language lol.
With my last comment I was referring to compile time checks :P but I'll look into Maven or Ant, never used those. Still however this seems shady...
« Last Edit: May 07, 2015, 07:23:58 am by Kulverstukas »

Offline flowjob

  • Knight
  • **
  • Posts: 327
  • Cookies: 46
  • Pastafarian
    • View Profile
Re: How to properly maintain 2 projects?
« Reply #7 on: May 07, 2015, 11:48:57 am »
But the merge will overwrite what needs to be kept in another project...

I think he meant rebasing the 2 branches on the masters HEAD, so that both branches are always as up-to-date as master. you'll have to rebase after every commit to master though.
I'd also suggest to go for the git way, it's probably the easiest to manage, after you've setup everything correctly.
Quote
<phil> I'm gonna DDOS the washing machine with clothes packets.
<deviant_sheep> dont use too much soap or youll cause a bubble overflow