チェンジセット 906

差分発生行の前後
無視リスト:
コミット日時:
2008/07/29 18:35:38 (4 年前)
コミッタ:
seagirl
ログメッセージ:

generate コマンドを 1.0.2 にした。
サブパッケージを指定出来るようになったのと、DataFilter? も作れるようになった。

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/GeniusFramework/trunk/app-template/script/generate

    r896 r906  
    55type= 
    66output= 
     7subpackage= 
    78 
    89 
    910# オプションをハンドリング 
    10 while getopts n:p:t:o:h opt 
     11while getopts n:p:t:o:s:h opt 
    1112do 
    1213        case $opt in 
     
    1920        o )    output=$OPTARG 
    2021               ;; 
     22        s )    subpackage=$OPTARG 
     23               ;; 
    2124        h )    echo '使用方法: generate [<オプション>] [名前] 
    22 バージョン 1.0.1 
     25バージョン 1.0.2 
    2326         
    2427利用可能なオプション: 
    2528    -n クラスの名前 
    2629    -p クラスのパッケージ(デフォルトは"application"です。) 
     30    -s クラスのサブパッケージ 
    2731    -t クラスのタイプ("View", "Model", "Thread" を指定することが出来ます。デフォルトは "View") 
    2832    -o 出力先(指定しない場合は、パッケージとタイプから出力先を決めます) 
     
    6872        then 
    6973                type=Model 
     74        elif [ ${name%*Filter} != $name ] 
     75        then 
     76                type=Filter 
    7077        elif [ ${name%*Thread} != $name ] 
    7178        then 
     
    7784                type=View 
    7885        fi 
     86fi 
     87 
     88# パッケージの調整 
     89if [ $type = Model ] 
     90then 
     91        package=${package}.models 
     92         
     93elif [ $type = Filter ] 
     94then 
     95        package=${package}.models 
     96         
     97elif [ $type = View ] 
     98then 
     99        package=${package}.views 
     100         
     101elif [ $type = Renderer ] 
     102then 
     103        package=${package}.views 
     104         
     105elif [ $type = Thread ] 
     106then 
     107        package=${package}.threads 
     108         
     109elif [ $type = URLLoaderServiceThread ] 
     110then 
     111        package=${package}.threads 
     112         
    79113else 
    80         if [ $type != Model ] 
    81         then 
    82                 if [ $type != View ] 
    83                 then 
    84                         if [ $type != Renderer ] 
    85                         then 
    86                                 if [ $type != Thread ] 
    87                                 then 
    88                                         if [ $type != URLLoaderServiceThread ] 
    89                                         then 
    90                                                 echo 'Error: type must be "Model" or "View" or "Thread"' 
    91                                                 exit 
    92                                         fi  
    93                                 fi 
    94                         fi 
    95                 fi 
    96         fi 
     114        echo 'Error: type must be "Model" or "View" or "Thread"' 
     115        exit 
     116fi 
     117 
     118# サブディレクトリの調整 
     119if [ ${subpackage:-0} != 0 ] 
     120then 
     121        package=${package}.${subpackage} 
    97122fi 
    98123 
     
    103128then 
    104129        output=${path}/../src/${package_path} 
    105          
    106         if [ $type = View ] 
    107         then 
    108                 output=$output/views 
    109         elif [ $type = Renderer ] 
    110         then 
    111                 output=$output/views 
    112         elif [ $type = Model ] 
    113         then 
    114                 output=$output/models 
    115         elif [ $type = Thread ] 
    116         then 
    117                 output=$output/threads 
    118         elif [ $type = URLLoaderServiceThread ] 
    119         then 
    120                 output=$output/threads 
    121         fi 
    122130fi 
    123131 
     
    157165         
    158166        echo created ${output}/${name}.as 
     167 
     168elif [ $type = Filter ] 
     169then 
     170        sed -e "s/\[% name %]/$name/g" ${template}/Filter.as | 
     171        sed -e "s/\[% package %]/$package/g" > genius-tmp 
     172        mv genius-tmp ${output}/${name}.as 
     173         
     174        echo created ${output}/${name}.as 
    159175         
    160176elif [ $type = Thread ] 
  • as3/GeniusFramework/trunk/app-template/script/templates/Model.as

    r849 r906  
    1 package [% package %].models 
     1package [% package %] 
    22{ 
    33        import jp.seagirl.genius.models.Model; 
  • as3/GeniusFramework/trunk/app-template/script/templates/Renderer.mxml

    r896 r906  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<[% name %]Base 
    3         xmlns="[% package %].views.*" 
     3        xmlns="[% package %].*" 
    44        xmlns:mx="http://www.adobe.com/2006/mxml" 
    55        xmlns:genius="http://seagirl.jp/genius"> 
  • as3/GeniusFramework/trunk/app-template/script/templates/RendererBase.as

    r896 r906  
    1 package [% package %].views 
     1package [% package %] 
    22{ 
    33        import jp.seagirl.genius.views.ItemRenderer; 
  • as3/GeniusFramework/trunk/app-template/script/templates/Thread.as

    r849 r906  
    1 package [% package %].threads 
     1package [% package %] 
    22{ 
    33        import jp.seagirl.genius.threads.GeniusThread; 
  • as3/GeniusFramework/trunk/app-template/script/templates/URLLoaderServiceThread.as

    r870 r906  
    1 package [% package %].threads.event 
     1package [% package %] 
    22{ 
    33        import flash.errors.IOError; 
  • as3/GeniusFramework/trunk/app-template/script/templates/View.mxml

    r849 r906  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<[% name %]Base 
    3         xmlns="[% package %].views.*" 
     3        xmlns="[% package %].*" 
    44        xmlns:mx="http://www.adobe.com/2006/mxml" 
    55        xmlns:genius="http://seagirl.jp/genius"> 
  • as3/GeniusFramework/trunk/app-template/script/templates/ViewBase.as

    r849 r906  
    1 package [% package %].views 
     1package [% package %] 
    22{ 
    33        import jp.seagirl.genius.views.ViewBase;