Learn free gradle tutorials


How to create a release signed apk file using Gradle?

August 16, 2021 ·  2 min read

Once your android application is ready, You need to generate apk with signed . In this tutorial talks about how to generate a release apk file using gradle file How to generate release unsigned apk file using gradle? During development, You need to test your application in real devices, you need to generate unsigned apk file. Here are sequence of steps to generate unsigned apk release In build.gradle file, You can add signingConfigs attribute with below values....


Different ways to pass command line arguments to gradle command task

August 15, 2021 ·  2 min read

In this tutorial, You learned how to pass command line arguments from gradle build script. In gradle, We can pass parameters below types of parameters Project properties using -P option java system properties using -D option args option with application plugin How to pass project command line properties with gradle script In this, Project properties are passed with -P option from gradle command In build.gradle, task run has configured to read arguments with project....


How to perform git tasks with build script?

August 14, 2021 ·  3 min read

In this tutorials, Learn how to perform below git operations in build script. Clone git repository in gradle build git Pull changes from gradle task create a git tag and commit changes to remote repository. Some times, We have to write a build script to automate git tasks for build process in continuous integration and build deployment, This build scripts are configured as dependent plugins in life cycle of gradle build cycle or can run as individual....


Fix for permission denied error for gradlew command

August 11, 2021 ·  2 min read

This is an short tutorial how to fix an gradlew permission denied error When you run gradlew command with any task, You got following error in windows as well as linux $ ./gradlew compile -bash: ./gradlew: Permission denied gradlew: Permission denied is an permission error on linux or unix machine, So you have to change permissions for gradlew wrapper command. First check avialiable permissions for the file using below command...


Difference between using gradlew and gradle

August 10, 2021 ·  3 min read

Gradle tasks are run with either gradle or gradlew command. Gradlew is an gradle wrapper for gradle command This tutorial talks about difference between gradlew and gradle command. What you can do with Gradle command? if your machine has a gradle installation, Then gradle command works as seen below. It gives gradle version installed on local machine C:\>gradle > Task :help Welcome to Gradle 6.0.1. To run a build, run gradle <task> ....


Learn Gradle | tutorials and examples

August 9, 2021 ·  3 min read

What is Gradle ? Gradle is a Opensource build automation tool to build and run the projects in Android and java based projects Features Incremental builds Gradle consider the last modified files and last build and only builds with modified files thus improves performance. Parallel task execution Build caching JVM and Android application management Gradle version Current version is 7.1. Gradle Download gradle tool can be downloaded from here....


Difference between gradle and maven build tools

August 8, 2021 ·  2 min read

In this tutorial, Compare maven with gradle and difference between these two tools Gradle is an opensource build automation tool for building java and android projects. It uses configuration in domain specific language with groovy or kotlin syntax. Gradle configuration are conventional syntax in files are defined as build.gradle for groovy script build.gradle.kts for kotlin script Gradle performance is good and simple configuration to build projects in web and mobile applicaiton...


How to exclude dependency in gradle projects?

August 7, 2021 ·  2 min read

This tutorials talks about how to exclude dependency in gradle. This post also includes about exclude jar file in groovy and kotlin script. Gradle uses two different version syntaxes for configuring build dependencies groovy kotlin How to exclude transitive dependencies in gradle? This section talks about exclude at runtime and compile time for each dependency exclude runtime dependency: Some times, You have transitive dependencies which are causing conflict with version of direct dependency....


How to install and configure gradle ?

August 6, 2021 ·  2 min read

This tutorials explains step by step tutorial on how to install and setup on below environments windows Linux Mac OS Gradle is a Java and Android project build automation tool. More projects are adopting this tool during development now that Android Studio supports integrated with Gradle. Gradle requires Java to be installed. It needs JDK version 8 at least. First Check Java is installed or not using below command...


Frequently used Gradle commands list | gradle cheat sheet

August 1, 2021 ·  3 min read

Gradle is a build automation tool for java and android projects. Developer working on java projects know about gradle command use. This tutorial covers list of commands used by developer for daily usage in projects Please have a look of my previous article maven installation. For the maven installation, the JDK is required. You can use either gradle wrapper command gradlew or [installs gradle] (/gradle-installation> locally for gradle command execution...


Different ways to configure java version in Gradle project

July 31, 2021 ·  3 min read

This tutorials talks about different ways of configuring java version in gradle projects. In java projects, Source projects are compiled and generates class files. In Gradle, For java plugin, We need provide java version in build gradle for compile and generate class files. Java installation is required for building gradle project and running gradle build. How to configure source and target jdk version in gradle build to compile files in java, we use javac command and it has source and target arguments for javac command...


How to run only single test cases with gradle build

July 30, 2021 ·  2 min read

This is an short tutorial on how to run single test case execution in gradle build Single module project Multi modular project some times, to debug testcase execution, We need to run single test cases for multiple times, thus helps developers to debug and run multiple times without wasting time. Test cases can be unit or integration or functional tests. How to run single test cases in gradle project?...


How can I force gradle to redownload dependencies?

July 29, 2021 ·  2 min read

Some times We want to redownload dependencies in a gradle project. How can you force grade dependencies to download freshly. This post describes how to do the command line to force snapshot and release dependencies in a gradle project. In development, We have many use cases where we have to redownload dependencies when you are doing Gradle build first time, It downloads all dependencies For suppose, if build fails and some dependencies are not downloaded due to network issues Some times, dependency version has been changed, You have to redownload new version Gradle download the dependencies from remote repositories like nexus....


How to get dependency tree graph in gradle projects

July 27, 2021 ·  16 min read

Gradle is an project build tool for java and android applications. When you are using gradle in your project, you need to define the dependencies in gradle file. Once the dependencies have been configured, they will be downloaded from repositories to your local machine. When installing with gradle command, you must use the dependency plugin to configure the dependencies, which manipulates the artefacts. You can check other post on maven print dependencies tree....


Ways to skip test case execution in gradle project build

July 27, 2021 ·  3 min read

With gradle build or run command, by default executes test case execution. Sometimes, We want to disable or ignore test execution in gradle project execution. In Maven, you can easily do with command line with option -DskipTests=true. This blog talks about different ways to disable test cases execution in gradle project. This will skip the following test cases Unit test cases Integration test is -DskipTests available with gradle command?...


gitignore file for gradle java and android project

April 5, 2021 ·  2 min read

Gradle is a Java project build tool that allows you to compile, build, manage dependencies, and deploy your projects. It also creates jar/war/ear files for various web and Android applications. The java gradle project includes xml, java, and jsps source code that has been committed to svn and git repositories. Gitignore is a file that includes a list of files or directories that should be ignored when committing to remote repositories in Java projects....


Subscribe
You'll get a notification every time a post gets published here.