Package org.guvnor.common.services.project.builder.model

Examples of org.guvnor.common.services.project.builder.model.IncrementalBuildResults


            }
            final Builder builder = cache.assertBuilder( project );
            if ( !builder.isBuilt() ) {
                build( project );
            }
            final IncrementalBuildResults results = builder.deleteResource( paths.convert( resource ) );
            incrementalBuildResultsEvent.fire( results );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here


            }
            final Builder builder = cache.assertBuilder( project );
            if ( !builder.isBuilt() ) {
                build( project );
            }
            final IncrementalBuildResults results = builder.updateResource( paths.convert( resource ) );
            incrementalBuildResultsEvent.fire( results );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here

            }
            final Builder builder = cache.assertBuilder( project );
            if ( !builder.isBuilt() ) {
                build( project );
            }
            final IncrementalBuildResults results = builder.applyBatchResourceChanges( changes );
            incrementalBuildResultsEvent.fire( results );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here

        PortablePreconditions.checkNotNull( "resource",
                                            resource );

        //Only files can be processed
        if ( !Files.isRegularFile( resource ) ) {
            return new IncrementalBuildResults();
        }

        //Check a full build has been performed
        if ( !isBuilt() ) {
            throw new IllegalStateException( "A full build needs to be performed before any incremental operations." );
        }
        //Add new resource
        final String destinationPath = resource.toUri().toString().substring( projectPrefix.length() + 1 );
        final InputStream is = ioService.newInputStream( resource );
        final BufferedInputStream bis = new BufferedInputStream( is );
        kieFileSystem.write( destinationPath,
                             KieServices.Factory.get().getResources().newInputStreamResource( bis ) );
        addJavaClass( resource );
        handles.put( destinationPath,
                     paths.convert( resource ) );

        //Incremental build
        final IncrementalResults incrementalResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( destinationPath ).build();

        //Messages from incremental build
        final IncrementalBuildResults results = convertMessages( incrementalResults );

        //Tidy-up removed message handles
        for ( Message message : incrementalResults.getRemovedMessages() ) {
            handles.remove( RESOURCE_PATH + "/" + message.getPath() );
        }
View Full Code Here

        PortablePreconditions.checkNotNull( "resource",
                                            resource );

        //Only files can be processed
        if ( !Files.isRegularFile( resource ) ) {
            return new IncrementalBuildResults();
        }

        //Check a full build has been performed
        if ( !isBuilt() ) {
            throw new IllegalStateException( "A full build needs to be performed before any incremental operations." );
        }

        //Delete resource
        final String destinationPath = resource.toUri().toString().substring( projectPrefix.length() + 1 );
        kieFileSystem.delete( destinationPath );
        removeJavaClass( resource );

        //Incremental build
        final IncrementalResults incrementalResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( destinationPath ).build();

        //Messages from incremental build
        final IncrementalBuildResults results = convertMessages( incrementalResults );

        //Tidy-up removed message handles
        for ( Message message : incrementalResults.getRemovedMessages() ) {
            handles.remove( RESOURCE_PATH + "/" + message.getPath() );
        }
View Full Code Here

        final String[] kieBuilderPaths = new String[ changedFilesKieBuilderPaths.size() ];
        changedFilesKieBuilderPaths.toArray( kieBuilderPaths );
        final IncrementalResults incrementalResults = ( (InternalKieBuilder) kieBuilder ).createFileSet( kieBuilderPaths ).build();

        //Messages from incremental build
        final IncrementalBuildResults results = convertMessages( incrementalResults );

        //Tidy-up removed message handles
        for ( Message message : incrementalResults.getRemovedMessages() ) {
            handles.remove( RESOURCE_PATH + "/" + message.getPath() );
        }
View Full Code Here

TOP

Related Classes of org.guvnor.common.services.project.builder.model.IncrementalBuildResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.