// ignore hard-coded .classpath
sb.append("/.classpath\n");
}
FileUtils.writeContent(new File(newProject.dir, ".gitignore"), sb.toString());
AddCommand add = git.add();
add.addFilepattern("build.xml");
add.addFilepattern("build.moxie");
add.addFilepattern(".gitignore");
if (newProject.eclipse.includeProject()) {
add.addFilepattern(".project");
}
if (newProject.eclipse.includeClasspath()) {
// MOXIE_HOME relative dependencies in .classpath
add.addFilepattern(".classpath");
}
if (newProject.idea.includeProject()) {
add.addFilepattern(".project");
}
if (newProject.idea.includeClasspath()) {
// MOXIE_HOME relative dependencies in .iml
add.addFilepattern("*.iml");
}
try {
add.call();
CommitCommand commit = git.commit();
PersonIdent moxie = new PersonIdent("Moxie", "moxie@localhost");
commit.setAuthor(moxie);
commit.setCommitter(moxie);
commit.setMessage("Project structure created");