Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove BuildTargetKind ?

See original GitHub issue

It’s currently defined as:

object BuildTargetKind {
  final val Library = 1
  final val Test = 2
  final val App = 3
  final val IntegrationTest = 4
  final val Bench = 5

Most build tools do not require the user to classify their projects in such a way, so the best a build tool could do is try to guess using heuristics, but that can also be done by the IDE itself. Moreover, this information is only needed to display something nice to the user, not to compute anything, so there really isn’t any reason to keep it in the protocol in my opinion.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:47 (38 by maintainers)

github_iconTop GitHub Comments

jvicancommented, Aug 5, 2018

Target kinds are useful for clients that want to highlight the nature of a project; for example, an IDE that knows how to run benchmarks can use the Bench target kind to auto-detect benchmarks and allow users to run them from the IDE.

Most of the build tools (sbt, bazel, pants, maven, gradle) have the ability to define targets that are either binaries, library, tests, benchmarks or integration tests; though they do it in different ways.

In Bazel and pants, users define the purpose of a target by choosing the right directive (scala_binary, scala_library, etc). In sbt, maven and gradle, the definition is implicit via the use of Maven configurations (for example, in sbt you add the IntegrationTest configuration to a project that defines integration tests, and likewise for Bench). If a build tool does not know the nature of a build target, it can safely use App as the default.

All in all, the build tool picks the target kind not by heuristics, but by information given by the user.This information cannot be derived from the IDE and it’s therefore required in the project.

See discussion in, and

jvicancommented, Oct 26, 2018

Status quo: Pants tries to map target to intellij module one to one. However, if a directory contains multiple targets, intellij-pants-plugin is packing all them into one module, thus causing unintended behaviors in IntelliJ sometimes. E.g. a resources target and a library target live in the same dir.

This logic will then needed to be done on the IntelliJ side /cc @jastice The protocol will allow you to express this as independent targets. I know there are some efforts on the IntelliJ side to update their project model to work around all of these issues, Justin can talk more about that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BuildTargetGroup, BuildTarget: the difference between ...
They usually don't remove values as such, only tell the user they're obsolete and under the hood it handles it regardless. rcenzo, Apr...
Read more >
BuildTarget.StandaloneOSXIntel - Scripting API
Obsolete StandaloneOSXIntel has been removed in 2017.3. Description. Build a macOS Intel 32-bit standalone. (This build target is deprecated). See ...
Read more >
How do I delete extraneous deployment target settings ...
I have multiple build targets in my project. Some have tvOS set as the Base SDK whereas others have iOS set for this...
Read more >
Build Options
Set to 0 to disable inlining altogether. ... Enable/disable CSS code splitting. ... Type: string | string[]; Default: the same as
Read more >
MSBuild Targets
For example, one target may delete all files in the output directory to ... which then calls the Csc task with the Compile...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found