Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Packages rearrange + Utils refactor #30

Merged
merged 18 commits into from
Jan 5, 2021
Merged

Packages rearrange + Utils refactor #30

merged 18 commits into from
Jan 5, 2021

Conversation

abrams27
Copy link
Member

@abrams27 abrams27 commented Jan 3, 2021

Closes #27

@SocksDevil
Copy link
Contributor

Thank you for this! Not sure if we should close the issue with this PR though, since it is also mentioned as we should update the tests with the updates that are coming to the testkit. Wdyt should be done? We could just open a new issue for that part or we could unlink this issue

@abrams27
Copy link
Member Author

abrams27 commented Jan 3, 2021

Thank you for this! Not sure if we should close the issue with this PR though, since it is also mentioned as we should update the tests with the updates that are coming to the testkit. Wdyt should be done? We could just open a new issue for that part or we could unlink this issue

I think that we can unlink - this PR is mainly about a further refactor (I will link correct issues)

@gerardd33
Copy link
Contributor

Thank you for this! Not sure if we should close the issue with this PR though, since it is also mentioned as we should update the tests with the updates that are coming to the testkit. Wdyt should be done? We could just open a new issue for that part or we could unlink this issue

I was going to resolve #29 in a separate PR but @abrams27 seems to already have fixed it and the fix is smaller than we thought (also it is related to the rest of the work and structure refactor in this PR), so I would suggest letting this PR fix this and do the testkit part later in a separate PR. That is, not reverting these changes but also not closing #29 yet.

@abrams27
Copy link
Member Author

abrams27 commented Jan 3, 2021

Okey, I marked that it fixes #29, but we don't want to close it. Also, I decided to change only Utils in this PR (+ packages rearrange) to keep it smaller

@abrams27 abrams27 changed the title Further refactor Packages rearrange + Utils refactor Jan 3, 2021
@abrams27 abrams27 marked this pull request as ready for review January 3, 2021 14:58
@abrams27 abrams27 requested review from gerardd33, SocksDevil and agluszak and removed request for gerardd33 and SocksDevil January 3, 2021 18:16
Copy link
Contributor

@agluszak agluszak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minor nits, otherwise lgtm

Copy link
Contributor

@SocksDevil SocksDevil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

Copy link
Contributor

@gerardd33 gerardd33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also 2 small notes, otherwise looks good.

}

