added shared code between java and ant build so that directories are variable