private void processProfile ( final File output ) throws IOException { final Profile profile = makeProfile ( this.app ); final File profileFile = new File ( output, this.app.getName () + ".profile.xml" ); //$NON-NLS-1$ final ResourceSet rs = new ResourceSetImpl (); final Resource r = rs.createResource ( URI.createFileURI ( profileFile.toString () ) ); r.getContents ().add ( EcoreUtil.copy ( profile ) ); final Map<Object, Object> options = new HashMap<> (); options.put ( XMLResource.OPTION_ENCODING, "UTF-8" ); //$NON-NLS-1$ r.save ( options ); }
private void processProfile ( final File output ) throws IOException { final Profile profile = makeProfile ( this.app ); final File profileFile = new File ( output, this.app.getName () + ".profile.xml" ); //$NON-NLS-1$ final ResourceSet rs = new ResourceSetImpl (); final Resource r = rs.createResource ( URI.createFileURI ( profileFile.toString () ) ); r.getContents ().add ( EcoreUtil.copy ( profile ) ); final Map<Object, Object> options = new HashMap<> (); options.put ( XMLResource.OPTION_ENCODING, "UTF-8" ); //$NON-NLS-1$ r.save ( options ); }
private Endpoint createExporter ( final EClass exporterClass, final Node node, final EquinoxApplication application, final int port ) { final Exporter exporter = (Exporter)EcoreUtil.create ( exporterClass ); final Endpoint ep = Endpoints.registerEndpoint ( node, port, Endpoints.reference ( exporter ), String.format ( "Exporter Endpoint: %s - %s", exporter.getTypeTag (), exporter.getName () ) ); node.getEndpoints ().add ( ep ); exporter.setName ( application.getName () + "/exporter" ); exporter.getEndpoints ().add ( ep ); application.getExporter ().add ( exporter ); return ep; }
private void createApplications ( final File baseDir, final AntWixBuilder antBuilder, final WixDeploymentSetupBuilder wixBuilder ) { for ( final Application app : this.applicationNode.getApplications () ) { if ( ! ( app instanceof EquinoxApplication ) ) { continue; } final EquinoxApplication eapp = (EquinoxApplication)app; final Profile profile = P2ProfileProcessor.makeProfile ( eapp ); antBuilder.addApplication ( new AntWixBuilder.Application ( app.getName (), profile ) ); final File configurationBaseDir = new File ( baseDir, eapp.getName () ); wixBuilder.addApplication ( new WixDeploymentSetupBuilder.EquinoxAppService ( app.getName (), profile, configurationBaseDir ) ); } }
private void createApplications ( final File baseDir, final AntWixBuilder antBuilder, final WixDeploymentSetupBuilder wixBuilder ) { for ( final Application app : this.applicationNode.getApplications () ) { if ( ! ( app instanceof EquinoxApplication ) ) { continue; } final EquinoxApplication eapp = (EquinoxApplication)app; final Profile profile = P2ProfileProcessor.makeProfile ( eapp ); antBuilder.addApplication ( new AntWixBuilder.Application ( app.getName (), profile ) ); final File configurationBaseDir = new File ( baseDir, eapp.getName () ); wixBuilder.addApplication ( new WixDeploymentSetupBuilder.EquinoxAppService ( app.getName (), profile, configurationBaseDir ) ); } }
public static Profile makeProfile ( final EquinoxApplication app ) { final Profile profile = flatten ( EcoreUtil.copy ( app.getProfile () ) ); if ( profile == null ) { throw new IllegalStateException ( "Application implemenation did not return a profile" ); } if ( app.getCustomizationProfile () != null ) { mergeIntoProfile ( flatten ( EcoreUtil.copy ( app.getCustomizationProfile () ) ), profile ); } profile.setName ( String.format ( "Custom profile for %s on node %s", app.getName (), Nodes.fromApp ( app ).getHostName () ) ); profile.setDescription ( null ); // finally clear null system properties clearNulls ( profile ); return profile; }
public static Profile makeProfile ( final EquinoxApplication app ) { final Profile profile = flatten ( EcoreUtil.copy ( app.getProfile () ) ); if ( profile == null ) { throw new IllegalStateException ( "Application implemenation did not return a profile" ); } if ( app.getCustomizationProfile () != null ) { mergeIntoProfile ( flatten ( EcoreUtil.copy ( app.getCustomizationProfile () ) ), profile ); } profile.setName ( String.format ( "Custom profile for %s on node %s", app.getName (), Nodes.fromApp ( app ).getHostName () ) ); profile.setDescription ( null ); // finally clear null system properties clearNulls ( profile ); return profile; }