Eclipse: multiple project from single source

后端 未结 5 1521
春和景丽
春和景丽 2020-12-10 16:16

at first i have to say that i\'m not very good with english, so i\'m sorry if i can explain very well what i mean :)

I have one project that i need to replicate n ti

5条回答
  •  Happy的楠姐
    2020-12-10 16:59

    As you already found out, a shared Android Library project is what you need. Unfortunately (as you already mentioned) assets are only inherited to the dependent projects when building a release with the Android Maven Plugin.

    In our project we created an Ant task syncAssets.xml for developer builds via ADT out of eclipse, that resides in the base folder of the Android Library project:

    
    
    
    
        
        
    
        
                Synchronizing assets from ${sync.source.dir} to ${sync.target.dir}
                
                        
                
        
    
        
                
        
    
    

    This Ant task synchronizes the content of the library projects assets-folder into a projects assets-folder and is triggered whenever a new build in Eclipse is triggered. To add execution of this script to your Android project goto Properties->Builders and create a new Ant Builder that has to be the first one in the chain of all builders to be invoked (use Up button to move the Ant builder upwards).

    In Tab Main select Buildfile ${workspace_loc://syncAssets.xml} and Base directory ${workspace_loc:/}.

    In Tab Refresh select Refresh resources upon completion and Specific Resources and choose your project folder to be refreshed. Furthermore select Recursively include subfolders.

    In Tab Targets ensure that the default target gets executed after clean, on manual build and on auto build. Target clean should be executes during clean.

提交回复
热议问题