What is a build tool?

2020-01-27 09:24发布

For past 4 years, I have been programming with Eclipse (for Java), and Visual Studio Express (for C#). The IDEs mentioned always seemed to provide every facility a programmer might ask for (related to programming, of course).

Lately I have been hearing about something called "build tools". I heard they're used almost in all kind of real world development. What are they exactly? What problems are they designed to solve? How come I never needed them in past four years? Are they kind of command-line stripped down IDEs?

标签: build
8条回答
Fickle 薄情
2楼-- · 2020-01-27 09:40

Build tools are generally to transform source code into binaries - it organize source code, set compile flags, manage dependencies... some of them also integrate with running unit test, doing static analysis, a generating documentation.

Eclipse or Visual Studio are also build systems (but more of an IDE), and for visual studio it is the underlying msbuild to parse visual studio project files under the hood.

The origin of all build systems seems like the famous 'make'.

There are build systems for different languages:

  1. C++: make, cmake, premake
  2. Java: ant+ivy, maven, gradle
  3. C#: msbuild

Usually, build systems either using a propriety domain specific language (make, cmake), or xml (ant, maven, msbuild) to specify a build. The current trend is using a real scripting language to write build script, like lua for premake, and groovy for gradle, the advantage of using a scripting is it is much more flexible, and also allows you the to come up with a set of standard APIs(as build DSL).

查看更多
Rolldiameter
3楼-- · 2020-01-27 09:40

"...it is very hard to keep track of what needs to be built" - Build tools does not help with that all. You need to know what you want to build. (Quoted from Ritesh Gun's answer)

"I heard they're used almost in all kind of real-world development" - For some reason, software developers like to work in large companies. They seem to have more unclear work directives for every individual working there.

"How come I never needed them in past four years". Probably because you are a skilled programmer.

Pseudo, meta. I think build tools do not provide any really real benefit at all. It is just there to add a sense of security arising from bad company practices, lack of direction - bad software architectural leadership leading to bad actual knowledge of the project. You should never have to use build tools(for testing) in your project. To do random testing with a lack of knowledge of the software project does not give any sort of help at all.

You should never ever add something to a project without knowing it's purpose, and how it will work with the other components. Components can be functional separate, but not work together. (This is the responsibility of the software architect I assume).

What if 4-5 components are added into the project. You add a 6th component. Together with the first added component, it might screw up everything. No automatic would help to detect that.

There is no shortcut other than to think think think.

Then there is the auto download from repositories. Why would you ever want to do that? You need to know what you download, what you add to the project. How do you detect changes in versions of the repositories? You need to know. You can't "auto" anything.

What if we were to test bicycles and baby transports blindfolded with a stick and just randomly hit around with it. That seems to be the idea of build tool testing.

I'm sorry there are no shortcut https://en.wikipedia.org/wiki/Scientific_method and https://en.wikipedia.org/wiki/Analysis

查看更多
男人必须洒脱
4楼-- · 2020-01-27 09:41

Build tools are tools to manage and organize your builds, and are very important in environments where there are many projects, especially if they are inter-connected. They serve to make sure that where various people are working on various projects, they don't break anything. And to make sure that when you make your changes, they don't break anything either.

The reason you have not heard of them before is that you have not been working in a commercial environment before. There is a whole lot of stuff that you have probably not encountered that you will within a commercial environments, especially if you work in software houses.

As others have said, you have been using them, however, you have not had to consider them, because you have probably been working in a different way to the usual commercial way of working.

查看更多
▲ chillily
5楼-- · 2020-01-27 09:42

Build Process is a Process of compiling your source code for any errors using some build tools and creating builds(which are executable versions of the project). We(mainly developers) do some modifications in the source code and check-in that code for the build process to happen. After the build process it gives two results : 1. Either build PASSES and you get an executable version of your project(Build is ready). 2. It fails and you get certain errors and build is not created.

There are different types of build process like : 1. Nightly Build 2. gated Build 3. Continuous integration build etc.

Build tools help and automates the process of creating builds.

*So in Short Build is a Version of Software in pre-release format used by the Developer or Development team to gain confidence for the final result of their Product by continuously monitoring their Product and solving any issues early during the development process.*

查看更多
虎瘦雄心在
6楼-- · 2020-01-27 09:45

What are build tools?

Build tools are programs that automate the creation of executable applications from source code(eg. .apk for android app). Building incorporates compiling,linking and packaging the code into a usable or executable form.

Basically build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities like:

  1. Downloading dependencies.
  2. Compiling source code into binary code.
  3. Packaging that binary code.
  4. Running tests.
  5. Deployment to production systems.

Why do we use build tools or build automation?

In small projects, developers will often manually invoke the build process. This is not practical for larger projects, where it is very hard to keep track of what needs to be built, in what sequence and what dependencies there are in the building process. Using an automation tool allows the build process to be more consistent.

Various build tools available(Naming only few):

  1. For java - Ant,Maven,Gradle.
  2. For .NET framework - NAnt
  3. c# - MsBuild.

For further reading you can refer following links:

1.Build automation

2.List of build automation software

Thanks.

查看更多
贪生不怕死
7楼-- · 2020-01-27 09:45

Build tools are usually run on the command line, either inside an IDE or completely separate from it.

The idea is to separate the work of compiling and packaging your code from creation, debugging, etc.

A build tool can be run on the command or inside an IDE, both triggered by you. They can also be used by continuous integration tools after checking your code out of a repository and onto a clean build machine.

make was an early command tool used in *nix environments for building C/C++.

As a Java developer, the most popular build tools are Ant and Maven. Both can be run in IDEs like IntelliJ or Eclipse or NetBeans. They can also be used by continuous integration tools like Cruise Control or Hudson.

查看更多
登录 后发表回答