Changeset 1877

Show
Ignore:
Timestamp:
09/30/08 18:04:27 (3 months ago)
Author:
mikey
Message:

inject paths instead of relying on stubConfig

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • framework/trunk/build.xml

    r1876 r1877  
    359359  <target name="test-initializers"> 
    360360    <initConfig configPath="${stubbles.base.dir}/projects/dist/config"/> 
    361     <initClassLoader/> 
     361    <initClassLoader sourcePath="${stubbles.base.dir}/src/main" libPath="${stubbles.base.dir}/lib"/> 
    362362    <phingcall target="clear-cache"/> 
    363363    <checkInitializers classFile="${stubbles.base.dir}/src/main/resources/build/initializers.ini" 
  • framework/trunk/src/main/php/org/stubbles/phing/tasks/stubInitClassLoaderTask.php

    r1872 r1877  
    2222{ 
    2323    /** 
     24     * path to source files 
     25     * 
     26     * @var  string 
     27     */ 
     28    protected $sourcePath; 
     29    /** 
     30     * path to lib files 
     31     * 
     32     * @var  string 
     33     */ 
     34    protected $libPath; 
     35 
     36    /** 
     37     * sets the path to source files 
     38     * 
     39     * @param  string  $sourcePath 
     40     */ 
     41    public function setSourcePath($sourcePath) 
     42    { 
     43        $this->sourcePath = $sourcePath; 
     44    } 
     45 
     46    /** 
     47     * sets the path to lib files 
     48     * 
     49     * @param  string  $libPath 
     50     */ 
     51    public function setLibPath($libPath) 
     52    { 
     53        $this->libPath = $libPath; 
     54    } 
     55 
     56    /** 
    2457     * The init method: Do init steps. 
    2558     */ 
     
    3972        } 
    4073         
    41         if (file_exists(stubConfig::getLibPath() . '/stubbles.php') === true) { 
    42             if ((include_once stubConfig::getLibPath() . '/stubbles.php') === false) { 
    43                 $this->log('Error loading Stubbles library from ' . stubConfig::getLibPath() . '/stubbles.php', Project::MSG_ERR); 
    44                 $this->log('Either stubConfig::getLibPath() is not correctly set, or stubbles.php does not exist.', Project::MSG_ERR); 
    45                 throw new BuildException('Error loading Stubbles library from ' . stubConfig::getLibPath() . '/stubbles.php'); 
     74        if (file_exists($this->libPath . '/stubbles.php') === true) { 
     75            if ((include_once $this->libPath . '/stubbles.php') === false) { 
     76                $this->log('Error loading Stubbles library from ' . $this->libPath . '/stubbles.php', Project::MSG_ERR); 
     77                throw new BuildException('Error loading Stubbles library from ' . $this->libPath. '/stubbles.php'); 
    4678            } 
    4779        } else { 
    48             if (!@include_once stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php') { 
    49                 $this->log('Error loading stubClassLoader from ' . stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php', Project::MSG_ERR); 
    50                 $this->log('Either stubConfig::getSourcePath() is not correctly set, or you are not using a source distribution.', Project::MSG_ERR); 
    51                 throw new BuildException('Error loading stubClassLoader from ' . stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php'); 
     80            if (!@include_once $this->sourcePath . '/php/net/stubbles/stubClassLoader.php') { 
     81                $this->log('Error loading stubClassLoader from ' . $this->sourcePath . '/php/net/stubbles/stubClassLoader.php', Project::MSG_ERR); 
     82                throw new BuildException('Error loading stubClassLoader from ' . $this->sourcePath . '/php/net/stubbles/stubClassLoader.php'); 
    5283            } 
    5384             
    54             if ((include_once stubConfig::getLibPath() . '/starWriter.php') === false) { 
    55                 $this->log('Error loading StarWriter from ' . stubConfig::getLibPath() . '/starWriter.php', Project::MSG_ERR); 
    56                 $this->log('Either stubConfig::getLibPath() is not correctly set, or starWriter.php does not exist.', Project::MSG_ERR); 
    57                 throw new BuildException('Error loading StarWriter from ' . stubConfig::getLibPath() . '/starWriter.php'); 
     85            if ((include_once $this->libPath . '/starWriter.php') === false) { 
     86                $this->log('Error loading StarWriter from ' . $this->libPath . '/starWriter.php', Project::MSG_ERR); 
     87                throw new BuildException('Error loading StarWriter from ' . $this->libPath . '/starWriter.php'); 
    5888            } 
    5989        } 
  • framework/trunk/src/main/resources/phing/build-stubbles.xml

    r1744 r1877  
    182182          </else> 
    183183        </if> 
    184         <stubInitClassLoader/> 
     184        <stubInitClassLoader sourcePath="${stubbles.src.path}" libPath="${stubbles.lib.path}"/> 
    185185        <foreach list="${projects}" param="stubbles.project" target="generate-client-project"/> 
    186186      </then>