task.getDeploy().setApplication( ParametersFactory.eINSTANCE.createApplication() );
task.getDeploy().getApplication().setName( fFirstPage.getProjectName() );
task.getDeploy().setInfo( ParametersFactory.eINSTANCE.createInfo() );
task.setSignjar( AntTasksFactory.eINSTANCE.createSignJar() );
final XMIResource resource= new XMIResourceImpl();
resource.getContents().add( task );
WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
@Override
public void execute( IProgressMonitor monitor ) {
if ( !resource.getContents().isEmpty() ) {
Map<Object, Object> options = new HashMap<Object, Object>();
options.put(XMIResource.OPTION_USE_XMI_TYPE, Boolean.TRUE);
ByteArrayOutputStream streamOut = null;
ByteArrayInputStream streamIn = null;
try {
streamOut = new ByteArrayOutputStream();
resource.save( streamOut, options );
streamIn = new ByteArrayInputStream( streamOut.toByteArray() );
buildFile.create( streamIn, true, monitor );
}
catch ( IOException | CoreException e ) {
// TODO Auto-generated catch block