Esempio n. 1
0
    def run(self, paths, goals, props=None, kill=False):
        if self.window.active_view():
            self.window.active_view().erase_status('_mvn')

        if kill:
            if self.proc:
                self.proc.kill()
                self.proc = None
                self.append_data(None, "[Cancelled]")
            return

        if len(paths) == 0 and self.window.active_view().file_name():
            paths = [self.window.active_view().file_name()]
        self.pomDir = pom.find_nearest_pom(paths[0])
        if not self.pomDir:
            self.window.active_view().set_status(
                '_mvn', 'No pom.xml found for path ' + paths[0])
            return

        if not hasattr(self, 'output_view'):
            # Try not to call get_output_panel until the regexes are assigned
            self.output_view = self.window.get_output_panel("exec")

        self.output_view.settings().set("result_file_regex",
                                        file_regex_pattern)
        self.output_view.settings().set("result_base_dir", self.pomDir)

        # Call get_output_panel a second time after assigning the above
        # settings, so that it'll be picked up as a result buffer
        self.window.get_output_panel("exec")

        if len(goals) == 0:
            self.window.show_input_panel('mvn', ' '.join(self.last_run_goals),
                                         self.on_done, None, None)
        else:
            self.last_run_goals = goals
            if props:
                self.last_run_goals += [
                    self.replace_class(prop) for prop in props
                ]
            self.on_done(' '.join(self.last_run_goals))
Esempio n. 2
0
 def run(self, paths, goals):
     self.window.active_view().erase_status('_mvn')
     if m2_home:
         self.env['M2_HOME'] = m2_home
     # on windows: use mvn.bat
     if os.name == 'nt':
         self.cmd = ['mvn.bat']
     else:
         self.cmd = ['mvn']
     # add /usr/local/bin to the path (for some reason not present through sublime)
     if os.name == 'posix':
         self.env['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/local/bin'
     if len(paths) == 0 and self.window.active_view().file_name():
         paths = [self.window.active_view().file_name()]
     self.pomDir = pom.find_nearest_pom(paths[0])
     if not self.pomDir:
         self.window.active_view().set_status('_mvn', 'No pom.xml found for path ' + paths[0])
         return
     if len(goals) == 0:
         self.window.show_input_panel('mvn',' '.join(self.last_run_goals),self.on_done,None,None)
     else:
         self.last_run_goals = goals
         self.on_done(' '.join(self.last_run_goals))
Esempio n. 3
0
    def run(self, paths, goals, props = None, kill = False):
        if self.window.active_view():
            self.window.active_view().erase_status('_mvn')

        if kill:
            if self.proc:
                self.proc.kill()
                self.proc = None
                self.append_data(None, "[Cancelled]")
            return

        if len(paths) == 0 and self.window.active_view().file_name():
            paths = [self.window.active_view().file_name()]
        self.pomDir = pom.find_nearest_pom(paths[0])
        if not self.pomDir:
            self.window.active_view().set_status('_mvn', 'No pom.xml found for path ' + paths[0])
            return

        if not hasattr(self, 'output_view'):
            # Try not to call get_output_panel until the regexes are assigned
            self.output_view = self.window.get_output_panel("exec")

        self.output_view.settings().set("result_file_regex", file_regex_pattern)
        self.output_view.settings().set("result_base_dir", self.pomDir)

        # Call get_output_panel a second time after assigning the above
        # settings, so that it'll be picked up as a result buffer
        self.window.get_output_panel("exec")

        if len(goals) == 0:
            self.window.show_input_panel('mvn',' '.join(self.last_run_goals), self.on_done, None, None)
        else:
            self.last_run_goals = goals
            if props:
                self.last_run_goals += [ self.replace_class(prop) for prop in props ]
            self.on_done(' '.join(self.last_run_goals))
Esempio n. 4
0
 def is_enabled(self, paths, goals, props = None, kill = False):
     if len(paths) == 0 and self.window.active_view().file_name():
         paths = [self.window.active_view().file_name()]
     return ((len(paths) == 1) and (pom.find_nearest_pom(paths[0]) != None)) or kill
Esempio n. 5
0
 def is_enabled(self, paths, goals, props=None, kill=False):
     if len(paths) == 0 and self.window.active_view().file_name():
         paths = [self.window.active_view().file_name()]
     return ((len(paths) == 1) and
             (pom.find_nearest_pom(paths[0]) != None)) or kill