I've never tried this, but this in theory should work. Make use of "hard links" such that your source code is also a raw resource.
cd project/res (cd into your "res" directory)
mkdir raw (make a "raw" directory if it doesn't already exist)
cd raw
ln ../../src/com/domain/appname/MainActivity.java mainactivity (create a hard link on Unix/Mac)
On Windows, the last line above is replaced with:
mklink /H ../../src/com/domain/appname/MainActivity.java mainactivity
Now MainActivity.java is a resource file in your code. Changes in the original MainActivity.java will be reflected as the mainactivity raw resource. But because resources in raw can't have capital letters or dots, it must just be linked as "mainactivity". It will have a resource id R.raw.mainactivity
.
Repeat the above steps for all the other source files you may have.
You can read how to load your text from a raw resource by following the example question as an answer here.