@name 获取jmap jhat jstack绝对路径 @author lkq<2021-09-24> @return list
(self, project_find)
| 4355 | return True |
| 4356 | |
| 4357 | def get_jmap_path(self, project_find): |
| 4358 | ''' |
| 4359 | @name 获取jmap jhat jstack绝对路径 |
| 4360 | @author lkq<2021-09-24> |
| 4361 | @return list |
| 4362 | ''' |
| 4363 | # 获取当前的jdk路径 |
| 4364 | ret = {} |
| 4365 | cmd = project_find['project_config']['project_cmd'] |
| 4366 | if not cmd: |
| 4367 | return False |
| 4368 | # 获取java的绝对路径 |
| 4369 | cmd = cmd.split() |
| 4370 | path = None |
| 4371 | for i in cmd: |
| 4372 | if 'bin/java' in i: |
| 4373 | path = i |
| 4374 | break |
| 4375 | if not path: |
| 4376 | jdk_list = self.get_local_jdk_version(None) |
| 4377 | if jdk_list: |
| 4378 | path = '/'.join(jdk_list[0][1].split('/')[:-1]) |
| 4379 | jmap_path = path + '/jmap' |
| 4380 | if os.path.exists(jmap_path): |
| 4381 | ret['jmap'] = jmap_path |
| 4382 | if os.path.exists(path + '/jhat'): |
| 4383 | ret['jhat'] = path + '/jhat' |
| 4384 | if os.path.exists(path + '/jstack'): |
| 4385 | ret['jstack'] = path + '/jstack' |
| 4386 | return ret |
| 4387 | else: |
| 4388 | path = '/'.join(path.split('/')[:-1]) |
| 4389 | jmap_path = path + '/jmap' |
| 4390 | if os.path.exists(jmap_path): |
| 4391 | ret['jmap'] = jmap_path |
| 4392 | if os.path.exists(path + '/jhat'): |
| 4393 | ret['jhat'] = path + '/jhat' |
| 4394 | if os.path.exists(path + '/jstack'): |
| 4395 | ret['jstack'] = path + '/jstack' |
| 4396 | return ret |
| 4397 | |
| 4398 | def get_project_dump(self, get): |
| 4399 | ''' |
no test coverage detected