public static String getRuleType(String ruleClass) {
return RULE_CLASS_TO_RULE_TYPE.getOrDefault(ruleClass, DEFAULT_RULE_TYPE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider removing this class altogether and moving the contents of this class to BazelBspBuildManager (it's only used there) – it too is still pretty strongly related to the logic there, it's not much code and BazelBspBuildManager should still be split into several pieces in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this util is in this package and it is related with manager. Also, in general we do want to split logic, so I believe that it should stay in the separate class

Copy link
Member Author

@abrams27 abrams27 Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+I rollbacked getRuleType method, because I missed .contains, what makes inconvenient to use map

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, just a suggestion. In this case maybe we should at least rename it to something that suggest these are parsing utils for the bsp package and not some general parsing utils? Don't have any good idea though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is in .../bsp/utils do we need specify it more?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BuildParsingUtils or BuildManagerParsingUtils would be fine for now but maybe we'd want to have here something from other places within the bsp package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually maybe it is a good idea after all. There are not many such places that make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@gerardd33 gerardd33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!

@abrams27 abrams27 merged commit 8a06aa1 into JetBrains:dev Jan 5, 2021
@abrams27 abrams27 deleted the further-refactor branch January 5, 2021 00:21
abrams27 added a commit that referenced this pull request Aug 6, 2021
* Change project structure (#12)

* [1 - Initial code refactor] basic classes extraction (#13)

* proces lock is a semaphore

* process start methods moved to the new class

* Build.Query moved to class

* targets options moved to the class

* action graph parser moved to the class

* getMnemonics moved to the class

* packages rearrangement

* scala sbt server moved to the class

* java sbt server moved to the class

* buildClientLogger + methods bodies moved uder calls

* brackets in ifs

* rebase

* proper enterprise package structure

* BUILD files in subpackages

* packages without java prefix

* logger todo

* imports are sorted

* Configure CI. (#16)

* Configure CI.

* Change job name.

* Add ls.

* Update java.ci.yml

* Update java.ci.yml

* Update java.ci.yml

* Fix test.sh

* Comment out tests.

* Update java.ci.yml

* Update test.sh

* Revert comment

* Uncomment one test

* Uncomment more tests

* Comment test

* Uniform commenting

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Update BazelBspServerTest.java

* Add master

* Uncomment tests

* Increase time limit of tests

* Increase time limit of tests

* Remove master

* Increase time limit of tests

* Increase time limit of one test

* Decrease total time

* Add master

* Refactor pt 2 (#18)

- Introduced `BazelRunner` class which is fully responsible for starting processes, awaiting them and gathering results
- Moved synchronized `get<BazelData>` methods to `BazelDataResolver`. They are no longer required to be synchronized, as all the required data is fetched in the constructor of `BazelBspServer`
- Removed checked exceptions in many places and the need for try-to-rethrow
- Removed `Either`s in many places where they were no longer needed
- Corrected several minor issues (`setBackendPort` appending to a constant, `convertExitCode` not using enum names)

* Add a CI job for formatting (#20)

Add a CI job for formatting

* Test refactor (#19)

* data moved to the separete class

* runner extraction + additional methods extraction

* workspace field is now in data class + constructor argument removal

* timeouts moved to the data class

* methods refactor

* .test.sh update

* logger

* test logs

* one more log

* minor reformat

* lombok dep removal

* code reformat

* buildifier

* fix

* [configuration] Optional argument on server startup (#15)

* [configuration] Optional argument on server startup

Add a optional parameters when starting a server to specify the target
that should be built.

* BEP Server refactor (#21)

* Separating interface implementations and general dependency structure refactor (#24)

* Extracted ScalaBuildServer implementation

* Extracted JavaBuildServer implementation, both classes now implement proper interfaces

* Extracted BuildServer endpoints, very tentatively (previous problems with it)

* Extracted BuildServer implementation more properly

* Tidied up initialized/finished methods + other smaller

* Extracted several things to ParsingUtils and Constants

* Extracted BazelBspServerLifetime and BazelBspRequestHelpers, Java- and ScalaBuildServer classes now not dependent on BazelBspServer

* Added server config, Bazel runner and Bazel data dependencies to the server implementation

* Adjusted BazelData dependencies

* Extracted ServerBuildManager

* Hotfix of the cyclical dependency, to improve iteratively

* Moved part of the BSP integration in Server to the BazelBspServer constructor

* Added further parts to the constructor integration

* Removed cyclical dependency between BuildManager and BuildServerImpl

* Started removing cyclical dependency between BazelBspServer and BepServer: BazelData passed in the constructor

* Resolved cyclical dependency between BuildManager and BepServer

* Cleaned up in BazelBspServer

* Simplified the constructor, moved away logic

* General cleanup

* Extracted suppliers from interface methods in BuildServerImpl

* Added build server implementations as fields

* Prepared for interface and service separation

* Separated BuildServer logic from interface implementation

* Separated logic from interface implementation for Scala and Java BuildServers

* Extracted BEP package

* Created new packages and grouped the files + small style improvements

* Minor style corrections

* Renamed Server.java, imported io.grpc.Server

* Corrections after review

* Naming and packaging changes

* Formatting fix

* Formatting fix

* bazel runner refactor (#23)

* package update

* BazelRunner logs + minor change

* ExitCodeMapper

* runBazelCommandBes update

* BazelRunnerUpdate v2

* BazelTestRunner

* BazelCleanRunner

* BazelRunRunner

* BazelBuildRunner

* BazelInfoRunner

* BazelActionGraphQueryRunner

* BazelQueryRunner

* renames

* bazel runner builder

* packages update

* QueryResolver update

* code reformat

* buldifier

* targets fix

* format fix

* format fix

* format fix v2

* format fix v3

* format fix v4

* rebase

* review fix

* reformat

* test fix

* query kind param

* reformat

* review fix

* reformat

* packages rename

* runner lists creation update

* refactor

* common -> commons

* resolver -> resolvers

* service -> services

* util -> utils

* Packages rearrange + Utils refactor (#30)

* local services setter update

* .../impl -> .../bsp/impl

* .../services -> .../bsp/services

* ClasspathParser

* StderrDiagnosticsParser

* cleanup

* BazelBspServerTestData rollback

* .../resolvers -> .../bsp/resolvers

* reformat

* ActionGraphParser moved to resolvers

* ParsingUtils update

* reformat

* flag fix

* review fix

* setLocalService rollback

* reviw fix

* getRuleType rollback

* rename

* [Post BazelBuilder refactor part 1] TargetsResolver update (#33)

* BuildClientLogger does NOT throw an exception

* BuildClientLogger moved to bep package

* TargetsUtils now maps targets to uris

* .../resolvers/targets package

* Scala/JavaBuildServerService constructor update

* TargetsResolver constructor update

* TargetsResolver builder

* TargetsResolver refactor

* targets package removal

* reformat

* review fixes

* unused import + targetsResolver constructor visibility

* [Post BazelBuilder refactor part 2] TargetsRuleResolver (#34)

* ActionGraphParser getInputs more optimal implementation

* typo in tests

* TargetsResolver -> TargetsLanguageOptionsResolver

* TargetsRulesResolver

* reformat

* TargetsRulesResolver -> TargetRulesResolver

* Solving problems with Scala- and Java-specific endpoints (#32)

* Added an aggregate build server implementation file for passing to the launcher

* Renamed the hub class

* Moved the hub class to server/bsp

* buildTargetScalaTestClasses implementation  (#35)

* method signature update

* poc

* logic implementation

* getSrcsPaths signature rollback

* reformat

* Apply suggestions from code review

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* rules filter update

* main_class is the only source + constants update

* targets resolver is created only once in constructor

* reformat

* hasGivenName

* test

* test fix

* reformat

* success typo

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* Implement buildTargetScalaMainClasses (#36)

* Init

* Fix resolving target options

* Fix variable name

* Change access

* Fix formatting

* Fix formatting

* Read arguments

* Upgrade bsp-testkit

* Add empty test

* Fix formatting

* Move constants

* Fix

* Add more data to test

* Add package name

* Move targetRulesResolver to constructor

* return Completable Future instead of null

* Extract method

* Extract isAttributeSpecifiedAndHasGivenName

* Call buildServerImpl

* Pass compiler options and args to test

* Fix tests

* Fix tests

* Add more args to test

* Read also jvm flags

* Move to constants

* Read only jvm flags

* fix formatting

* unify naming

* use helper method

* remove duplicate methods

* Add more test cases

* revert

* Add test case

* target without args test case

* increase timeout

* add test case without jvm flags

* increase timeout

* increase timeout

* buildClient is now used in the bazel runner (#41)

* buildClient is now used in bazel runner

* format

* bazel runner doesnt throw an exception anymore

* javacoptions and scalacoptions tests (#37)

* scalacopts test

* javacopts test

* reformat

* buildifier

* java_binary import

* test fix

* testkit vestion bump + test fix

* more descriptive targets names

* scalac classDirectory and classpath test update

* .bazelversion file

* __main__/bazel-out/darwin-fastbuild/ removal

* workspaceReload implementation (#38)

* bazel builder sync

* workspaceReload PoC

* bazel sync -> bazel fetch

* reformat

* dev branch import fix (#46)

* executeBazelCommand -> executeBazelBesCommand

* bazel call

* bazel args checker removal

* bazel info update

* log update

* log config

* log level update

* config fix

* log fix

* fix

* log

* more logging

* XDXD

* LOL2

* bazel runner update

* reformat

* initializer clean up

* reformat

* exit code to constant

* date in logger

* bazelProcess moved to the bazel package

* refomat

* Prohibit wildcard imports using error-prone (#45)

So apparently error-prone is built into Bazel and provides a check for wildcard imports.
http://errorprone.info/docs/installation

* script for building and running server (#47)

* filtering blank strings from build progress logs (#50)

* filtering blank strings

* trim rollback

* isBlank -> isEmpty

* additional trim

* Fix build calls and outgroup groups interpretation (#49)

* Add builder without mnemonics for build command

* Change valid parts of classpath parsing

* Switch bazel build calls to use withArguments

* Action graph parser v2 (#42)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* >=info logs are separate now (#51)

* separate logs

* new logging levels

* appending logs

* Get jdk info (#43)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

* Get java home from default settings

* Get java version from aspect

* Get java version through aspect

* Refactor jvm build target data fetching

* Refactor jvm build target logic

* Map java home to uri

* Add java projects tests

* Remove ignored files

* Format

* Remove action graph logs

* Add new project directories to tests script

* Update BSP dependency

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* Refactor build manager into several build managers

commit 3fc3f66
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 15:39:50 2021 +0000

    Add no build flag to aspects

commit 3364cd1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 12:29:16 2021 +0000

    Add manager for aspects

commit 935c5fc
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 12:00:30 2021 +0000

    Update refactor according to new changes

commit 936ac94
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Mar 22 18:05:17 2021 +0000

    Refactor BazelBspServerBuildManager into several different services

commit 4dd0b01
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Feb 26 15:46:40 2021 +0000

    Get semantic version out of `bazel info release` command

commit c594dc1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Feb 16 16:43:52 2021 +0000

    Fix test

commit f931ccd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Feb 15 17:17:08 2021 +0000

    Parse action graph v2 for bazel versions over 4.0.0

commit 5f8f55f
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Feb 6 21:53:54 2021 +0100

    scalac classDirectory and classpath test update

commit a2088c5
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:21:16 2021 +0100

    buildifier

commit 9dbb63c
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:20:21 2021 +0100

    reformat

commit 57f6fa6
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:13:22 2021 +0100

    javacopts test

commit 26abd73
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 22:38:32 2021 +0100

    scalacopts test

commit c0591d0
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 23 19:47:12 2021 +0000

    Add builder without mnemonics for build command

* Add lazy variables

Squashed commits of the following:

commit 3c83a38
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Apr 16 12:10:26 2021 +0000

    Lazy vals recalculated on workspace reload

commit 5ff6d62
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 23:15:28 2021 +0000

    Add lazy vals for complicated calculations

* add Apache 2 license and badges

* Entire repository import test (#53)

* testkit version bump

* test

* todo

* style

* style v2

* ci fix 1

* ci fix

* variable update + gitignore update

* Add cpp support to packages:

commit c8c38f8
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri May 14 10:14:44 2021 +0000

    Add cpp folder to tests

commit 686b657
Merge: b0b06a3 5032915
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 22:44:35 2021 +0000

    Merge branch 'dev' into cpp-extension

commit b0b06a3
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 15:30:35 2021 +0000

    Add cpp dependency

commit b7cd44d
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 11:12:29 2021 +0000

    Add more options to cpp target example

commit 483d9fd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Apr 13 22:14:00 2021 +0000

    Tests for cpp

commit 73bc827
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 8 18:11:36 2021 +0000

    Updated cpp options command call

commit dfa21f4
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Mar 17 19:01:18 2021 +0000

    Add cpp extension method service

commit 9fa25dd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 16 18:48:17 2021 +0000

    Add cpp build target

* Remove java 11 methods

* Squashed commit of the following:

commit a9bac73
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue May 25 22:32:53 2021 +0000

    Add bazel-sonatype dependency

* Update scala repository checksums

* ProjectView files parser implementation (#55)

* ProjectView files parser implementation

* code reformat

* buildifier

* ci tests

* character variable extraction

* reading test config from file

* java docs

* parse default method

* google format

* google format v2

* PoC: First, very very very basic projectview usage (#57)

* reading file

* projecview provider

* projectview provider usage

* logic

* deps

* fix

* buildifier

* google format

* config removal

* google format v2

* test fix

* google format v3

* kind moved to utils

* config rollback

* fix

* Guarantee deps are built before finishing import. (#56)

* Guarantee deps are built before finishing import.

Dependencies must be fully build in order to guarantee the dependencies are all present for indexing.

* Increase tests timeout

* Refactor BazelBspCompilationManager for more readability

* Refactor targets union to TargetsUtils

* [Projectview] import support (#58)

* DirectoriesSectionParserTest tests rename

* TargetsSectionParserTest tests rename

* ProjectViewParserImplTest tests rename

* ProjectViewSectionSplitterTest tests rename

* import test

* splitter test update

* ProjectImportParser

* merge

* parser + test adjustment

* buildifier

* format

* format v2

* format v3

* format v4

* format v5

* format v6

* format v7

* format v8

* Update README.md

* Update README.md

* [fix] projectview - tab symbol parsing  (#66)

* tabs fix + test

* tests update

* google style

* google style v2

* [fix] Semantic version - more generic support (#68)

* tests

* homebrew version test

* impl fix

* google style

* [fix] 'Loading: 0 packages loaded' message prohibition (#71)

[fix] 'Loading: 0 packages loaded' message prohibition

* [fix] java 8 feature fix (#73)

* installation process simplification (#76)

* depdendencies update

* install script update

* instalation location

* Update README.md

* Update README.md

* Update README.md

* version bump

* RC1 version

Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>
Co-authored-by: ex0ns <ex0ns@users.noreply.github.com>
Co-authored-by: Gerard Drozdz <gerardd@interia.pl>
Co-authored-by: André Rocha <andre.rocha@jetbrains.com>
Co-authored-by: Andre Rocha <andrefmrocha@live.com.pt>
Co-authored-by: Justin Kaeser <justin.kaeser@jetbrains.com>
abrams27 added a commit that referenced this pull request Sep 27, 2021
* Change project structure (#12)

* [1 - Initial code refactor] basic classes extraction (#13)

* proces lock is a semaphore

* process start methods moved to the new class

* Build.Query moved to class

* targets options moved to the class

* action graph parser moved to the class

* getMnemonics moved to the class

* packages rearrangement

* scala sbt server moved to the class

* java sbt server moved to the class

* buildClientLogger + methods bodies moved uder calls

* brackets in ifs

* rebase

* proper enterprise package structure

* BUILD files in subpackages

* packages without java prefix

* logger todo

* imports are sorted

* Configure CI. (#16)

* Configure CI.

* Change job name.

* Add ls.

* Update java.ci.yml

* Update java.ci.yml

* Update java.ci.yml

* Fix test.sh

* Comment out tests.

* Update java.ci.yml

* Update test.sh

* Revert comment

* Uncomment one test

* Uncomment more tests

* Comment test

* Uniform commenting

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Update BazelBspServerTest.java

* Add master

* Uncomment tests

* Increase time limit of tests

* Increase time limit of tests

* Remove master

* Increase time limit of tests

* Increase time limit of one test

* Decrease total time

* Add master

* Refactor pt 2 (#18)

- Introduced `BazelRunner` class which is fully responsible for starting processes, awaiting them and gathering results
- Moved synchronized `get<BazelData>` methods to `BazelDataResolver`. They are no longer required to be synchronized, as all the required data is fetched in the constructor of `BazelBspServer`
- Removed checked exceptions in many places and the need for try-to-rethrow
- Removed `Either`s in many places where they were no longer needed
- Corrected several minor issues (`setBackendPort` appending to a constant, `convertExitCode` not using enum names)

* Add a CI job for formatting (#20)

Add a CI job for formatting

* Test refactor (#19)

* data moved to the separete class

* runner extraction + additional methods extraction

* workspace field is now in data class + constructor argument removal

* timeouts moved to the data class

* methods refactor

* .test.sh update

* logger

* test logs

* one more log

* minor reformat

* lombok dep removal

* code reformat

* buildifier

* fix

* [configuration] Optional argument on server startup (#15)

* [configuration] Optional argument on server startup

Add a optional parameters when starting a server to specify the target
that should be built.

* BEP Server refactor (#21)

* Separating interface implementations and general dependency structure refactor (#24)

* Extracted ScalaBuildServer implementation

* Extracted JavaBuildServer implementation, both classes now implement proper interfaces

* Extracted BuildServer endpoints, very tentatively (previous problems with it)

* Extracted BuildServer implementation more properly

* Tidied up initialized/finished methods + other smaller

* Extracted several things to ParsingUtils and Constants

* Extracted BazelBspServerLifetime and BazelBspRequestHelpers, Java- and ScalaBuildServer classes now not dependent on BazelBspServer

* Added server config, Bazel runner and Bazel data dependencies to the server implementation

* Adjusted BazelData dependencies

* Extracted ServerBuildManager

* Hotfix of the cyclical dependency, to improve iteratively

* Moved part of the BSP integration in Server to the BazelBspServer constructor

* Added further parts to the constructor integration

* Removed cyclical dependency between BuildManager and BuildServerImpl

* Started removing cyclical dependency between BazelBspServer and BepServer: BazelData passed in the constructor

* Resolved cyclical dependency between BuildManager and BepServer

* Cleaned up in BazelBspServer

* Simplified the constructor, moved away logic

* General cleanup

* Extracted suppliers from interface methods in BuildServerImpl

* Added build server implementations as fields

* Prepared for interface and service separation

* Separated BuildServer logic from interface implementation

* Separated logic from interface implementation for Scala and Java BuildServers

* Extracted BEP package

* Created new packages and grouped the files + small style improvements

* Minor style corrections

* Renamed Server.java, imported io.grpc.Server

* Corrections after review

* Naming and packaging changes

* Formatting fix

* Formatting fix

* bazel runner refactor (#23)

* package update

* BazelRunner logs + minor change

* ExitCodeMapper

* runBazelCommandBes update

* BazelRunnerUpdate v2

* BazelTestRunner

* BazelCleanRunner

* BazelRunRunner

* BazelBuildRunner

* BazelInfoRunner

* BazelActionGraphQueryRunner

* BazelQueryRunner

* renames

* bazel runner builder

* packages update

* QueryResolver update

* code reformat

* buldifier

* targets fix

* format fix

* format fix

* format fix v2

* format fix v3

* format fix v4

* rebase

* review fix

* reformat

* test fix

* query kind param

* reformat

* review fix

* reformat

* packages rename

* runner lists creation update

* refactor

* common -> commons

* resolver -> resolvers

* service -> services

* util -> utils

* Packages rearrange + Utils refactor (#30)

* local services setter update

* .../impl -> .../bsp/impl

* .../services -> .../bsp/services

* ClasspathParser

* StderrDiagnosticsParser

* cleanup

* BazelBspServerTestData rollback

* .../resolvers -> .../bsp/resolvers

* reformat

* ActionGraphParser moved to resolvers

* ParsingUtils update

* reformat

* flag fix

* review fix

* setLocalService rollback

* reviw fix

* getRuleType rollback

* rename

* [Post BazelBuilder refactor part 1] TargetsResolver update (#33)

* BuildClientLogger does NOT throw an exception

* BuildClientLogger moved to bep package

* TargetsUtils now maps targets to uris

* .../resolvers/targets package

* Scala/JavaBuildServerService constructor update

* TargetsResolver constructor update

* TargetsResolver builder

* TargetsResolver refactor

* targets package removal

* reformat

* review fixes

* unused import + targetsResolver constructor visibility

* [Post BazelBuilder refactor part 2] TargetsRuleResolver (#34)

* ActionGraphParser getInputs more optimal implementation

* typo in tests

* TargetsResolver -> TargetsLanguageOptionsResolver

* TargetsRulesResolver

* reformat

* TargetsRulesResolver -> TargetRulesResolver

* Solving problems with Scala- and Java-specific endpoints (#32)

* Added an aggregate build server implementation file for passing to the launcher

* Renamed the hub class

* Moved the hub class to server/bsp

* buildTargetScalaTestClasses implementation  (#35)

* method signature update

* poc

* logic implementation

* getSrcsPaths signature rollback

* reformat

* Apply suggestions from code review

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* rules filter update

* main_class is the only source + constants update

* targets resolver is created only once in constructor

* reformat

* hasGivenName

* test

* test fix

* reformat

* success typo

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* Implement buildTargetScalaMainClasses (#36)

* Init

* Fix resolving target options

* Fix variable name

* Change access

* Fix formatting

* Fix formatting

* Read arguments

* Upgrade bsp-testkit

* Add empty test

* Fix formatting

* Move constants

* Fix

* Add more data to test

* Add package name

* Move targetRulesResolver to constructor

* return Completable Future instead of null

* Extract method

* Extract isAttributeSpecifiedAndHasGivenName

* Call buildServerImpl

* Pass compiler options and args to test

* Fix tests

* Fix tests

* Add more args to test

* Read also jvm flags

* Move to constants

* Read only jvm flags

* fix formatting

* unify naming

* use helper method

* remove duplicate methods

* Add more test cases

* revert

* Add test case

* target without args test case

* increase timeout

* add test case without jvm flags

* increase timeout

* increase timeout

* buildClient is now used in the bazel runner (#41)

* buildClient is now used in bazel runner

* format

* bazel runner doesnt throw an exception anymore

* javacoptions and scalacoptions tests (#37)

* scalacopts test

* javacopts test

* reformat

* buildifier

* java_binary import

* test fix

* testkit vestion bump + test fix

* more descriptive targets names

* scalac classDirectory and classpath test update

* .bazelversion file

* __main__/bazel-out/darwin-fastbuild/ removal

* workspaceReload implementation (#38)

* bazel builder sync

* workspaceReload PoC

* bazel sync -> bazel fetch

* reformat

* dev branch import fix (#46)

* executeBazelCommand -> executeBazelBesCommand

* bazel call

* bazel args checker removal

* bazel info update

* log update

* log config

* log level update

* config fix

* log fix

* fix

* log

* more logging

* XDXD

* LOL2

* bazel runner update

* reformat

* initializer clean up

* reformat

* exit code to constant

* date in logger

* bazelProcess moved to the bazel package

* refomat

* Prohibit wildcard imports using error-prone (#45)

So apparently error-prone is built into Bazel and provides a check for wildcard imports.
http://errorprone.info/docs/installation

* script for building and running server (#47)

* filtering blank strings from build progress logs (#50)

* filtering blank strings

* trim rollback

* isBlank -> isEmpty

* additional trim

* Fix build calls and outgroup groups interpretation (#49)

* Add builder without mnemonics for build command

* Change valid parts of classpath parsing

* Switch bazel build calls to use withArguments

* Action graph parser v2 (#42)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* >=info logs are separate now (#51)

* separate logs

* new logging levels

* appending logs

* Get jdk info (#43)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

* Get java home from default settings

* Get java version from aspect

* Get java version through aspect

* Refactor jvm build target data fetching

* Refactor jvm build target logic

* Map java home to uri

* Add java projects tests

* Remove ignored files

* Format

* Remove action graph logs

* Add new project directories to tests script

* Update BSP dependency

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* Refactor build manager into several build managers

commit 3fc3f66
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 15:39:50 2021 +0000

    Add no build flag to aspects

commit 3364cd1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 12:29:16 2021 +0000

    Add manager for aspects

commit 935c5fc
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 12:00:30 2021 +0000

    Update refactor according to new changes

commit 936ac94
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Mar 22 18:05:17 2021 +0000

    Refactor BazelBspServerBuildManager into several different services

commit 4dd0b01
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Feb 26 15:46:40 2021 +0000

    Get semantic version out of `bazel info release` command

commit c594dc1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Feb 16 16:43:52 2021 +0000

    Fix test

commit f931ccd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Feb 15 17:17:08 2021 +0000

    Parse action graph v2 for bazel versions over 4.0.0

commit 5f8f55f
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Feb 6 21:53:54 2021 +0100

    scalac classDirectory and classpath test update

commit a2088c5
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:21:16 2021 +0100

    buildifier

commit 9dbb63c
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:20:21 2021 +0100

    reformat

commit 57f6fa6
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:13:22 2021 +0100

    javacopts test

commit 26abd73
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 22:38:32 2021 +0100

    scalacopts test

commit c0591d0
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 23 19:47:12 2021 +0000

    Add builder without mnemonics for build command

* Add lazy variables

Squashed commits of the following:

commit 3c83a38
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Apr 16 12:10:26 2021 +0000

    Lazy vals recalculated on workspace reload

commit 5ff6d62
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 23:15:28 2021 +0000

    Add lazy vals for complicated calculations

* add Apache 2 license and badges

* Entire repository import test (#53)

* testkit version bump

* test

* todo

* style

* style v2

* ci fix 1

* ci fix

* variable update + gitignore update

* Add cpp support to packages:

commit c8c38f8
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri May 14 10:14:44 2021 +0000

    Add cpp folder to tests

commit 686b657
Merge: b0b06a3 5032915
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 22:44:35 2021 +0000

    Merge branch 'dev' into cpp-extension

commit b0b06a3
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 15:30:35 2021 +0000

    Add cpp dependency

commit b7cd44d
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 11:12:29 2021 +0000

    Add more options to cpp target example

commit 483d9fd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Apr 13 22:14:00 2021 +0000

    Tests for cpp

commit 73bc827
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 8 18:11:36 2021 +0000

    Updated cpp options command call

commit dfa21f4
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Mar 17 19:01:18 2021 +0000

    Add cpp extension method service

commit 9fa25dd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 16 18:48:17 2021 +0000

    Add cpp build target

* Remove java 11 methods

* Squashed commit of the following:

commit a9bac73
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue May 25 22:32:53 2021 +0000

    Add bazel-sonatype dependency

* Update scala repository checksums

* ProjectView files parser implementation (#55)

* ProjectView files parser implementation

* code reformat

* buildifier

* ci tests

* character variable extraction

* reading test config from file

* java docs

* parse default method

* google format

* google format v2

* PoC: First, very very very basic projectview usage (#57)

* reading file

* projecview provider

* projectview provider usage

* logic

* deps

* fix

* buildifier

* google format

* config removal

* google format v2

* test fix

* google format v3

* kind moved to utils

* config rollback

* fix

* Guarantee deps are built before finishing import. (#56)

* Guarantee deps are built before finishing import.

Dependencies must be fully build in order to guarantee the dependencies are all present for indexing.

* Increase tests timeout

* Refactor BazelBspCompilationManager for more readability

* Refactor targets union to TargetsUtils

* [Projectview] import support (#58)

* DirectoriesSectionParserTest tests rename

* TargetsSectionParserTest tests rename

* ProjectViewParserImplTest tests rename

* ProjectViewSectionSplitterTest tests rename

* import test

* splitter test update

* ProjectImportParser

* merge

* parser + test adjustment

* buildifier

* format

* format v2

* format v3

* format v4

* format v5

* format v6

* format v7

* format v8

* Update README.md

* Update README.md

* [fix] projectview - tab symbol parsing  (#66)

* tabs fix + test

* tests update

* google style

* google style v2

* [fix] Semantic version - more generic support (#68)

* tests

* homebrew version test

* impl fix

* google style

* [fix] 'Loading: 0 packages loaded' message prohibition (#71)

[fix] 'Loading: 0 packages loaded' message prohibition

* [fix] java 8 feature fix (#73)

* installation process simplification (#76)

* depdendencies update

* install script update

* instalation location

* Update README.md

* Update README.md

* Update README.md

* version bump

* RC1 version

* [fix] bazel WORKSPACE warnings fix (#81)

* sha update

* workspace update

* 404 fix?

* main/src ... removal (#82)

* [change] Integration tests upgrade (#83)

* test resources -> e2e

* .bazelignore update

* sample repo new test

* style + buildifier

* sample repo bash runner

* BazelBspActionGraphV1Test test

* style

* BazelBspActionGraphV2Test + build files update

* BazelBspJava11ProjectTest

* BazelBspJava8ProjectTest

* BazelBspEntireRepositoryImportTest + style

* BazelBspCppProjectTest

* e2e:all

* buildifier

* [change] e2e tests CI update (#84)

* ci update

* test scrip fix

* shared cache

* old tests removal (#86)

* [change] multimode project (#87)

* projectview extraction

* commons extraction

* e2e visibility update

* bazelrunner extraction

* install extraction

* server extraction

* readme update

* [change] unit tests ci update (#89)

* [change] docs update (#91)

* README - tests section

* Create BUMPVERSION.md

* [fix] Semantic Versioning regex update (#93)

* rolling release test

* regex update

* [added] changelog (#97)

* 1.0.0 changelog

* Update CHANGELOG.md

* [fixed] targets from `exports` attribute are passed to the BSP deps attribute (#98)

* daemon typo fix

* test update + fix

* BuildRuleAttributeExtractor

* BazelBspQueryManager update

* ScalaBuildServerService update

* build fix

* TargetsLanguageOptionsResolver update

* google format

* ci update

* google format

* google style

* .getExplicitlySpecified

* google style

* Update CHANGELOG.md

* Update CHANGELOG.md

* [fixed] scala test rules include `scala_specs2_junit_test` (#101)

* e2e test

* buildifier

* scala_specs2_junit_test should be included in model now

* buildifier

* test update

* Update CHANGELOG.md

* Update CHANGELOG.md

* format

* fix

* [release-preparation] 1.0.1 (#102)

* version bump

* changelog

* [release-preparation] cleanup

* [release-preparation] final cleanup

Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>
Co-authored-by: ex0ns <ex0ns@users.noreply.github.com>
Co-authored-by: Gerard Drozdz <gerardd@interia.pl>
Co-authored-by: André Rocha <andre.rocha@jetbrains.com>
Co-authored-by: Andre Rocha <andrefmrocha@live.com.pt>
Co-authored-by: Justin Kaeser <justin.kaeser@jetbrains.com>
abrams27 added a commit that referenced this pull request Feb 15, 2022
* Change project structure (#12)

* [1 - Initial code refactor] basic classes extraction (#13)

* proces lock is a semaphore

* process start methods moved to the new class

* Build.Query moved to class

* targets options moved to the class

* action graph parser moved to the class

* getMnemonics moved to the class

* packages rearrangement

* scala sbt server moved to the class

* java sbt server moved to the class

* buildClientLogger + methods bodies moved uder calls

* brackets in ifs

* rebase

* proper enterprise package structure

* BUILD files in subpackages

* packages without java prefix

* logger todo

* imports are sorted

* Configure CI. (#16)

* Configure CI.

* Change job name.

* Add ls.

* Update java.ci.yml

* Update java.ci.yml

* Update java.ci.yml

* Fix test.sh

* Comment out tests.

* Update java.ci.yml

* Update test.sh

* Revert comment

* Uncomment one test

* Uncomment more tests

* Comment test

* Uniform commenting

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Uncomment one test

* Update BazelBspServerTest.java

* Add master

* Uncomment tests

* Increase time limit of tests

* Increase time limit of tests

* Remove master

* Increase time limit of tests

* Increase time limit of one test

* Decrease total time

* Add master

* Refactor pt 2 (#18)

- Introduced `BazelRunner` class which is fully responsible for starting processes, awaiting them and gathering results
- Moved synchronized `get<BazelData>` methods to `BazelDataResolver`. They are no longer required to be synchronized, as all the required data is fetched in the constructor of `BazelBspServer`
- Removed checked exceptions in many places and the need for try-to-rethrow
- Removed `Either`s in many places where they were no longer needed
- Corrected several minor issues (`setBackendPort` appending to a constant, `convertExitCode` not using enum names)

* Add a CI job for formatting (#20)

Add a CI job for formatting

* Test refactor (#19)

* data moved to the separete class

* runner extraction + additional methods extraction

* workspace field is now in data class + constructor argument removal

* timeouts moved to the data class

* methods refactor

* .test.sh update

* logger

* test logs

* one more log

* minor reformat

* lombok dep removal

* code reformat

* buildifier

* fix

* [configuration] Optional argument on server startup (#15)

* [configuration] Optional argument on server startup

Add a optional parameters when starting a server to specify the target
that should be built.

* BEP Server refactor (#21)

* Separating interface implementations and general dependency structure refactor (#24)

* Extracted ScalaBuildServer implementation

* Extracted JavaBuildServer implementation, both classes now implement proper interfaces

* Extracted BuildServer endpoints, very tentatively (previous problems with it)

* Extracted BuildServer implementation more properly

* Tidied up initialized/finished methods + other smaller

* Extracted several things to ParsingUtils and Constants

* Extracted BazelBspServerLifetime and BazelBspRequestHelpers, Java- and ScalaBuildServer classes now not dependent on BazelBspServer

* Added server config, Bazel runner and Bazel data dependencies to the server implementation

* Adjusted BazelData dependencies

* Extracted ServerBuildManager

* Hotfix of the cyclical dependency, to improve iteratively

* Moved part of the BSP integration in Server to the BazelBspServer constructor

* Added further parts to the constructor integration

* Removed cyclical dependency between BuildManager and BuildServerImpl

* Started removing cyclical dependency between BazelBspServer and BepServer: BazelData passed in the constructor

* Resolved cyclical dependency between BuildManager and BepServer

* Cleaned up in BazelBspServer

* Simplified the constructor, moved away logic

* General cleanup

* Extracted suppliers from interface methods in BuildServerImpl

* Added build server implementations as fields

* Prepared for interface and service separation

* Separated BuildServer logic from interface implementation

* Separated logic from interface implementation for Scala and Java BuildServers

* Extracted BEP package

* Created new packages and grouped the files + small style improvements

* Minor style corrections

* Renamed Server.java, imported io.grpc.Server

* Corrections after review

* Naming and packaging changes

* Formatting fix

* Formatting fix

* bazel runner refactor (#23)

* package update

* BazelRunner logs + minor change

* ExitCodeMapper

* runBazelCommandBes update

* BazelRunnerUpdate v2

* BazelTestRunner

* BazelCleanRunner

* BazelRunRunner

* BazelBuildRunner

* BazelInfoRunner

* BazelActionGraphQueryRunner

* BazelQueryRunner

* renames

* bazel runner builder

* packages update

* QueryResolver update

* code reformat

* buldifier

* targets fix

* format fix

* format fix

* format fix v2

* format fix v3

* format fix v4

* rebase

* review fix

* reformat

* test fix

* query kind param

* reformat

* review fix

* reformat

* packages rename

* runner lists creation update

* refactor

* common -> commons

* resolver -> resolvers

* service -> services

* util -> utils

* Packages rearrange + Utils refactor (#30)

* local services setter update

* .../impl -> .../bsp/impl

* .../services -> .../bsp/services

* ClasspathParser

* StderrDiagnosticsParser

* cleanup

* BazelBspServerTestData rollback

* .../resolvers -> .../bsp/resolvers

* reformat

* ActionGraphParser moved to resolvers

* ParsingUtils update

* reformat

* flag fix

* review fix

* setLocalService rollback

* reviw fix

* getRuleType rollback

* rename

* [Post BazelBuilder refactor part 1] TargetsResolver update (#33)

* BuildClientLogger does NOT throw an exception

* BuildClientLogger moved to bep package

* TargetsUtils now maps targets to uris

* .../resolvers/targets package

* Scala/JavaBuildServerService constructor update

* TargetsResolver constructor update

* TargetsResolver builder

* TargetsResolver refactor

* targets package removal

* reformat

* review fixes

* unused import + targetsResolver constructor visibility

* [Post BazelBuilder refactor part 2] TargetsRuleResolver (#34)

* ActionGraphParser getInputs more optimal implementation

* typo in tests

* TargetsResolver -> TargetsLanguageOptionsResolver

* TargetsRulesResolver

* reformat

* TargetsRulesResolver -> TargetRulesResolver

* Solving problems with Scala- and Java-specific endpoints (#32)

* Added an aggregate build server implementation file for passing to the launcher

* Renamed the hub class

* Moved the hub class to server/bsp

* buildTargetScalaTestClasses implementation  (#35)

* method signature update

* poc

* logic implementation

* getSrcsPaths signature rollback

* reformat

* Apply suggestions from code review

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* rules filter update

* main_class is the only source + constants update

* targets resolver is created only once in constructor

* reformat

* hasGivenName

* test

* test fix

* reformat

* success typo

Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>

* Implement buildTargetScalaMainClasses (#36)

* Init

* Fix resolving target options

* Fix variable name

* Change access

* Fix formatting

* Fix formatting

* Read arguments

* Upgrade bsp-testkit

* Add empty test

* Fix formatting

* Move constants

* Fix

* Add more data to test

* Add package name

* Move targetRulesResolver to constructor

* return Completable Future instead of null

* Extract method

* Extract isAttributeSpecifiedAndHasGivenName

* Call buildServerImpl

* Pass compiler options and args to test

* Fix tests

* Fix tests

* Add more args to test

* Read also jvm flags

* Move to constants

* Read only jvm flags

* fix formatting

* unify naming

* use helper method

* remove duplicate methods

* Add more test cases

* revert

* Add test case

* target without args test case

* increase timeout

* add test case without jvm flags

* increase timeout

* increase timeout

* buildClient is now used in the bazel runner (#41)

* buildClient is now used in bazel runner

* format

* bazel runner doesnt throw an exception anymore

* javacoptions and scalacoptions tests (#37)

* scalacopts test

* javacopts test

* reformat

* buildifier

* java_binary import

* test fix

* testkit vestion bump + test fix

* more descriptive targets names

* scalac classDirectory and classpath test update

* .bazelversion file

* __main__/bazel-out/darwin-fastbuild/ removal

* workspaceReload implementation (#38)

* bazel builder sync

* workspaceReload PoC

* bazel sync -> bazel fetch

* reformat

* dev branch import fix (#46)

* executeBazelCommand -> executeBazelBesCommand

* bazel call

* bazel args checker removal

* bazel info update

* log update

* log config

* log level update

* config fix

* log fix

* fix

* log

* more logging

* XDXD

* LOL2

* bazel runner update

* reformat

* initializer clean up

* reformat

* exit code to constant

* date in logger

* bazelProcess moved to the bazel package

* refomat

* Prohibit wildcard imports using error-prone (#45)

So apparently error-prone is built into Bazel and provides a check for wildcard imports.
http://errorprone.info/docs/installation

* script for building and running server (#47)

* filtering blank strings from build progress logs (#50)

* filtering blank strings

* trim rollback

* isBlank -> isEmpty

* additional trim

* Fix build calls and outgroup groups interpretation (#49)

* Add builder without mnemonics for build command

* Change valid parts of classpath parsing

* Switch bazel build calls to use withArguments

* Action graph parser v2 (#42)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* >=info logs are separate now (#51)

* separate logs

* new logging levels

* appending logs

* Get jdk info (#43)

* scalacopts test

* javacopts test

* reformat

* buildifier

* scalac classDirectory and classpath test update

* Parse action graph v2 for bazel versions over 4.0.0

* Fix test

* Add tests for different bazel versions

* Comparison of semantic versions

* Format

* Get semantic version out of `bazel info release` command

* Extract action graph v1 tests

* Action graph parser method reorder

* Explicitly get semantic version parts

* Remove redundant return

* Refactor action graph parsers

* Remove logs for creation of test clients

* Refactor semantic version comparator

* Remove comment from .bazelignore

* Cleanup semantic version

* Streamify depset expansion to artifacts

* Remove default visibility from new concat method for strings

* Fix depset expansion when common nodes are traversed

* semantic version comparator is now static

* Improve readability of action graph parser

* Change test logging

* Remove wildcard imports

* Get java home from default settings

* Get java version from aspect

* Get java version through aspect

* Refactor jvm build target data fetching

* Refactor jvm build target logic

* Map java home to uri

* Add java projects tests

* Remove ignored files

* Format

* Remove action graph logs

* Add new project directories to tests script

* Update BSP dependency

Co-authored-by: Abrams27 <abramowiczmarcin99@gmail.com>

* Refactor build manager into several build managers

commit 3fc3f66
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 15:39:50 2021 +0000

    Add no build flag to aspects

commit 3364cd1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 12:29:16 2021 +0000

    Add manager for aspects

commit 935c5fc
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 12:00:30 2021 +0000

    Update refactor according to new changes

commit 936ac94
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Mar 22 18:05:17 2021 +0000

    Refactor BazelBspServerBuildManager into several different services

commit 4dd0b01
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Feb 26 15:46:40 2021 +0000

    Get semantic version out of `bazel info release` command

commit c594dc1
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Feb 16 16:43:52 2021 +0000

    Fix test

commit f931ccd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Mon Feb 15 17:17:08 2021 +0000

    Parse action graph v2 for bazel versions over 4.0.0

commit 5f8f55f
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Feb 6 21:53:54 2021 +0100

    scalac classDirectory and classpath test update

commit a2088c5
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:21:16 2021 +0100

    buildifier

commit 9dbb63c
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:20:21 2021 +0100

    reformat

commit 57f6fa6
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 23:13:22 2021 +0100

    javacopts test

commit 26abd73
Author: Abrams27 <abramowiczmarcin99@gmail.com>
Date:   Sat Jan 30 22:38:32 2021 +0100

    scalacopts test

commit c0591d0
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 23 19:47:12 2021 +0000

    Add builder without mnemonics for build command

* Add lazy variables

Squashed commits of the following:

commit 3c83a38
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri Apr 16 12:10:26 2021 +0000

    Lazy vals recalculated on workspace reload

commit 5ff6d62
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 15 23:15:28 2021 +0000

    Add lazy vals for complicated calculations

* add Apache 2 license and badges

* Entire repository import test (#53)

* testkit version bump

* test

* todo

* style

* style v2

* ci fix 1

* ci fix

* variable update + gitignore update

* Add cpp support to packages:

commit c8c38f8
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Fri May 14 10:14:44 2021 +0000

    Add cpp folder to tests

commit 686b657
Merge: b0b06a3 5032915
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 22:44:35 2021 +0000

    Merge branch 'dev' into cpp-extension

commit b0b06a3
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu May 13 15:30:35 2021 +0000

    Add cpp dependency

commit b7cd44d
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Apr 14 11:12:29 2021 +0000

    Add more options to cpp target example

commit 483d9fd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Apr 13 22:14:00 2021 +0000

    Tests for cpp

commit 73bc827
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Thu Apr 8 18:11:36 2021 +0000

    Updated cpp options command call

commit dfa21f4
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Wed Mar 17 19:01:18 2021 +0000

    Add cpp extension method service

commit 9fa25dd
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue Mar 16 18:48:17 2021 +0000

    Add cpp build target

* Remove java 11 methods

* Squashed commit of the following:

commit a9bac73
Author: Andre Rocha <andrefmrocha@live.com.pt>
Date:   Tue May 25 22:32:53 2021 +0000

    Add bazel-sonatype dependency

* Update scala repository checksums

* ProjectView files parser implementation (#55)

* ProjectView files parser implementation

* code reformat

* buildifier

* ci tests

* character variable extraction

* reading test config from file

* java docs

* parse default method

* google format

* google format v2

* PoC: First, very very very basic projectview usage (#57)

* reading file

* projecview provider

* projectview provider usage

* logic

* deps

* fix

* buildifier

* google format

* config removal

* google format v2

* test fix

* google format v3

* kind moved to utils

* config rollback

* fix

* Guarantee deps are built before finishing import. (#56)

* Guarantee deps are built before finishing import.

Dependencies must be fully build in order to guarantee the dependencies are all present for indexing.

* Increase tests timeout

* Refactor BazelBspCompilationManager for more readability

* Refactor targets union to TargetsUtils

* [Projectview] import support (#58)

* DirectoriesSectionParserTest tests rename

* TargetsSectionParserTest tests rename

* ProjectViewParserImplTest tests rename

* ProjectViewSectionSplitterTest tests rename

* import test

* splitter test update

* ProjectImportParser

* merge

* parser + test adjustment

* buildifier

* format

* format v2

* format v3

* format v4

* format v5

* format v6

* format v7

* format v8

* Update README.md

* Update README.md

* [fix] projectview - tab symbol parsing  (#66)

* tabs fix + test

* tests update

* google style

* google style v2

* [fix] Semantic version - more generic support (#68)

* tests

* homebrew version test

* impl fix

* google style

* [fix] 'Loading: 0 packages loaded' message prohibition (#71)

[fix] 'Loading: 0 packages loaded' message prohibition

* [fix] java 8 feature fix (#73)

* installation process simplification (#76)

* depdendencies update

* install script update

* instalation location

* Update README.md

* Update README.md

* Update README.md

* version bump

* RC1 version

* [fix] bazel WORKSPACE warnings fix (#81)

* sha update

* workspace update

* 404 fix?

* main/src ... removal (#82)

* [change] Integration tests upgrade (#83)

* test resources -> e2e

* .bazelignore update

* sample repo new test

* style + buildifier

* sample repo bash runner

* BazelBspActionGraphV1Test test

* style

* BazelBspActionGraphV2Test + build files update

* BazelBspJava11ProjectTest

* BazelBspJava8ProjectTest

* BazelBspEntireRepositoryImportTest + style

* BazelBspCppProjectTest

* e2e:all

* buildifier

* [change] e2e tests CI update (#84)

* ci update

* test scrip fix

* shared cache

* old tests removal (#86)

* [change] multimode project (#87)

* projectview extraction

* commons extraction

* e2e visibility update

* bazelrunner extraction

* install extraction

* server extraction

* readme update

* [change] unit tests ci update (#89)

* [change] docs update (#91)

* README - tests section

* Create BUMPVERSION.md

* [fix] Semantic Versioning regex update (#93)

* rolling release test

* regex update

* [added] changelog (#97)

* 1.0.0 changelog

* Update CHANGELOG.md

* [fixed] targets from `exports` attribute are passed to the BSP deps attribute (#98)

* daemon typo fix

* test update + fix

* BuildRuleAttributeExtractor

* BazelBspQueryManager update

* ScalaBuildServerService update

* build fix

* TargetsLanguageOptionsResolver update

* google format

* ci update

* google format

* google style

* .getExplicitlySpecified

* google style

* Update CHANGELOG.md

* Update CHANGELOG.md

* [fixed] scala test rules include `scala_specs2_junit_test` (#101)

* e2e test

* buildifier

* scala_specs2_junit_test should be included in model now

* buildifier

* test update

* Update CHANGELOG.md

* Update CHANGELOG.md

* format

* fix

* [release-preparation] 1.0.1 (#102)

* version bump

* changelog

* [release-preparation] cleanup

* [release-preparation] final cleanup

* Allow running a Bazel command without [positional] arguments

One command that doesn't accept arguments at all (only flags) is `bazel clean`.

* [change] better heuristics for guessing source roots (#126)

* Better heuristics for guessing source roots

* refactoring

* formatting

* no recursion

* refactoring and test

* Refactoring and changelog

* more refactoring

* Add JvmBuildServer implementation to fix running tests

* [change] bump java to 11 (#129)

Co-authored-by: Lukasz Wawrzyk <uwawrzyk@twitter.com>

* [feature] handle multiple projects in one workspace (#130)

Co-authored-by: Lukasz Wawrzyk <uwawrzyk@twitter.com>

* [fix] project bazel version switched to 3.7.2 (#141)

* [fix] .bazelversion file

* [fix] changelog upadate

* [fix] badges in readme (#142)

* Update README.md

* Integration tests badge

* format badge

* unit tests badge

* return only the relevant output jar rather than 5-6 jars including sources, headers etc. (#136)

* build project during sync (#137)

* Filter out non runtime jars for running apps and tests (#131)

* Filter out non runtime jars

* use aspect to get runtime classpath

* improve test framework

* [feature] project view 2000 (#143)

* project view parser major refactor

* bazel_path section

* i love java 11

* style

* buildifier

* style v2

* debugger_address section

* i love java 11 more

* debugger_address section part 2

* splitter tests update

* splitter test fix

* java_path section

* comments

* project view usages

* scala.md fix

* e2e test resources fix

* e2e test resources fix part 2

* [e2e] cleaning environment before installation

* tests update

* new mechanism usage

* fix

* visibility and toString() impl

* little test change

* style

* another little test fix

* targets visibility update

* i really love tests

* try > java exceptions

* builidier

* visibility update

* more visibility update

* format

* java docs

* compareByName -> hasName

* instanceOf -> getInstance

* split -> getRawSectionsForFileContent

* anoter -> another_

* list -> stream

* commons in ci

* getInstance -> createInstance

* readme update

* format

* Update CHANGELOG.md

* Update CHANGELOG.md

* targets validation out

* bazel in install update

* even more tests

* [fix] error diagnostics with correct position (#146)

* new FileDiagnostic

* new StderrDiagnosticsParser

* usages

* Update CHANGELOG.md

* [change] handle aspects when multiple projects are in workspace (#132)

Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Co-authored-by: Magdalena Augustyńska <32980499+magda-aug@users.noreply.github.com>
Co-authored-by: ex0ns <ex0ns@users.noreply.github.com>
Co-authored-by: Gerard Drozdz <gerardd@interia.pl>
Co-authored-by: André Rocha <andre.rocha@jetbrains.com>
Co-authored-by: Andre Rocha <andrefmrocha@live.com.pt>
Co-authored-by: Justin Kaeser <justin.kaeser@jetbrains.com>
Co-authored-by: odisseus <odisseus@users.noreply.github.com>
Co-authored-by: Lukasz Wawrzyk <uwawrzyk@twitter.com>
Co-authored-by: Łukasz Wawrzyk <lukasz.wawrzyk@gmail.com>
Co-authored-by: Łukasz Wawrzyk <lwawrzyk@virtuslab.com>
jastice pushed a commit that referenced this pull request Oct 22, 2023
* add python plugin dependency

* update ProjectDetails, make BspServer extend PythonBuildServer

* create PythonOptionsItemState, add pythonOptions to ModuleDetails, updated tests

* fix test

* assigning pythonOptions in ModuleDetails.toState

* update MagicMetaModelService

* update python related functions

* make python plugin version match intellij version

* first python basic test

* initial pythonModuleUpdater

* add dummy implementations of addEntity and entity updaters

* remove java specific methods from entity updaters

* attach sdk to module during updating

* remove packagePrefix from PythonSourceRoot

* add pythonModuleUpdaterTest

* add pythonSourceEntityUpdaterTest

* add pythonResourceEntityUpdaterTest

* Initial (early) version of ModuleDetailsToPythonModuleTransformer + slight code refactor

* Small changes to ModuleDetailsToPythonModuleTransformer, should be working now

* minor fixes to allow plugin running

* queryForPythonOptions called with only python targets ids

* add python plugin dependency

* adjust changes to match those on main

* create PythonOptionsItemState, add pythonOptions to ModuleDetails, updated tests

* fix test

* assigning pythonOptions in ModuleDetails.toState

* update MagicMetaModelService

* update querying for python options

* make python plugin version match intellij version

* first python basic test

* initial pythonModuleUpdater

* add dummy implementations of addEntity and entity updaters

* remove java specific methods from entity updaters

* attach sdk to module during updating

* remove packagePrefix from PythonSourceRoot

* add pythonModuleUpdaterTest

* add pythonSourceEntityUpdaterTest

* add pythonResourceEntityUpdaterTest

* fix

* minor fixes to allow plugin running

* Small changes to ModuleDetailsToPythonModuleTransformer, should be working now

* update python plugin version

* add empty PythonOptions so that the tests work

BspModuleDetailsToModuleTransformerTest needs a test with a python module

WorkspaceModelToProjectDetailsTransformer needs sth useful assigned to pythonOptions

* update PythonEntityUpdater tests to compare sourceRoots not contentRoots

* Added ModuleDetailsToPythonModuleTransformerTest, small changes to ModuleDetailsToPythonModuleTransformer and BspModuleDetailsToModuleTransformerTest

* Make python an optional dependency

* Add tests for python modules

* Code cleanup

* Create base model-with-parent-module test

* fix typo for pythonOptionsFuture

* PythonLibraryEntityUpdater without copying the files, DependencySourcesItemToPythonLibraryTransformer

* Create base module-details-to-module transformer

* Remove wildcard import

* cherry-pick "Display modules in Project Structure as a tree | #BAZEL-76 Done"

Modify build target classifier to work on target identifiers instead of the targets themselves

Nitpicks

Fix tests, add one more

Classify modules and display them in a tree

Merge-request: BAZEL-MR-161
Merged-by: Marcin Kocot <Marcin.Kocot@jetbrains.com>

* add python options in ModuleDetailsToJavaModuleTransformer, todo in places to add helper dependency to

* bump PythonCore version, adjust ModuleDetailsToModuleTransformer to changes from main

* [fix] update tests with projectBasePath

* remove automatic import formatting

* test fix

* Adding external dependencies to python modules

+ merge main

* merge main

* Revert "merge main"

This reverts commit fdac037cbfc100d84503644daf96bf675644eebb.

* Revert "Adding external dependencies to python modules"

This reverts commit 6f678f3c3c6c33f074b302b37811659627a967d1.

* fix path creation in transformer and project root creation in test

* [fix] Display wizard if it was previously cancelled | #BAZEL-349 Done

Also:
* Display welcome screen after cancellation
* Close projects on every import wizard failure (not only on cancel)
Merge-request: BAZEL-MR-191
Merged-by: Marcin Kocot <Marcin.Kocot@jetbrains.com>

* [fix] modules without sources now dont contain base dir as content root | #BAZEL-301 Done

commm

modules without sources now dont contain base dir as content root

Merge-request: BAZEL-MR-192
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>

* [fix] actions (build/run/test) are not displayed if the client is disconnected from the server

Merge-request: BAZEL-MR-196
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>

* [feature] Make it obvious whether loaded or unloaded targets are displayed | #BAZEL-249 Done

Make it look better

Keep "Loaded targets" and "Unloaded targets" buttons selected as long as their respective panels are open

Merge-request: BAZEL-MR-194
Merged-by: Marcin Kocot <Marcin.Kocot@jetbrains.com>

* [fix] workspacemodel deserialization now uses original build target id as target name **!WARNING! VERY DANGEROUS!!!**

Merge-request: BAZEL-MR-198
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>

* [maintenance] ij version bump

probe bump

[maintenance] ij version bump

Merge-request: BAZEL-MR-195
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>

* [release] 2031.1.0-EAP

Merge-request: BAZEL-MR-202
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>

* [fix] Restoring WorkspaceModelToProjectDetailsTransformerTest

Merge-request: BAZEL-MR-206
Merged-by: Blazej Kardys <Blazej.Kardys@jetbrains.com>

* [fix] Adding cyclic UI check during opening project with probe to keep UI robot alive

Merge-request: BAZEL-MR-210
Merged-by: Blazej Kardys <Blazej.Kardys@jetbrains.com>

* [feature] show loaded targets on BSP sidebar widget startup

Remove "neither loaded nor unloaded targets are displayed" state

Show loaded targets on BSP sidebar widget startup (instead of nothing)

Merge-request: BAZEL-MR-208
Merged-by: Marcin Kocot <Marcin.Kocot@jetbrains.com>

* [fix] Allow Linux amd64 to be handled properly | #BAZEL-366

Merge-request: BAZEL-MR-209
Merged-by: Xuan Son Trinh <xuanson.trinh@jetbrains.com>

* copying source files of PythonLibraryEntity to helpers directory

- the copying itself is not tested yet
- WorkspaceModelUpdater makes two modules (java and python) out of one target

* fix duplicated modules in WorkspaceModelUpdaterImpl

* set SDK for python in project details

* cr-suggested changes

* made PythonSourceEntityUpdater generic

* minor python state changes && add test for it

* Set python SDKs in CollectProjectDetailsTask

* test commit to refresh the pr

* Check if Python SDK exists before adding it

* commit to push to new fork

* Fix adding Python SDKs (create URI) in CollectProjectDetailsTask

* Revert helpers dependency

* Fix CollectProjectDetailsTask after merging

* fix sdk creation in CollectProjectDetailsTask and remove unneeded code in PythonModuleUpdater

* Fix error in ModuleDetailsToPythonModuleTransformerTest.kt

* fix virtual file creation in CollectProjectDetailsTask, fix test and change sdk name in PythonModuleUpdater

* fix jdk creation in CollectProjectDetailsTask

* resolve pr comments and (hopefully) finish bazel-411

* remove wildcard import

* Even more conflict resolving

* detekt fixes

* Add optional Python plugin dependency through an extension point

* CR fixes

* remove dependencies from bsp-withPython.xml, bump python plugin version, add long method suppression to CollectProjectDetailsTask

---------

Co-authored-by: Katarzyna Mielnik <kasia.a.mielnik@gmail.com>
Co-authored-by: quazuo <filipglebocki01@gmail.com>
Co-authored-by: Błażej Wilkoławski <blazej2801@hotmail.com>
Co-authored-by: mielnikk <93001127+mielnikk@users.noreply.github.com>
Co-authored-by: Marcin Kocot <marcin.kocot@jetbrains.com>
Co-authored-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>
Co-authored-by: Błażej Kardyś <blazej.kardys@jetbrains.com>
Co-authored-by: Xuan-Son Trinh <xuanson.trinh@jetbrains.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Moving methods from ParsingUtils closer to where they're used
4 participants