constructSources();
constructResources();
for (UniversalFile file : data.listFilesRecursively())
{
OutputFile outputFile= null;
if (containsPlaceholder(file))
{
String content= file.getFileAsString();
content= content.replace(TEMPL_APPNAME, name);
content= content.replace(TEMPL_SRCLIST, source_list);
content= content.replace(TEMPL_RESOURCES, resource_list);
outputFile= new OutputFile(content.getBytes());
}
else
{
outputFile= new OutputFile(file);
}
//Path
String path= file.getRelativePath(data.getAbsolutePath());
if (path.indexOf(File.separatorChar) >= 0)
{
path= path.substring(0, path.lastIndexOf(File.separator));
path= path.replaceAll("__project__", name);
}
else
{
path= "";
}
outputFile.setLocation(arguments.option_out() + File.separator + path);
//Name
if (file.getName().contains("__project__"))
{
String newName= file.getName().replaceAll("__project__", name);
outputFile.setFileName(newName);
}
else
{
outputFile.setFileName(file.getName());
}
bundle.addOutputFile(outputFile);
}
}