售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Gradle Essentials
Table of Contents
Gradle Essentials
Credits
About the Authors
Acknowledgments
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Running Your First Gradle Task
Installing Gradle
Installing manually
Installing on Mac OS X and Linux
Installing on Windows
Alternate methods of installing Gradle
Installing via OS-specific package managers
Mac OS X
Linux (Ubuntu)
Windows
Installing via SDKMAN
Verifying the installation
Setting JVM options
The Gradle command-line interface
The first Gradle build script
Task name abbreviation
Gradle Daemon
Gradle Wrapper
Generating wrapper files
Running a build via wrapper
Summary
2. Building Java Projects
Building a simple Java project
Creating a build file
Adding source files
Building the project
A brief introduction to plugins
Unit testing
Adding a unit test source
Adding the JUnit to the classpath
Running the test
Viewing test reports
Fitting tests in the workflow
Bundling an application distributable
Running the application with Gradle
Building the distribution archive
Generating IDE project files
Summary
3. Building a Web Application
Building a simple Java web project
Creating source files
Creating a build file
Building the artifact
Running the web application
Plugins to the rescue
References
Project dependencies
External libraries
The dynamic version
Transitive dependencies
Dependency configurations
Repositories
Summary
4. Demystifying Build Scripts
Groovy for Gradle build scripts
Why Groovy?
Groovy primer
Running Groovy code
Variables
Strings
Regular expressions
Closures
Data structures
List
Set
Map
Methods
Calling methods
Default values of parameters
Methods with map parameters/named parameters
Methods with varags
Methods with closure params
Classes
Constructors
Properties
Instance methods
Another look at applying plugins
Gradle – an object-oriented build tool
Build phases
Initialization
Configuration
Execution
Life cycle callbacks
Gradle Project API
Project methods
Project properties
Extra properties on a project
Tasks
Attaching actions to a task
Task flow control
dependsOn
finalizedBy
onlyIf
mustRunAfter and shouldRunAfter
Creating tasks dynamically
Setting default tasks
Task types
Using task types
Creating task types
References
Groovy
Gradle API and DSL used in this chapter
Summary
5. Multiprojects Build
The multiproject directory layout
The settings.gradle file
Organizing build logic in multiproject builds
Applying a build logic to all projects
Applying build logic to subprojects
Dependency on subprojects
Summary
6. The Real-world Project with Gradle
Migrating from an Ant-based project
Importing an Ant file
Using AntBuilder API
Rewriting Ant tasks to Gradle tasks
Migrating from a Maven project
Publishing artifacts
Continuous Integration
Generating documentation
Summary
7. Testing and Reporting with Gradle
Testing with TestNG
Integration testing
Code coverage
Code analysis reports
Summary
8. Organizing Build Logic and Plugins
Extracting build logic to buildSrc
The first plugin
Configuring plugins
Summary
9. Polyglot Projects
The polyglot application
Building Groovy projects
Building Scala projects
Joint compilation
References
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