Changeset 472 in dev


Ignore:
Timestamp:
Mar 31, 2008, 12:33:24 PM (16 years ago)
Author:
dai_9181
Message:

デプロイ時にcore.lib/cored.libのビルドもできるようにした。

Location:
trunk/ab5.0
Files:
2 added
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler32/stdafx.h

    r467 r472  
    1616#include <shlobj.h>
    1717#include <process.h>
     18#include <fcntl.h>
     19#include <io.h>
    1820
    1921//boost libraries
  • trunk/ab5.0/abdev/BasicCompiler64/stdafx.h

    r468 r472  
    1616#include <shlobj.h>
    1717#include <process.h>
     18#include <fcntl.h>
     19#include <io.h>
    1820
    1921//boost libraries
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r471 r472  
    574574}
    575575
    576 #include <fcntl.h>
    577 #include <io.h>
    578 
    579576int main()
    580577{
     
    753750            MainThread(0);
    754751
    755             ExitProcess( 0 );
     752            trace("Complete ActiveBasic Compiler!");
     753
     754            ExitProcess( program.GetExitCode() );
    756755            return 0;
    757756        }
     
    798797    trace("Complete ActiveBasic Compiler!");
    799798
    800     ExitProcess( 0 );
     799    ExitProcess( program.GetExitCode() );
    801800
    802801    return 0;
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r467 r472  
    181181                else
    182182                {
    183                     compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
     183                    compiler.errorMessenger.Output( 203, path.GetFullPath() );
    184184                    isSuccessfulLoadStaticLinkLibrary = false;
    185185                }
     
    187187            else
    188188            {
    189                 compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
     189                compiler.errorMessenger.Output( 202, path.GetFullPath() );
    190190                isSuccessfulLoadStaticLinkLibrary = false;
    191191            }
     
    204204                else
    205205                {
    206                     compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
     206                    compiler.errorMessenger.Output( 203, path.GetFullPath() );
    207207                    isSuccessfulLoadStaticLinkLibrary = false;
    208208                }
     
    210210            else
    211211            {
    212                 compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
     212                compiler.errorMessenger.Output( 202, path.GetFullPath() );
    213213                isSuccessfulLoadStaticLinkLibrary = false;
    214214            }
     
    280280    SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
    281281
     282    // エラーがない場合はビルド成功とする
     283    if( !compiler.errorMessenger.HasError() )
     284    {
     285        // ビルド成功
     286        compiler.BuildSuccessful();
     287    }
     288
    282289#ifdef _DEBUG
    283290    // デバッグモードのときはダイアログが隠れている
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r465 r472  
    2525
    2626private:
     27    // ビルド成功のフラグ
     28    bool isBuildSuccessful;
     29
    2730    // モジュール名
    2831    std::string moduleName;
     
    4750
    4851    Compiler()
    49         : pObjectModule( new ObjectModule )
     52        : isBuildSuccessful( false )
     53        , pObjectModule( new ObjectModule )
    5054        , pNowObjectModule( pObjectModule )
    5155        , targetModuleType( Exe )
     
    7175    void StaticLink( ObjectModules &staticLibraries );
    7276
     77    // ビルド成功のフラグ
     78    bool IsBuildSuccessful() const
     79    {
     80        return isBuildSuccessful;
     81    }
     82    void BuildSuccessful()
     83    {
     84        isBuildSuccessful = true;
     85    }
     86
    7387    // モジュール名
    7488    void SetModuleName( const std::string &moduleName )
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h

    r465 r472  
    6363public:
    6464    void Output( const ErrorInfo &errorInfo );
    65     void Output( int errorCode, const std::string &keyword, int sourceIndex );
    66     void Output( int errorCode, const char *keyword, int sourceIndex );
     65    void Output( int errorCode, const std::string &keyword, int sourceIndex = -1 );
     66    void Output( int errorCode, const char *keyword, int sourceIndex = -1 );
    6767    void OutputFatalError();
    6868
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h

    r471 r472  
    8686        this->includeDir = includeDir;
    8787    }
     88
     89    int GetExitCode() const;
    8890};
    8991
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp

    r468 r472  
    256256    if(errorCode==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
    257257    if(errorCode==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
     258    if(errorCode==202) sprintf(msg,"\"%s\" は存在しません。",tempKeyWord);
     259    if(errorCode==203) sprintf(msg,"\"%s\" は存在しますが、読み込めません(古いバージョンのコンパイラでビルドされた可能性があります)。",tempKeyWord);
    258260
    259261    //原因不明
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp

    r471 r472  
    2626    {
    2727        // 先頭に無名コマンドがきた場合、ソースファイル名として認識する
    28         Program::SetSourceFilePath( cmdLines[cmdLineIndex].GetParameter() );
     28        std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
     29        Program::SetSourceFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
    2930
    3031        cmdLineIndex ++;
     
    4041        {
    4142            // 二番目にも無名コマンドがきた場合、ソースファイル名として認識する
    42             SetOutputFilePath( cmdLines[cmdLineIndex].GetParameter() );
     43            std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
     44            SetOutputFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
    4345
    4446            cmdLineIndex ++;
     
    102104        {
    103105            //インクルード ディレクトリ
    104             includeDir = cmdLine.GetParameter();
     106            includeDir = cmdLines[cmdLineIndex].GetParameter();
     107
     108            // '/' があった場合は '\\' に置換
     109            Jenga::Common::StringReplace( includeDir, "/", "\\" );
    105110        }
    106111        else
     
    119124    return true;
    120125}
     126
     127int Program::GetExitCode() const
     128{
     129    if( !compiler.IsBuildSuccessful() )
     130    {
     131        // ビルドに失敗
     132        return 1;
     133    }
     134
     135    // ビルドに成功
     136    return 0;
     137}
  • trunk/ab5.0/build.xml

    r446 r472  
    1 <project name="ActiveBasic" default="deploy">
     1<project name="ActiveBasic" default="deploy_all">
    22
    3     <target name="deploy">
     3    <!-- å
     4±é€šãƒ—ロパティ -->
     5    <property name="abc32" value="./ablib/bin/BasicCompiler32.exe"/>
     6    <property name="abc64" value="./ablib/bin/BasicCompiler64.exe"/>
     7
     8    <target name="deploy_all">
     9        <antcall target="make_x86_core_lib" />
     10        <antcall target="make_x86_cored_lib" />
     11        <antcall target="make_x64_core_lib" />
     12        <antcall target="make_x64_cored_lib" />
     13        <antcall target="copy_files" />
     14    </target>
     15
     16    <target name="deploy_x86_only">
     17        <antcall target="make_x86_core_lib" />
     18        <antcall target="make_x86_cored_lib" />
     19        <antcall target="copy_files" />
     20    </target>
     21
     22    <target name="copy_files">
    423        <property name="rootdir" value="./dest" />
    524        <property name="application" value="${rootdir}/ActiveBasic" />
     
    3150    </target>
    3251
     52    <target name="make_x86_core_lib">
     53        <exec executable="${abc32}" failonerror="true">
     54            <arg value="../Include/basic.sbp" />
     55            <arg value="../lib/core.lib" />
     56            <arg value="/static_library" />
     57            <arg value="/include_dir:..\Include\" />
     58        </exec>
     59    </target>
     60
     61    <target name="make_x86_cored_lib">
     62        <exec executable="${abc32}" failonerror="true">
     63            <arg value="../Include/basic.sbp" />
     64            <arg value="../lib/cored.lib" />
     65            <arg value="/static_library" />
     66            <arg value="/debug" />
     67            <arg value="/include_dir:..\Include\" />
     68        </exec>
     69    </target>
     70
     71    <target name="make_x64_core_lib">
     72        <exec executable="${abc64}" failonerror="true">
     73            <arg value="../Include/basic.sbp" />
     74            <arg value="../lib/x64/core.lib" />
     75            <arg value="/static_library" />
     76            <arg value="/include_dir:..\Include\" />
     77        </exec>
     78    </target>
     79
     80    <target name="make_x64_cored_lib">
     81        <exec executable="${abc64}" failonerror="true">
     82            <arg value="../Include/basic.sbp" />
     83            <arg value="../lib/x64/cored.lib" />
     84            <arg value="/static_library" />
     85            <arg value="/debug" />
     86            <arg value="/include_dir:..\Include\" />
     87        </exec>
     88    </target>
     89
    3390</project>
  • trunk/ab5.0/jenga/include/common/String.h

    r465 r472  
    1111bool IsExistString( const Jenga::Common::Strings &strings, const std::string &findStr );
    1212
     13std::string& StringReplace( std::string& str, const std::string sb, const std::string sa );
     14
    1315}
    1416}
  • trunk/ab5.0/jenga/src/common/String.cpp

    r465 r472  
    1414    return false;
    1515}
     16
     17std::string& Jenga::Common::StringReplace( std::string& str, const std::string sb, const std::string sa )
     18{
     19    std::string::size_type n, nb = 0;
     20   
     21    while ((n = str.find(sb,nb)) != std::string::npos)
     22    {
     23        str.replace(n,sb.size(),sa);
     24        nb = n + sa.size();
     25    }
     26   
     27    return str;
     28}
Note: See TracChangeset for help on using the changeset viewer.