Question

I have following problem: I am working on many different apps more or less at the same time (switching between apps every couple of hours). Each of them is using its own packaged (git submodule) action bar sherlock. In order to compile and run each app, I have to make sure the library project is opened in eclipse.

Now eclipse only allows to have one instance of a project opened. So my workaround to compile an app is:

  1. deleting the action bar sherlock project (which belongs to another app)
  2. importing the action bar sherlock project (which belongs to this app)
  3. build & run

Is there a more convenient way of doing this?

Was it helpful?

Solution

I have the same issue when running the same application from different branches. What I usually do is that in the import wizard in Eclipse, I change the name of the project to indicate its specifics.

It does not interfere with the classpath configurations, as it does not change the directory of the project.

OTHER TIPS

labor work is little more in this fashion.Better approach is keep common "sherlock" lib for all projects. If there is any customization as per project add one more layer in between. E.G

E.G your current scenario is something like :

public class Project1YourActivity extends sherlockActivity{

}

public class Project2YourActivity extends sherlockActivity{

}

Now your problem is you have made some changes in "shrelok" lib as per project requirement right? That's why you need to keep maintain seprate copy for each project.

What you can do in this case is keep common "Sharelok" lib in workspace for all of your projects.

Project1

create on layered activity in your project like

public class Project1ShareLokActivity extends sherlockActivity{
     // customize sharelokactivity here as per your requirement.
}

public class Project1YourActivity extends Project1ShareLokActivity{
     // Now Extend youractivity by customized sharelokactivity rather sherlockActivity directly
}

When i need to use a library for a specific project i always name it with a prefx for the project: myApp-ActionBarSherlock in this case.

However it is almost never a good thing to do in my opinion. A good way to write code is to keep things modular, meaning if you want to pull an update from github for sherlock tomorrow you should be able to without needing to merge/modify your code in any way.

For style changes (lets say using sherlock i want to change the styles to different color) i use a middleware project of sorts so the project structure is:

libSherlock is attached to styleCustomizationsLib which is attached as a library project to my main app. If you have seen a project called HoloEverywhere they do pretty much the same thing.

What you should do is copy your every workspace you're trabajano, so you can run your applications independently at once!

However, if you only work in a single workspace, the solution is to import the library sherlock and configure each project and rid itself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top