Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Pasternak committed Nov 13, 2024
1 parent a332fe5 commit 9645774
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ static Optional<File> findAspectTemplateDirectory() {

static Optional<String>[] getOverrideFlags(Project project) {

Optional<BlazeProjectData> projectData = Optional.ofNullable(
BlazeProjectDataManager.getInstance(project).getBlazeProjectData());
Optional<BlazeProjectData> projectData =
Optional.ofNullable(BlazeProjectDataManager.getInstance(project))
.flatMap(it -> Optional.ofNullable(it.getBlazeProjectData()));
boolean useInjectedRepository = projectData
.map(it -> it.getBlazeVersionData().bazelIsAtLeastVersion(8,0,0))
.map(it -> it.getBlazeVersionData().bazelIsAtLeastVersion(8, 0, 0))
.orElse(false); //fall back to false, as override_repository is available for all bazel versions
return new Optional[] {
return new Optional[]{
getOverrideFlagForAspectDirectory(useInjectedRepository),
getOverrideFlagForProjectAspectDirectory(project, useInjectedRepository),
};
Expand Down

0 comments on commit 9645774

Please sign in to comment.