Changeset 830

Show
Ignore:
Timestamp:
08/14/07 22:07:49 (1 year ago)
Author:
mikey
Message:

made StarWriterTask? more independent from stubbles
todo: remove dependency on star classes in src path and config/php/config.php

Files:

Legend:

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

    r788 r830  
    143143    <echo message="Base directory  : ${project.basedir}"/> 
    144144    <echo message="Source directory: ${build.src.dir}"/> 
    145     <buildStar version="${version}" buildPath="${build.src.dir}/lib"> 
     145    <php expression="file_get_contents('${project.basedir}/../../src/main/php/net/stubbles/stubClassLoader.php')" returnProperty="stubClassLoader"/> 
     146    <buildStar buildPath="${build.src.dir}/lib/stubbles.php" 
     147         version="${version}" 
     148         title="Stubbles" 
     149         package="net.stubbles" 
     150         author="Stubbles Development Team &lt;http://stubbles.net&gt;" 
     151         copyright="Stubbles Development Team" 
     152         preface="&lt;?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?&gt;${stubClassLoader}"> 
    146153      <starDecorator starId="xsl/master.xsl" dir="${project.basedir}" class="MasterXslStarFile" /> 
    147154      <fileset dir="${project.basedir}/../../src/main"> 
     
    149156        <include name="**/*.xml" /> 
    150157        <include name="**/*.xsl" /> 
    151         <exclude name="**/star/**" /> 
     158        <exclude name="**/star/StarArchive.php" /> 
     159        <include name="**/star/StarClassRegistry.php" /> 
     160        <exclude name="**/star/StarConsole.php" /> 
     161        <exclude name="**/star/StarException.php" /> 
     162        <exclude name="**/star/StarFile.php" /> 
     163        <exclude name="**/star/StarStreamWrapper.php" /> 
     164        <exclude name="**/star/StarWriter.php" /> 
    152165        <exclude name="**/de/**" /> 
    153166        <exclude name="**/examples/**" /> 
  • trunk/src/main/php/info/phing/tasks/stubStarWriterTask.php

    r610 r830  
    77 * @subpackage  phing 
    88 */ 
    9  
    109/** 
    1110 * Uses the Phing Task 
    1211 */ 
    1312require_once 'phing/Task.php'; 
    14  
    1513/** 
    1614 * Uses stubbles star classes 
     
    2927class stubStarWriterTask extends Task 
    3028{ 
    31    /** 
     29    /** 
     30     * the title meta information 
     31     * 
     32     * @var  string 
     33     */ 
     34    protected $title       = ''; 
     35    /** 
    3236     * version to create 
    3337     * 
    3438     * @var  string 
    3539     */ 
    36     protected $version; 
     40    protected $version     = ''; 
     41    /** 
     42     * the package meta information 
     43     * 
     44     * @var  string 
     45     */ 
     46    protected $package     = ''; 
     47    /** 
     48     * the author meta information 
     49     * 
     50     * @var  string 
     51     */ 
     52    protected $author      = ''; 
     53    /** 
     54     * the copyright meta information 
     55     * 
     56     * @var  string 
     57     */ 
     58    protected $copyright   = ''; 
     59    /** 
     60     * the preface to add to the star file 
     61     * 
     62     * @var  string 
     63     */ 
     64    protected $preface     = null; 
    3765    /** 
    3866     * the path to put the star archive into 
     
    5583 
    5684    /** 
    57      * set the version number 
     85     * sets the title 
     86     * 
     87     * @param  string  $title 
     88     */ 
     89    public function setTitle($title) 
     90    { 
     91        $this->title = $title; 
     92    } 
     93 
     94    /** 
     95     * sets the version number 
    5896     * 
    5997     * @param  string  $version 
     
    62100    { 
    63101        $this->version = $version; 
     102    } 
     103 
     104    /** 
     105     * sets the package 
     106     * 
     107     * @param  string  $package 
     108     */ 
     109    public function setPackage($package) 
     110    { 
     111        $this->package = $package; 
     112    } 
     113 
     114    /** 
     115     * sets the author 
     116     * 
     117     * @param  string  $author 
     118     */ 
     119    public function setAuthor($author) 
     120    { 
     121        $this->author = $author; 
     122    } 
     123 
     124    /** 
     125     * sets the copyright 
     126     * 
     127     * @param  string  $copyright 
     128     */ 
     129    public function setCopyright($copyright) 
     130    { 
     131        $this->copyright = $copyright; 
     132    } 
     133 
     134    /** 
     135     * sets the preface 
     136     * 
     137     * @param  string  $preface 
     138     */ 
     139    public function setPreface($preface) 
     140    { 
     141        $this->preface = $preface; 
    64142    } 
    65143 
     
    114192        } 
    115193         
    116         $starArchive = new StarArchive(new StarWriter($this->buildPath . '/stubbles.php')); 
     194        $starArchive = new StarArchive(new StarWriter($this->buildPath)); 
    117195        foreach($this->filesets as $fs) { 
    118196            try { 
     
    153231        } 
    154232         
    155         $starArchive->add(new StarFile(stubConfig::getSourcePath() . '/php/net/stubbles/star/StarClassRegistry.php', stubConfig::getSourcePath() . '/php'), 'net.stubbles.star.StarClassRegistry'); 
    156         $preface = "<?php require 'star://' . __FILE__ . '?net.stubbles.star.StarClassRegistry'; ?>" . file_get_contents(stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php'); 
    157         $starArchive->setPreface($preface); 
    158         $starArchive->addMetaData('title', 'Stubbles'); 
    159         $starArchive->addMetaData('package', 'net.stubbles'); 
     233        if (null != $this->preface) { 
     234            $starArchive->setPreface($this->preface); 
     235        } 
     236         
     237        $starArchive->addMetaData('title', $this->title); 
     238        $starArchive->addMetaData('package', $this->package); 
    160239        $starArchive->addMetaData('version', $this->version); 
    161         $starArchive->addMetaData('author', 'Stubbles Development Team <http://stubbles.net>'); 
    162         $starArchive->addMetaData('copyright', '(c) ' . date('Y') . ' Stubbles Development Team'); 
     240        $starArchive->addMetaData('author', $this->author); 
     241        $starArchive->addMetaData('copyright', '(c) ' . date('Y') . ' ' . $this->copyright); 
    163242        $starArchive->create(); 
    164243    }