知识库 知识库
首页
  • Hyperskill - Java

    • Java basic
    • Java OOP
    • 应知
    • 扩展
    • IO & Stream
    • Error & Exception
    • Algorithm & Data structure
    • Design pattern
    • Web
    • Spring boot
  • 练习题

    • 选择题 & 填空题
    • 代码题
  • Frank - Java与生活 (OOP)

    • 参考资料
    • Java基础
    • OOP上半部分
    • OOP下半部分
  • Frank - Java API进阶

    • Base API
    • Unit Test and main function
  • 学习笔记
  • 学习笔记

    • 数据库
  • Frank - MySQL删库跑路

    • 安装、连接、配置
    • 基本操作——数据库
    • 基本操作——表
    • 基本操作——数据
    • 数据类型
    • 列属性完整性
    • 数据库设计思维
    • 单表查询
    • 多表查询
  • 学习笔记

    • 其它
  • Frank - Linux现代方法

    • 必知
    • 命令
    • 技巧
  • 技术文档
  • Git
  • GitHub技巧
  • 前端
  • Khan Academy - 语法
  • Monthly
  • 阅读
  • Others
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 标签
  • 归档
GitHub (opens new window)

Jim FuckPPT

Java小学生
首页
  • Hyperskill - Java

    • Java basic
    • Java OOP
    • 应知
    • 扩展
    • IO & Stream
    • Error & Exception
    • Algorithm & Data structure
    • Design pattern
    • Web
    • Spring boot
  • 练习题

    • 选择题 & 填空题
    • 代码题
  • Frank - Java与生活 (OOP)

    • 参考资料
    • Java基础
    • OOP上半部分
    • OOP下半部分
  • Frank - Java API进阶

    • Base API
    • Unit Test and main function
  • 学习笔记
  • 学习笔记

    • 数据库
  • Frank - MySQL删库跑路

    • 安装、连接、配置
    • 基本操作——数据库
    • 基本操作——表
    • 基本操作——数据
    • 数据类型
    • 列属性完整性
    • 数据库设计思维
    • 单表查询
    • 多表查询
  • 学习笔记

    • 其它
  • Frank - Linux现代方法

    • 必知
    • 命令
    • 技巧
  • 技术文档
  • Git
  • GitHub技巧
  • 前端
  • Khan Academy - 语法
  • Monthly
  • 阅读
  • Others
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
收藏
  • 标签
  • 归档
GitHub (opens new window)
  • Hyperskill - Java

    • Java basic

    • Java OOP

    • 应知

    • 扩展

      • Theory:Units of information
      • Theory:IDE
      • Theory:IDEA
      • Theory:Build tools
        • What is a build tool?
        • What can build tools do?
        • Build tools for Java-based projects
        • Conclusion
      • Theory:Operating systems
      • Theory:Gradle basics
      • Theory:Basic project with Gradle
      • Theory:Building apps using Gradle
      • Theory:Dependency management
      • Theory:Formatted output
      • Theory:Libraries
      • Theory:Frameworks
      • Theory:Modules
      • Theory:Introduction to software architecture
      • Theory:Class Diagrams
      • Theory:Text blocks
      • Theory:YAML
      • Theory:XML
      • Theory:JSON
    • IO & Stream

    • Error & Exception

    • Algorithm & Data structure

    • Design pattern

    • Web

    • Spring boot

  • 练习题

  • Frank - Java与生活

  • Frank - Java API进阶

  • 学习笔记

  • Java
  • Hyperskill - Java
  • 扩展
Jim
2022-06-24
目录

Theory:Build tools

# What is a build tool?

A build tool is a program that automates the process of creating executable applications from source code. The build process includes compiling sources and linking and packaging the code into a usable or executable form.

img

In small projects (like projects for learning), developers can manually invoke the build process. However, this approach is not efficient for larger projects, when it is pretty hard to keep track of what needs to be built. Automating the build process minimizes the risk of human error. Additionally, an automated build tool typically runs faster than someone performing the same steps manually. As a consequence, an automated build process improves the quality of the product and saves time and money.

# What can build tools do?

Modern build tools can perform a wide variety of tasks that software developers do in their day-to-day activities:

  1. Downloading and adding dependencies. This is especially convenient when your project depends on a large number of libraries.
  2. Compiling source code into bytecode. Build tools will invoke compiler for all the files in your project.
  3. Packaging compiled code. You will have a production-ready application archive like JAR, APK, or some other.
  4. Running tests. For example, testing the application archive every time to check if it works correctly. It allows programmers to avoid bugs after modifying the application.
  5. Deploying to a production environment.

This list of tasks is not complete and may be different depending on the particular build tool used. Some additional features might be available; for example, you can use some tools to generate documentation after the build.

# Build tools for Java-based projects

There are three main build tools for Java-based projects: Apache Ant, Apache Maven, and Gradle.

Apache Ant was released in 2000. It is the oldest of these three build tools. Coders rarely use Ant in new projects but it still occurs in practice. You can use this tool together with Apache Ivy to manage dependencies.

Apache Maven was released in 2004, and now it is one of the most popular choices for Java developers (especially for server-side development). Many projects, both old and new, use Maven as a build tool because of its powerful dependency management possibilities.

Maven follows the Convention Over Configuration concept which means that a developer needs to specify only unconventional aspects of the application, and all standard aspects work by default.

Gradle is a new tool compared to Ant and Maven. It was released in 2007 and is now standard for Android applications. Also, developers use it for server and desktop development. Gradle aims to “combine the power and flexibility of Ant with the dependency management and conventions of Maven into a more effective way to build.”

All of these build tools are free and can be used in any operating system.

Note: Apache Maven and Gradle are more than simply build tools. They manage almost the entire lifecycle of an application.

There is also another build tool called sbt (Scala Build Tool). It is primarily used for Scala projects but you can use it for Java or Kotlin as well.

If you are interested, here (opens new window) you can find a list of build tools for different languages.

# Conclusion

In summary, a build tool is a software that creates executable applications from source code. Using a build tool minimizes the risk of human error, speeds up the process, improves the quality of the product, and saves time and money. Modern build tools do plenty of jobs such as downloading and adding dependencies, compiling source code, packaging compiled code, running tests, deploying to a production environment. For Java-based projects, widely used build tools are "oldie" Apache Ant, popular Apache Maven, and a "new" Gradle.

编辑 (opens new window)
#Build tools
上次更新: 2022/09/26, 16:55:15
Theory:IDEA
Theory:Operating systems

← Theory:IDEA Theory:Operating systems→

最近更新
01
《挪威的森林》
04-14
02
青钢影
04-14
03
Processing strings
02-18
更多文章>
Theme by Vdoing | Copyright © 2022-2023 Jim Frank | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式