Ejemplo n.º 1
0
    def scan():
        hlout, hlerr = run_cmd([hxsettings.haxelib_exec(), "config"])
        HaxeLib.basePath = hlout.strip()

        HaxeLib.available = {}

        hlout, hlerr = run_cmd([hxsettings.haxelib_Exec(), "list"])

        for l in hlout.split("\n"):
            found = libLine.match(l)
            if found is not None:
                name, dev, version = found.groups()
                lib = HaxeLib(name, dev is not None, version)

                HaxeLib.available[name] = lib
Ejemplo n.º 2
0
    def install(self, libs, i):
        if i < 0:
            return

        haxelib = hxsettings.haxelib_exec
        if i == len(libs):
            cmd = [haxelib, "upgrade"]
        else:
            lib = libs[i]
            print "lib to install: " + lib
            if lib in HaxeLib.available:
                cmd = [haxelib, "remove", lib]
            else:
                cmd = [haxelib, "install", lib]

        run_cmd(cmd)
Ejemplo n.º 3
0
    def run(self):
        print "try install lib"
        out, err = run_cmd([hxsettings.haxelib_exec(), "search", " "])

        libs = self.collect_libraries(out)

        menu = self.prepare_menu(libs)

        cb = functools.partial(self.install, libs)

        self.window.show_quick_panel(menu, cb)
Ejemplo n.º 4
0
	def run (self, haxe_exec, env, server_mode, view, project):
		cmd, build_folder, nekox_file_name = self.prepare_run(haxe_exec, server_mode, view, project)
		
		out, err = run_cmd( args=cmd, input="", cwd=build_folder, env=env )
		log("-------------------------------------")
		log("out:" + out)
		log("err:" + err)
		log("---------compiler-output-------------")
		# execute compiled file if hxml/build has -x target
		if nekox_file_name is not None:
			self.run_neko_x(build_folder, nekox_file_name)
		return out,err
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
	def run_neko_x(self, build_folder, neko_file_name):
		neko_file = os.path.join(build_folder, neko_file_name)
		log(neko_file) 
		out1, err1 = run_cmd(["neko", neko_file])
		log(out1)