Changeset 953

Show
Ignore:
Timestamp:
10/02/07 18:03:15 (10 months ago)
Author:
mikey
Message:

fixed ticket #85

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/stubbles-ioc/build.xml

    r920 r953  
    5656         author="Stubbles Development Team <http://stubbles.net>" 
    5757         copyright="Stubbles Development Team" 
    58          preface="<?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?>${stubClassLoader}"> 
     58         preface="<?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?>${stubClassLoader}" 
     59         baseSrcPath="${project.basedir}/../../src/main"> 
    5960      <fileset dir="${project.basedir}/../../src/main"> 
    6061        <include name="**/net/stubbles/lang/**/*.php" /> 
  • trunk/build/stubbles/build.xml

    r930 r953  
    154154         author="Stubbles Development Team &lt;http://stubbles.net&gt;" 
    155155         copyright="Stubbles Development Team" 
    156          preface="&lt;?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?&gt;${stubClassLoader}"> 
     156         preface="&lt;?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?&gt;${stubClassLoader}" 
     157         baseSrcPath="${project.basedir}/../../src/main"> 
    157158      <starDecorator starId="xsl/master.xsl" dir="${project.basedir}" class="MasterXslStarFile" /> 
    158159      <fileset dir="${project.basedir}/../../src/main"> 
  • trunk/src/main/php/info/phing/tasks/stubStarWriterTask.php

    r916 r953  
    7070    protected $buildPath; 
    7171    /** 
     72     * the base source path 
     73     * 
     74     * @var  string 
     75     */ 
     76    protected $baseSrcPath; 
     77    /** 
    7278     * the source files 
    7379     * 
     
    150156    { 
    151157        $this->buildPath = $buildPath; 
     158    } 
     159 
     160    /** 
     161     * sets the base source path 
     162     * 
     163     * @param  string  $baseSrcPath 
     164     */ 
     165    public function setBaseSrcPath($baseSrcPath) 
     166    { 
     167        $this->baseSrcPath = realpath($baseSrcPath); 
    152168    } 
    153169 
     
    195211        foreach($this->filesets as $fs) { 
    196212            try { 
    197                 $files      = $fs->getDirectoryScanner($this->project)->getIncludedFiles(); 
    198                 $removePath = realpath($fs->getDir($this->project)); 
     213                $files    = $fs->getDirectoryScanner($this->project)->getIncludedFiles(); 
     214                $realPath = str_replace($this->baseSrcPath, '', realpath($fs->getDir($this->project))); 
     215                if (DIRECTORY_SEPARATOR === $realPath{0}) { 
     216                    $realPath = substr($realPath, 1); 
     217                } 
     218                 
    199219                foreach ($files as $file) { 
    200                     $fullFileName = $removePath . DIRECTORY_SEPARATOR . $file; 
     220                    if (strlen($realPath) > 0) { 
     221                        $fullFileName = $this->baseSrcPath . DIRECTORY_SEPARATOR . $realPath . DIRECTORY_SEPARATOR . $file; 
     222                        $file         = $realPath . DIRECTORY_SEPARATOR . $file; 
     223                    } else { 
     224                        $fullFileName = $this->baseSrcPath . DIRECTORY_SEPARATOR . $file; 
     225                    } 
     226                     
    201227                    if (substr($file, 0, 3) == 'php') { 
    202228                        $srcDir = 'src' . DIRECTORY_SEPARATOR . 'main' . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR; 
     
    211237                    $this->log('Adding ' . $fullFileName . ' as ' . $id); 
    212238                    if (isset($decorators[$id]) == false) { 
    213                         $starFile = new StarFile($fullFileName, $removePath); 
     239                        $starFile = new StarFile($fullFileName, $this->baseSrcPath); 
    214240                    } else { 
    215241                        require_once $decorators[$id]->getFile(); 
    216242                        $class = $decorators[$id]->getClass(); 
    217                         $starFile = new $class(new StarFile($fullFileName, $removePath)); 
     243                        $starFile = new $class(new StarFile($fullFileName, $this->baseSrcPath)); 
    218244                        $this->log('Decorating ' . $id . ' with ' . $class); 
    219245                    }