in my Android project, all my .java view files import an R file based on the name of the current package. When I change the name of my package in the Android manifest (dynamically, and not refactoring through Eclipse or any other IDE), I need the links to all my java files to point to the new R file that is generated
I am building a script through Ant, but I'm not sure if the conditional expression will look like
The lines that need to be replaced are as follows:
import com.mysite.myapp.R;
t
import com.sushiroll.california.R
This is what I have in my ant build script
<replaceregexp file="src/*" match="import*.R" replace="import ${current.package}.R" byline="true"> <fileset dir="src/."> <include name="*.java"/> </fileset> </replaceregexp>
where I want to combine all the lines that say import and end with .R
and replace it with import $current.package}.R
how can i say this for regex ant? the match and substitution that I wrote were just hunches
source share