Esempio n. 1
0
def collect_compiler_info (project_path):
    log("collect compiler info")
    haxe_exec = hxsettings.haxe_exec()
    
    env = get_compiler_info_env(project_path)

    if haxe_exec != "haxe":
        if project_path != None:
            haxe_exec = path_tools.join_norm(project_path, haxe_exec)
    
    
    log("cmd" + " ".join([haxe_exec, "-main", "Nothing", "-v", "--no-output"]))
    out, err = run_cmd( [haxe_exec, "-main", "Nothing", "-v", "--no-output"], env=env )
    log( out )
    log( err )
    m = classpath_line.match(out)
    
    classes = []
    packs = []
    std_paths = []

    if m is not None :
        std_paths = set(m.group(1).split(";")) - set([".","./"])
    


    for p in std_paths : 
        
        p = os.path.normpath(p)
        
        # last_pos - 2 on windows (why -2) ????? 
        # TODO check this, seems to work, but dirty
        last_pos = len(p)-2
        
        if (len(p) > 0 and (p[last_pos] == "/" or  p[last_pos] == "\\" or p[last_pos] == os.path.sep)):
            p = p[0:last_pos]
        log("path: " + p)
        log(os.path.exists(p))
        log(os.path.isdir(p))

        if len(p) > 1 and os.path.exists(p) and os.path.isdir(p):
            log("do extract")
            classes, packs = hxtypes.extract_types( p, [], [], 0, [], False )
            

    ver = re.search( haxe_version , out )
    log("collected classes: " + str(len(classes)))
    return (classes, packs, ver, std_paths)
Esempio n. 2
0
    def extract_types(self):

        if self.dev is True or (self.classes is None and self.packages is None):
            self.classes, self.packages = hxtypes.extract_types(self.path)

        return self.classes, self.packages