Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separating interface implementations and general dependency structure refactor #24

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ff49ff1
Extracted ScalaBuildServer implementation
gerardd33 Dec 24, 2020
6225263
Extracted JavaBuildServer implementation, both classes now implement …
gerardd33 Dec 24, 2020
5e13a84
Extracted BuildServer endpoints, very tentatively (previous problems …
gerardd33 Dec 25, 2020
b255c96
Extracted BuildServer implementation more properly
gerardd33 Dec 25, 2020
a236527
Tidied up initialized/finished methods + other smaller
gerardd33 Dec 25, 2020
b0760d7
Extracted several things to ParsingUtils and Constants
gerardd33 Dec 25, 2020
8876193
Extracted BazelBspServerLifetime and BazelBspRequestHelpers, Java- an…
gerardd33 Dec 25, 2020
0f4deb1
Added server config, Bazel runner and Bazel data dependencies to the …
gerardd33 Dec 25, 2020
2ec2c71
Adjusted BazelData dependencies
gerardd33 Dec 25, 2020
4320cf2
Extracted ServerBuildManager
gerardd33 Dec 25, 2020
7f3883d
Hotfix of the cyclical dependency, to improve iteratively
gerardd33 Dec 25, 2020
53bc9d2
Moved part of the BSP integration in Server to the BazelBspServer con…
gerardd33 Dec 25, 2020
d08deaf
Added further parts to the constructor integration
gerardd33 Dec 25, 2020
992a232
Removed cyclical dependency between BuildManager and BuildServerImpl
gerardd33 Dec 25, 2020
b4c35a9
Started removing cyclical dependency between BazelBspServer and BepSe…
gerardd33 Dec 25, 2020
8209249
Resolved cyclical dependency between BuildManager and BepServer
gerardd33 Dec 25, 2020
df2eb69
Cleaned up in BazelBspServer
gerardd33 Dec 25, 2020
d0c3b7b
Simplified the constructor, moved away logic
gerardd33 Dec 25, 2020
980cd73
General cleanup
gerardd33 Dec 25, 2020
ad06f13
Extracted suppliers from interface methods in BuildServerImpl
gerardd33 Dec 25, 2020
a1b8d04
Added build server implementations as fields
gerardd33 Dec 25, 2020
ce24274
Prepared for interface and service separation
gerardd33 Dec 25, 2020
e482d03
Separated BuildServer logic from interface implementation
gerardd33 Dec 25, 2020
d10186c
Separated logic from interface implementation for Scala and Java Buil…
gerardd33 Dec 25, 2020
d0fb4cb
Extracted BEP package
gerardd33 Dec 25, 2020
3320506
Created new packages and grouped the files + small style improvements
gerardd33 Dec 26, 2020
ce6883a
Minor style corrections
gerardd33 Dec 26, 2020
b9847c9
Renamed Server.java, imported io.grpc.Server
gerardd33 Dec 28, 2020
4f743e4
Corrections after review
gerardd33 Dec 29, 2020
7ac1586
Naming and packaging changes
gerardd33 Dec 29, 2020
4bcb19b
Formatting fix
gerardd33 Dec 29, 2020
242aa8a
Formatting fix
gerardd33 Dec 29, 2020
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
1 change: 0 additions & 1 deletion src/main/java/org/jetbrains/bsp/bazel/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ java_library(
srcs = glob(["*.java"]),
visibility = ["//visibility:public"],
deps = [
"@io_bazel//src/main/protobuf:analysis_java_proto",
"@maven//:com_google_guava_guava",
],
)
26 changes: 26 additions & 0 deletions src/main/java/org/jetbrains/bsp/bazel/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.List;

public class Constants {

public static final String NAME = "bazelbsp";
public static final String VERSION = "0.0.0";
public static final String BSP_VERSION = "2.0.0";
Expand All @@ -19,11 +20,34 @@ public class Constants {
public static final List<String> SUPPORTED_LANGUAGES = ImmutableList.of(SCALA, JAVA, KOTLIN);
public static final List<String> SUPPORTED_COMPILERS = ImmutableList.of(SCALAC, JAVAC, KOTLINC);

public static final String SCALA_EXTENSION = ".scala";
public static final String JAVA_EXTENSION = ".java";
public static final String KOTLIN_EXTENSION = ".kt";

public static final List<String> FILE_EXTENSIONS =
ImmutableList.of(
SCALA_EXTENSION,
JAVA_EXTENSION,
KOTLIN_EXTENSION,
".kts",
".sh",
".bzl",
".py",
".js",
".c",
".h",
".cpp",
".hpp");

public static final String BAZEL_BUILD_COMMAND = "build";
public static final String BAZEL_RUN_COMMAND = "run";
public static final String BAZEL_TEST_COMMAND = "test";
public static final String BAZEL_CLEAN_COMMAND = "clean";

public static final String BINARY_RULE_TYPE = "binary";
public static final String LIBRARY_RULE_TYPE = "library";
public static final String TEST_RULE_TYPE = "test";

public static final String BUILD_FILE_NAME = "BUILD";
public static final String WORKSPACE_FILE_NAME = "WORKSPACE";
public static final String ASPECTS_FILE_NAME = "aspects.bzl";
Expand All @@ -33,6 +57,8 @@ public class Constants {
public static final String BAZELBSP_LOG_FILE_NAME = "bazelbsp.log";
public static final String BAZELBSP_TRACE_JSON_FILE_NAME = "bazelbsp.trace.json";

public static final List<String> KNOWN_SOURCE_ROOTS =
ImmutableList.of("java", "scala", "kotlin", "javatests", "src", "test", "main", "testsrc");
public static final String DIAGNOSTICS = "diagnostics";
public static final String EXEC_ROOT_PREFIX = "exec-root://";
public static final String SCALA_COMPILER_CLASSPATH_FILES = "scala_compiler_classpath_files";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jetbrains/bsp/bazel/common/Uri.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.List;

public class Uri implements Comparable<Uri> {

private static final String ENC = StandardCharsets.UTF_8.toString();
private final URI uri;

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jetbrains/bsp/bazel/install/Install.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
import org.jetbrains.bsp.bazel.common.Constants;

public class Install {

public static final String INSTALLER_BINARY_NAME = "bazelbsp-install";
public static final String SERVER_CLASS_NAME = "org.jetbrains.bsp.bazel.server.Server";
public static final String SERVER_CLASS_NAME = "org.jetbrains.bsp.bazel.server.ServerInitializer";

private static final String DEBUGGER_SHORT_OPT = "x";
private static final String JAVA_SHORT_OPT = "j";
Expand Down
18 changes: 7 additions & 11 deletions src/main/java/org/jetbrains/bsp/bazel/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@ java_library(
visibility = ["//visibility:public"],
deps = [
"//src/main/java/org/jetbrains/bsp/bazel/common",
"//src/main/java/org/jetbrains/bsp/bazel/server/bep",
"//src/main/java/org/jetbrains/bsp/bazel/server/bsp",
"//src/main/java/org/jetbrains/bsp/bazel/server/data",
"//src/main/java/org/jetbrains/bsp/bazel/server/impl",
"//src/main/java/org/jetbrains/bsp/bazel/server/logger",
"//src/main/java/org/jetbrains/bsp/bazel/server/resolvers",
"//src/main/java/org/jetbrains/bsp/bazel/server/utils",
"@com_google_protobuf//:protobuf_java",
"@googleapis//:google_devtools_build_v1_build_events_java_proto",
"@googleapis//:google_devtools_build_v1_publish_build_event_java_grpc",
"@googleapis//:google_devtools_build_v1_publish_build_event_java_proto",
"@googleapis//:google_devtools_build_v1_publish_build_event_proto",
"@io_bazel//src/main/java/com/google/devtools/build/lib/buildeventstream/proto:build_event_stream_java_proto",
"@io_bazel//src/main/protobuf:analysis_java_proto",
"//src/main/java/org/jetbrains/bsp/bazel/server/resolver",
"//src/main/java/org/jetbrains/bsp/bazel/server/service",
"//src/main/java/org/jetbrains/bsp/bazel/server/util",
"@io_bazel//src/main/protobuf:build_java_proto",
"@io_bazel//third_party/grpc:grpc-jar",
"@io_bazel_rules_scala//src/protobuf/io/bazel/rules_scala:diagnostics_java_proto",
"@maven//:ch_epfl_scala_bsp4j",
"@maven//:com_google_code_gson_gson",
"@maven//:com_google_guava_guava",
Expand All @@ -32,7 +28,7 @@ java_library(

java_binary(
name = "bsp-run",
main_class = "org.jetbrains.bsp.bazel.server.Server",
main_class = "org.jetbrains.bsp.bazel.server.ServerInitializer",
visibility = ["//visibility:public"],
runtime_deps = ["//src/main/java/org/jetbrains/bsp/bazel/server"],
)
Loading