Gradle Notes – 23 Sept – 2023
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
What is Gradle?
-------------------
Build Tools
Why Gradle?
-------------------------
Dev in Java + Goorvy
Open Source & Free
--------------------------
Less coding
Support - mul Lang
Procedural - mvn
Declarative - ant - msbuild
--------------------------
How to install it?
----------------------
- JDK
- Gradle
Download
extract
Set in path
-------------------------------------
================================================================================
Declarative
Code --> build.gradle
=============================================
task1
action(dolast)
download
extract
action(dofirst)
copy
task copyDocs(type: Copy) {
from 'src/main/doc'
into 'build/target/doc'
}
task2
env
cmd
task3
compile
task4
test
task5
package
=================================================================
Write a code
Auto Build
Activity Diagram
git clone this repo
Clean up [ Conditional]
Create a dir
Copy a Source Code to builddir
Compile
test
Package
task stopTomcat(type:Exec) {
workingDir '../tomcat/bin'
//on windows:
commandLine 'cmd', '/c', 'deploy.p'
https://devopsschool.com/path/
Gradle Tasks are exaplained in 10 mins!
https://www.devopsschool.com/blog/?s=gradle
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Delete.html
//on linux
commandLine './stop.sh'
https://www.devopsschool.com/blog/?s=gradle
https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Delete.html