Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
BUILD_GRADLE_FILE_NAME = 'build.gradle'
BUILD_GRADLE_KTS_FILE_NAME = 'build.gradle.kts'
BUILD_GRADLE_DEP_TREE_FILE_NAME = 'gradle-dependencies-generated.txt'
BUILD_GRADLE_ALL_PROJECTS_TIMEOUT = 180
BUILD_GRADLE_ALL_PROJECTS_COMMAND = ['gradle', 'projects']
ALL_PROJECTS_REGEX = r"[+-]{3} Project '(.*?)'"

Expand Down Expand Up @@ -48,7 +47,7 @@ def get_working_directory(self, document: Document) -> Optional[str]:
def get_all_projects(self) -> set[str]:
output = shell(
command=BUILD_GRADLE_ALL_PROJECTS_COMMAND,
timeout=BUILD_GRADLE_ALL_PROJECTS_TIMEOUT,
timeout=self.command_timeout,
working_directory=get_path_from_context(self.ctx),
)
if not output:
Expand Down
16 changes: 9 additions & 7 deletions cycode/cli/files_collector/sca/sca_file_collector.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from typing import TYPE_CHECKING, Optional

import typer
Expand Down Expand Up @@ -122,14 +123,15 @@ def _try_restore_dependencies(


def _get_restore_handlers(ctx: typer.Context, is_git_diff: bool) -> list[BaseRestoreDependencies]:
build_dep_tree_timeout = int(os.getenv('CYCODE_BUILD_DEP_TREE_TIMEOUT_SECONDS', BUILD_DEP_TREE_TIMEOUT))
return [
RestoreGradleDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreMavenDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreSbtDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreGoDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreNugetDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreNpmDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreRubyDependencies(ctx, is_git_diff, BUILD_DEP_TREE_TIMEOUT),
RestoreGradleDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreMavenDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreSbtDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreGoDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreNugetDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreNpmDependencies(ctx, is_git_diff, build_dep_tree_timeout),
RestoreRubyDependencies(ctx, is_git_diff, build_dep_tree_timeout),
]


Expand Down