Changeset 681

Show
Ignore:
Timestamp:
05/29/07 21:14:25 (1 year ago)
Author:
schst
Message:

Restructured examples to reside in their own sandbox (not working in the build, yet)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples

    • Property svn:ignore changed from
      yui
      javascript
      to
      yui
      javascript
      examples.properties
  • trunk/examples/build.xml

    r652 r681  
    22<project name="Stubbles" basedir="." default="main"> 
    33  <property name="examples.base.dir" value="${project.basedir}" /> 
    4   <property file="../examples.properties" /> 
     4  <property file="examples.properties" /> 
    55 
    66  <target name="main" depends="prepare-examples, foreignClassLoader, json-rpc" description="Setup all examples" /> 
    77 
    88  <target name="prepare-examples" description="Prepare folders for the examples."> 
     9    <echo>Project basedir: ${project.basedir}</echo> 
    910    <!-- cache permissions --> 
    1011    <if> 
     
    1516      <else> 
    1617        <input propertyname="cache.permissions" promptChar=":" defaultValue="0777">Please supply permissions for cache folders</input> 
    17         <append destFile="../examples.properties" text="cache.permissions=${cache.permissions}${line.separator}"/> 
     18        <append destFile="examples.properties" text="cache.permissions=${cache.permissions}${line.separator}"/> 
    1819      </else> 
    1920    </if> 
    2021    <chmod file="${project.basedir}/../lib" mode="${cache.permissions}"/> 
    21     <chmod file="${project.basedir}/../cache" mode="${cache.permissions}"/> 
    22     <chmod file="${project.basedir}/../cache/xml" mode="${cache.permissions}"/> 
    23     <chmod file="${project.basedir}/../cache/xml/elements" mode="${cache.permissions}"/> 
     22    <chmod file="${project.basedir}/cache" mode="${cache.permissions}"/> 
     23    <chmod file="${project.basedir}/cache/xml" mode="${cache.permissions}"/> 
     24    <chmod file="${project.basedir}/cache/xml/elements" mode="${cache.permissions}"/> 
    2425    <delete file="${stubbles.lib.path}/.cache" verbose="true"/> 
    2526    <delete> 
    26       <fileset dir="${project.basedir}/../cache"> 
     27      <fileset dir="${project.basedir}/cache"> 
    2728        <include name="**/*.cache" /> 
    2829      </fileset> 
     
    3738      <else> 
    3839        <input propertyname="log.permissions" promptChar=":" defaultValue="0777">Please supply permissions for log folders</input> 
    39         <append destFile="../examples.properties" text="log.permissions=${log.permissions}${line.separator}"/> 
     40        <append destFile="examples.properties" text="log.permissions=${log.permissions}${line.separator}"/> 
    4041      </else> 
    4142    </if> 
     
    4647    <resolvepath propertyName="examples.absolute.dir" file="${project.basedir}"/> 
    4748    <!-- Foreign Class loader --> 
    48     <resolvepath propertyName="example.foreignclass.readme" file="${project.basedir}/foreignClassLoaders/README"/> 
     49    <resolvepath propertyName="example.foreignclass.readme" file="${project.basedir}/docroot/foreignClassLoaders/README"/> 
    4950    <echo>-------------------------------------------</echo> 
    5051    <echo>| Setting up foreign class loader example |</echo> 
     
    6869    <echo>| Setting up JSON-RPC example             |</echo> 
    6970    <echo>-------------------------------------------</echo> 
    70     <mkdir dir="${examples.base.dir}/javascript"/> 
    71     <copy todir="${examples.base.dir}/javascript"> 
     71    <mkdir dir="${examples.base.dir}/docroot/javascript"/> 
     72    <copy todir="${examples.base.dir}/docroot/javascript"> 
    7273      <fileset dir="${javascript.srcpath}"> 
    7374        <include name="**/*.js"/> 
     
    109110            <echo>YAHOO! User Interface library is installed.</echo> 
    110111            <echo>Will use this version in examples.</echo> 
    111             <append destFile="../examples.properties" text="yui.local.use=yes${line.separator}"/> 
     112            <append destFile="examples.properties" text="yui.local.use=yes${line.separator}"/> 
    112113          </then> 
    113114          <else> 
     
    120121              </or> 
    121122              <then> 
    122                 <append destFile="../examples.properties" text="yui.local.use=no${line.separator}"/> 
     123                <append destFile="examples.properties" text="yui.local.use=no${line.separator}"/> 
    123124              </then> 
    124125              <else> 
    125                 <append destFile="../examples.properties" text="yui.local.use=yes${line.separator}"/> 
     126                <append destFile="examples.properties" text="yui.local.use=yes${line.separator}"/> 
    126127              </else> 
    127128            </if> 
  • trunk/examples/config/php/config-dist.php

    r628 r681  
    11<?php 
    22/** 
    3  * use this class to configure your site 
     3 * use this class to configure the examples 
     4 * in a complete build 
    45 */ 
    56class stubConfig 
     
    4647    { 
    4748        if (null == self::$libPath) { 
    48             self::$libPath = realpath(dirname(__FILE__) . '/../../lib'); 
     49            self::$libPath = realpath(dirname(__FILE__) . '../../../../lib'); 
    4950        } 
    50          
     51 
    5152        return self::$libPath; 
    5253    } 
     
    6263    { 
    6364        if (null == self::$sourcePath) { 
    64             self::$sourcePath = realpath(dirname(__FILE__) . '/../../src/main'); 
     65            self::$sourcePath = realpath(dirname(__FILE__) . '../../../../src/main'); 
    6566        } 
    66          
     67 
    6768        return self::$sourcePath; 
    6869    } 
     
    8081            self::$logPath = realpath(dirname(__FILE__) . '/../../log'); 
    8182        } 
    82          
     83 
    8384        return self::$logPath; 
    8485    } 
     
    9697            self::$cachePath = realpath(dirname(__FILE__) . '/../../cache'); 
    9798        } 
    98          
     99 
    99100        return self::$cachePath; 
    100101    } 
     
    105106     * By default its /path/to/stubbles/config. 
    106107     * 
    107      * @return string 
     108     * @return unknown 
    108109     */ 
    109110    public static function getConfigPath() 
     
    112113            self::$configPath = realpath(dirname(__FILE__) . '/../'); 
    113114        } 
    114          
     115 
    115116        return self::$configPath; 
    116117    } 
  • trunk/examples/config/php/config.php

    r613 r681  
    11<?php 
    22/** 
    3  * use this class to configure your site 
     3 * use this class to configure the examples 
     4 * in a checkout 
    45 */ 
    56class stubConfig 
     
    4647    { 
    4748        if (null == self::$libPath) { 
    48             self::$libPath = realpath(dirname(__FILE__) . '/../../lib'); 
     49            self::$libPath = realpath(dirname(__FILE__) . '../../../../lib'); 
    4950        } 
    50          
     51 
    5152        return self::$libPath; 
    5253    } 
     
    6263    { 
    6364        if (null == self::$sourcePath) { 
    64             self::$sourcePath = realpath(dirname(__FILE__) . '/../../src/main'); 
     65            self::$sourcePath = realpath(dirname(__FILE__) . '../../../../src/main'); 
    6566        } 
    66          
     67 
    6768        return self::$sourcePath; 
    6869    } 
     
    8081            self::$logPath = realpath(dirname(__FILE__) . '/../../log'); 
    8182        } 
    82          
     83 
    8384        return self::$logPath; 
    8485    } 
     
    9697            self::$cachePath = realpath(dirname(__FILE__) . '/../../cache'); 
    9798        } 
    98          
     99 
    99100        return self::$cachePath; 
    100101    } 
     
    112113            self::$configPath = realpath(dirname(__FILE__) . '/../'); 
    113114        } 
    114          
     115 
    115116        return self::$configPath; 
    116117    } 
     
    124125    { 
    125126        return false; 
    126         #return true; 
    127127    } 
    128128} 
  • trunk/examples/docroot/bootstrap-stubbles.php

    r680 r681  
    11<?php 
    2 require dirname(__FILE__) . '/../config-examples/php/config.php'; 
     2require dirname(__FILE__) . '/../config/php/config.php'; 
    33 
    44if (file_exists(stubConfig::getLibPath() . DIRECTORY_SEPARATOR . 'stubbles.php') == true) {