This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
0 Replies Last post: Nov 11, 2013 2:06 PM by Dmitry Erokhin  
Dmitry Erokhin Newbie 8 posts since
Apr 29, 2010
Currently Being Moderated

Nov 11, 2013 2:06 PM

Class duplication error (using code overwriting at build time)

I've got big and complex project in Eclipse. This project is deploying to several clients, each one of them has some differences in code logic, and our team use folowing technic:

 

We have one Base project. Each class that can be different for particular client is represented by two classes:

 

package com.foo

class _Cls {

//basic logic

}


package com.foo

class Cls extends _Cls { /*empty dummy class*/ }

 

all referneces in code are pointing to Cls and logic from _Cls is avaliable via inheritence.

 

 

Also we manage clients projects (one per each client). If we need to implement different logic in for this client we simply write it in com.foo.Cls in his project:

 

package com.foo

class Cls extends _Cls {

//some client specific logic

}

 

On build stage ant script do next steps:

  1. all classes from base project are copied to separate folder 'build'
  2. to folder 'build' copied all classes from client project, overwriting if file names mathces (class Cls with client logic overwrites empty base class Cls).
  3. compiling content of 'build' folder
This works perfectly in Eclipse, but when I decided to migrate from Eclipse to Idea, I found that it can not deal with two com.foo.Cls (one in Base project, second in Client project) showing me error about class duplicating.
The question is how to make our development technic works in Idea12?
Thanks a lot!

More Like This

  • Retrieving data ...