Package org.jostraca.util

Examples of org.jostraca.util.FileBuildResource


                                                                      tmps.get( Property.main_WorkFolder ) );
            int               num_cmdRF         = cmd_resourceFiles.length;

            // check against template
            for( int gfI = 0; gfI < numGF; gfI++ ) {
              FileBuildResource fbr = new FileBuildResource( new File( tp.getTemplatePath() ),
                                                             new File( generatedFiles[gfI] ) );
              rbr.add( fbr );
            }

            // check against template resources
            for( int rfI = 0; rfI < num_tmRF; rfI++ ) {
              for( int gfI = 0; gfI < numGF; gfI++ ) {
                FileBuildResource fbr = new FileBuildResource( new File( tm_resourceFiles[rfI] ),
                                                               new File( generatedFiles[gfI] ) );
                rbr.add( fbr );
              }
            }

            // check against cmd resources
            for( int rfI = 0; rfI < num_cmdRF; rfI++ ) {
              for( int gfI = 0; gfI < numGF; gfI++ ) {
                FileBuildResource fbr = new FileBuildResource( cmd_resourceFiles[rfI],
                                                               new File( generatedFiles[gfI] ) );
                rbr.add( fbr );
              }
            }
View Full Code Here


      int      numPF    = psmfiles.length;
      String[] genfiles = ps.getList( Property.jostraca_GeneratedFiles,      Standard.COMMA );
      int      numGF    = genfiles.length;
      for( int pfI = 0; pfI < numPF; pfI++ ) {
        for( int gfI = 0; gfI < numGF; gfI++ ) {
          FileBuildResource fbr = new FileBuildResource( new File( psmfiles[pfI] ), new File( genfiles[gfI] ) );
          rbr.add( fbr );
        }
      }

      recordBuildResources( pTemplate, rbr, new HashMap() );
View Full Code Here

        if( br instanceof RootBuildResource ) {
          recordBuildResources( pTemplate, (RootBuildResource)br, pPreviouslySeen );
        }
        else if( br instanceof FileBuildResource ) {
          PropertySet       ps           = pTemplate.getMergedPropertySet();
          FileBuildResource fbr          = (FileBuildResource) br;
          String            existing_fbr = ps.get( Property.jostraca_FileBuildResources );
          String            file         = fbr.getEarlier().getAbsolutePath();
          if( !pPreviouslySeen.containsKey( file ) ) {
            PropertySet ops = pTemplate.getPropertySet( Constants.CONF_override );
            ops.set( Property.jostraca_FileBuildResources,
                     existing_fbr + (Standard.EMPTY.equals(existing_fbr) ? Standard.EMPTY : Standard.COMMA) + file );
            pPreviouslySeen.put( file, file );
View Full Code Here

    RootBuildResource subroot = new RootBuildResource();
    root.add( subroot );
    System.out.println( root.toString() );
    System.out.println( "\n-2--\n" );

    FileBuildResource fbr01 = new FileBuildResource( new File("a"), new File("b") );
    System.out.println( fbr01 );
    System.out.println( "\n-3--\n" );

    root.add( fbr01 );
    root.add( fbr01 );
    System.out.println( root.toString() );
    System.out.println( "\n-4--\n" );

    FileBuildResource fbr02 = new FileBuildResource( new File("c"), new File("d") );
    subroot.add( fbr02 );
    System.out.println( root.toString() );
    System.out.println( "\n-5--\n" );

  }
View Full Code Here

    File a = File.createTempFile( "jostraca-test-", ".tmp" );
    try { Thread.sleep( 2000 ); } catch( Exception e ) {}
    File b = File.createTempFile( "jostraca-test-", ".tmp" );
    File c = new File( "this-file-does-not-exist" );

    FileBuildResource fbr = new FileBuildResource( a, b );
    assertTrue( fbr.uptodate() );

    fbr = new FileBuildResource( b, a );
    assertTrue( !fbr.uptodate() );

    fbr = new FileBuildResource( a, c );
    assertTrue( !fbr.uptodate() );

    fbr = new FileBuildResource( c, a );
    assertTrue( !fbr.uptodate() );

    fbr = new FileBuildResource( c, c );
    assertTrue( !fbr.uptodate() );
  }
View Full Code Here

                                                                      tmps.get( Property.main_WorkFolder ) );
            int               num_cmdRF         = cmd_resourceFiles.length;

            // check against template
            for( int gfI = 0; gfI < numGF; gfI++ ) {
              FileBuildResource fbr = new FileBuildResource( new File( tp.getTemplatePath() ),
                                                             new File( generatedFiles[gfI] ) );
              rbr.add( fbr );
            }

            // check against template resources
            for( int rfI = 0; rfI < num_tmRF; rfI++ ) {
              for( int gfI = 0; gfI < numGF; gfI++ ) {
                FileBuildResource fbr = new FileBuildResource( new File( tm_resourceFiles[rfI] ),
                                                               new File( generatedFiles[gfI] ) );
                rbr.add( fbr );
              }
            }

            // check against cmd resources
            for( int rfI = 0; rfI < num_cmdRF; rfI++ ) {
              for( int gfI = 0; gfI < numGF; gfI++ ) {
                FileBuildResource fbr = new FileBuildResource( cmd_resourceFiles[rfI],
                                                               new File( generatedFiles[gfI] ) );
                rbr.add( fbr );
              }
            }
View Full Code Here

      int      numPF    = psmfiles.length;
      String[] genfiles = ps.getList( Property.jostraca_GeneratedFiles,      Standard.COMMA );
      int      numGF    = genfiles.length;
      for( int pfI = 0; pfI < numPF; pfI++ ) {
        for( int gfI = 0; gfI < numGF; gfI++ ) {
          FileBuildResource fbr = new FileBuildResource( new File( psmfiles[pfI] ), new File( genfiles[gfI] ) );
          rbr.add( fbr );
        }
      }

      recordBuildResources( pTemplate, rbr, new HashMap() );
View Full Code Here

        if( br instanceof RootBuildResource ) {
          recordBuildResources( pTemplate, (RootBuildResource)br, pPreviouslySeen );
        }
        else if( br instanceof FileBuildResource ) {
          PropertySet       ps           = pTemplate.getMergedPropertySet();
          FileBuildResource fbr          = (FileBuildResource) br;
          String            existing_fbr = ps.get( Property.jostraca_FileBuildResources );
          String            file         = fbr.getEarlier().getAbsolutePath();
          if( !pPreviouslySeen.containsKey( file ) ) {
            PropertySet ops = pTemplate.getPropertySet( Constants.CONF_override );
            ops.set( Property.jostraca_FileBuildResources,
                     existing_fbr + (Standard.EMPTY.equals(existing_fbr) ? Standard.EMPTY : Standard.COMMA) + file );
            pPreviouslySeen.put( file, file );
View Full Code Here

TOP

Related Classes of org.jostraca.util.FileBuildResource

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.