Skip to content

Commit dc0533a

Browse files
committed
CM-44581 gradle - support restore projects and by selecting specific project
1 parent b1eef5c commit dc0533a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cycode/cli/files_collector/sca/maven/restore_gradle_dependencies.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from cycode.cli.consts import SCA_GRADLE_ALL_SUB_PROJECTS_FLAG
88
from cycode.cli.files_collector.sca.base_restore_dependencies import BaseRestoreDependencies
99
from cycode.cli.models import Document
10+
from cycode.cli.utils.path_utils import get_path_from_context
1011
from cycode.cli.utils.shell_executor import shell
1112

1213
BUILD_GRADLE_FILE_NAME = 'build.gradle'
@@ -41,11 +42,11 @@ def verify_restore_file_already_exist(self, restore_file_path: str) -> bool:
4142
return os.path.isfile(restore_file_path)
4243

4344
def get_working_directory(self, document: Document) -> Optional[str]:
44-
return self.context.params.get('paths')[0] if self.is_gradle_sub_projects() else None
45+
return get_path_from_context(self.context) if self.is_gradle_sub_projects() else None
4546

4647
def get_all_projects(self) -> List[str]:
4748
projects_output = shell(command=BUILD_GRADLE_ALL_PROJECTS_COMMAND, timeout=BUILD_GRADLE_ALL_PROJECTS_TIMEOUT,
48-
working_directory=self.context.params.get('paths')[0])
49+
working_directory=get_path_from_context(self.context))
4950

5051
projects = re.findall(ALL_PROJECTS_REGEX, projects_output)
5152

0 commit comments

Comments
 (0)