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
[feature] manual tag support #236
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, probably u havent used the google java formatter, since there are 4 spaces tabs - please fix it.
Also please change the PR name and a description, update changelog.
PS did u manage to test it manually?
server/src/main/java/org/jetbrains/bsp/bazel/server/sync/TargetKindResolver.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/jetbrains/bsp/bazel/server/sync/BspProjectMapper.java
Outdated
Show resolved
Hide resolved
I tested it manually. I ./install.sh the file first and in bazelbsp.trace.json I ctrl+F and looked for the number of "canCompile": false, then |
...w/src/main/java/org/jetbrains/bsp/bazel/projectview/generator/DefaultProjectViewGenerator.kt
Show resolved
Hide resolved
...va/org/jetbrains/bsp/bazel/projectview/generator/sections/ProjectViewListSectionGenerator.kt
Outdated
Show resolved
Hide resolved
...n/java/org/jetbrains/bsp/bazel/projectview/generator/sections/ProjectViewSectionGenerator.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can write some e2e tests as well
@@ -27,3 +27,10 @@ data class ProjectViewBazelPathSection(override val value: Path) : | |||
const val SECTION_NAME = "bazel_path" | |||
} | |||
} | |||
|
|||
data class ProjectViewManualSection(override val value: Boolean) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update the name as well ProjectViewBuildManualTargetsSection
val javaPath: ProjectViewJavaPathSection?, | ||
/** bazel flags added to all bazel command invocations */ | ||
val buildFlags: ProjectViewBuildFlagsSection?, | ||
/** build manual targets to build, run and test by explicitly asking. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this flag will be used only for building, for testing / running we will create another one probably.
so it could be flag for building manual targets
+ " bazel path: {}," | ||
+ " debugger address: {}," | ||
+ " java path: {}." | ||
+ "manual targets : {}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its build manual targets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+u can add build flags, since i forgot about it
extends ProjectViewSingletonSectionParser<Boolean, ProjectViewManualTargetsSection> { | ||
|
||
public ProjectViewManualSectionParser() { | ||
// TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why TODO, u can use the static name from the section
|
||
private fun combineManualSection(importedProjectViews: List<ProjectView>): ProjectViewManualTargetsSection? = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be combileBuildManualTargetsSection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+please undo the formatting
import org.jetbrains.bsp.bazel.projectview.model.ProjectView | ||
import java.nio.file.Files | ||
import java.nio.file.Path | ||
|
||
class DefaultProjectViewGenerator : ProjectViewGenerator { | ||
|
||
override fun generatePrettyStringAndSaveInFile(projectView: ProjectView, filePath: Path): Try<Void> = | ||
writeStringToFile(filePath, generatePrettyString(projectView)) | ||
writeStringToFile(filePath, generatePrettyString(projectView)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again, could u rollback formatting?
I added manual tag, when this tag is used build, run and test will not be done without explicitly asked.
https://youtrack.jetbrains.com/issue/BAZEL-40
testing:
manual testing