Changeset 551


Ignore:
Timestamp:
02/14/09 00:35:30 (3 years ago)
Author:
mooneer
Message:

Added module dependencies to package builder.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • interpreter/trunk/modules/System/package/builder.kt

    r550 r551  
    5555    property custom_post_install_rules 
    5656        /[Custom install rules (post-install).]/, 
    57         
     57    property module_depends 
     58        /[Modules that libraries depend on.]/, 
     59         
    5860    construct() 
    5961        /[Class constructor.]/ 
     
    6365        this.file_cflags = make System.collections.binary_tree(); 
    6466        this.library_ldflags = make System.collections.binary_tree(); 
     67        this.module_depends = make System.collections.binary_tree(); 
    6568        this.custom_pre_build_rules = []; 
    6669        this.custom_post_build_rules = []; 
     
    207210    process_builder_custom_rules(options, options.custom_pre_build_rules); 
    208211     
     212    # Check module dependencies 
     213    options.libraries_built|reset; 
     214    while(options.libraries_built|cur) 
     215    [ 
     216        decide [ 
     217            (not (options.module_depends[options.libraries_built|cur] is System.null))  
     218            [ 
     219                property tmp; 
     220                tmp = options.module_depends[options.libraries_built|cur]; 
     221                tmp|reset; 
     222                while(tmp|cur) 
     223                [ 
     224                    run [ 
     225                        eval "import \"%s\";"|format([tmp|cur]); 
     226                    ] catch [ 
     227                        "Could not load %s, a needed dependency."|format([tmp|cur])|print; 
     228                        "Exception: %s"|format([__exc|str])|print; 
     229                        "Please (re)install and try again."|print; 
     230                        System.vm.thread|exit; 
     231                    ]; 
     232                    tmp|next; 
     233                ]; 
     234            ] 
     235        ]; 
     236        options.libraries_built|next; 
     237    ]; 
     238     
    209239    run_command_with_echo("rm -rf dist/"); 
    210240    run_command_with_echo("mkdir dist/"); 
Note: See TracChangeset for help on using the changeset viewer.