Changeset 19452


Ignore:
Timestamp:
2009-05-13T16:41:41+12:00 (15 years ago)
Author:
oranfry
Message:

a generalised c++ source file for wirkX executables

File:
1 copied

Legend:

Unmodified
Added
Removed
  • release-kits/shared/windows/wirk.cpp

    r19446 r19452  
    2020void show_help() {
    2121
    22     cout << "Wirk2 - Windows Release Kit for Greenstone2" << endl;
     22    cout << "WirkXXX - Windows Release Kit for GreenstoneXXX" << endl;
    2323    cout << "Helps you to create releases from the Repository" << endl << endl;
    2424
    25     cout << "usage: wirk2 [args]" << endl;
     25    cout << "usage: wirkXXX [args]" << endl;
    2626    cout << "   -sim" << endl;
    2727    cout << "       simulation only, don't actually do anything" << endl << endl;
     
    4040
    4141    cout << "   -cp" << endl;
    42     cout << "       show the classpath being used by wirk2" << endl << endl;
     42    cout << "       show the classpath being used by wirkXXX" << endl << endl;
    4343
    4444}
     
    5252    bool ok = true;
    5353    if ( getenv( "JAVA_HOME" ) == NULL ) {
    54         cerr << "Please set JAVA_HOME before running wirk2" << endl;
     54        cerr << "Please set JAVA_HOME before running wirkXXX" << endl;
    5555        ok = false;
    5656    }
    57     if ( getenv( "WIRK2_HOME" ) == NULL ) {
    58         cerr << "Please set WIRK2_HOME before running wirk2" << endl;
     57    if ( getenv( "WIRKXXX_HOME" ) == NULL ) {
     58        cerr << "Please set WIRKXXX_HOME before running wirkXXX" << endl;
    5959        ok = false;
    6060    }
     
    6262        return -1;
    6363    }
    64     //string PWD = getenv( "CD" );
    6564
    6665    //load environment variables
    6766    string JAVA_HOME = getenv( "JAVA_HOME" );
    68     string WIRK2_HOME = getenv( "WIRK2_HOME" );
    69     putenv( ("ANT_HOME=" + WIRK2_HOME + "\\core\\ant").c_str() );
     67    string WIRKXXX_HOME = getenv( "WIRKXXX_HOME" );
     68    putenv( ("ANT_HOME=" + WIRKXXX_HOME + "\\core\\ant").c_str() );
    7069   
    7170    //get the pwd
     
    7776    system( "del cd.dat" );
    7877       
    79     //set the classpath
    80     //classpath = pwd + "\\installer\\classes;" + JAVA_HOME + "\\core\\lib\\tools.jar;" + WIRK2_HOME + "\\core\\lib\\serializer.jar;" + WIRK2_HOME + "\\core\\lib\\xalan.jar;" + WIRK2_HOME + "\\core\\lib\\xercesImpl.jar;" + WIRK2_HOME + "\\core\\lib\\xml-apis.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-antlr.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-bcel.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-bsf.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-log4j.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-oro.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-regexp.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-apache-resolver.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-commons-logging.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-commons-net.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-icontract.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-jai.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-javamail.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-jdepend.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-jmf.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-jsch.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-junit.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-launcher.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-netrexx.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-nodeps.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-starteam.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-stylebook.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-swing.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-trax.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-vaj.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-weblogic.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-xalan1.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\ant-xslp.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\xercesImpl.jar;" + WIRK2_HOME + "\\core\\ant\\lib\\xml-apis.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ai-icons-amaranth.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ai-icons-bluecurve.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ai-icons-crystalsvg.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ai-icons-eclipse.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ai-icons-krystaline.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ant-installer-ext.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\ant-installer.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\jgoodies-edited-1_2_2.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\xercesImpl.jar;" + WIRK2_HOME + "\\core\\ant-installer\\lib\\xml-apis.jar;" + WIRK2_HOME + "\\core\\ant-installer\\classes";
    81     //putenv( ("CLASSPATH=" + classpath).c_str() );
     78    //create the command
     79    command = WIRKXXX_HOME + "\\core\\ant\\bin\\ant.bat -f \"" + WIRKXXX_HOME + "\\ant-scripts\\build.xml\" -addressing \"-Dwirk3.home=" + WIRKXXX_HOME + "\"";
    8280
    83     //check that it worked
    84     //string changed_classpath = getenv("CLASSPATH");
    85     //cout << "classpath: " << changed_classpath << endl;
    86    
    87     //create the command
    88     command = WIRK2_HOME + "\\core\\ant\\bin\\ant.bat -f " + WIRK2_HOME + "\\ant-scripts\\build.xml -addressing -Dwirk2.home=" + WIRK2_HOME;
    8981    //pass on the arguments
    9082    string a;
     
    9284    for ( int i=0; i < argc; i++ ) {
    9385        a = argv[i];
    94            
     86       
    9587        if ( a.compare("-help") == 0 || a.compare("--help") == 0 ) {
    9688            show_help();
     
    108100    }
    109101
    110     //use forward slashes for everything else
    111     //replace_all( pwd, "\\", "/" );
    112    
    113102    //set the basedir in the command
    114     command = command + " -Dbasedir=";
    115     command = command + pwd;
    116 
    117 
    118    
    119     //command = command + ".";
     103    command = command + " \"-Dbasedir=" + pwd + "\"";
    120104
    121105    cout
    122106        << "O-----------------------------------------O" << endl
    123107        << "|                                         |" << endl
    124         << "|   WiRK2                                 |" << endl
    125         << "|   Windows Release Kit for Greenstone2   |" << endl
     108        << "|   WiRKXXX                                 |" << endl
     109        << "|   Windows Release Kit for GreenstoneXXX   |" << endl
    126110        << "|                                         |" << endl
    127111        << "O-----------------------------------------O" << endl
Note: See TracChangeset for help on using the changeset viewer.