Skip to content

Commit

Permalink
Parse build_flags, sync_flags and test_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
guw committed Oct 8, 2023
1 parent 7e6b372 commit 20a563b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public void close() {
final LinkedHashMap<String, String> projectMappings = new LinkedHashMap<>();
final LinkedHashSet<String> importPreferences = new LinkedHashSet<>();
final LinkedHashSet<String> projectSettings = new LinkedHashSet<>();
final LinkedHashSet<String> buildFlags = new LinkedHashSet<>();
final LinkedHashSet<String> syncFlags = new LinkedHashSet<>();
final LinkedHashSet<String> testFlags = new LinkedHashSet<>();

public BazelProjectView build() throws IllegalStateException {
// check mandatory parameters
Expand Down Expand Up @@ -129,7 +132,10 @@ public BazelProjectView build() throws IllegalStateException {
targetProvisioningStrategy,
projectMappings,
preferencesToImport,
projectSettingsToSync);
projectSettingsToSync,
buildFlags,
syncFlags,
testFlags);
}

public ImportHandle startImporting(Path bazelProjectViewFile) throws IOException {
Expand Down Expand Up @@ -334,6 +340,18 @@ private void parseProjectFile(Path bazelProjectFile, BazelProjectViewBuilder bui
parseSectionBodyIntoList(rawSection).forEach(builder.projectSettings::add);
break;
}
case "build_flags": {
parseSectionBodyIntoList(rawSection).forEach(builder.buildFlags::add);
break;
}
case "sync_flags": {
parseSectionBodyIntoList(rawSection).forEach(builder.syncFlags::add);
break;
}
case "test_flags": {
parseSectionBodyIntoList(rawSection).forEach(builder.testFlags::add);
break;
}
case "import_target_output":
case "exclude_target": {
// ignore deprecated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,23 @@ public record BazelProjectView(
String targetProvisioningStrategy,
Map<String, String> projectMappings,
Collection<WorkspacePath> importPreferences,
Collection<WorkspacePath> projectSettings) {
Collection<WorkspacePath> projectSettings,
Collection<String> buildFlags,
Collection<String> syncFlags,
Collection<String> testFlags) {

public BazelProjectView {
directoriesToImport = Collections.unmodifiableCollection(directoriesToImport);
directoriesToExclude = Collections.unmodifiableCollection(directoriesToExclude);
targets = Collections.unmodifiableCollection(targets);
additionalLanguages = Collections.unmodifiableCollection(additionalLanguages);
tsConfigRules = Collections.unmodifiableCollection(tsConfigRules);
projectMappings = Collections.unmodifiableMap(projectMappings);
importPreferences = Collections.unmodifiableCollection(importPreferences);
projectSettings = Collections.unmodifiableCollection(projectSettings);
buildFlags = Collections.unmodifiableCollection(buildFlags);
syncFlags = Collections.unmodifiableCollection(syncFlags);
testFlags = Collections.unmodifiableCollection(testFlags);
}

}

0 comments on commit 20a563b

Please sign in to comment.