How to use project extensions in Gradle

Gradle has already provided a very powerful DSL for build developer, for example, the way you declare dependencies is defined by Gradle as a DSL syntax.

Its really more readable than Maven or other build tools.

Setting task group in Gradle

The 'group' is a built in property in each task. When set, the task list will be present by their group name, make it easier to browse the list.

Lets set this property in our task

How to use file interfaces in Gradle project, the file, files, fileTree

A build tool is all about manipulating files, it compiles source files, packages artifact files, resolves dependencies files, copy files, deletes temporary files. Its not surprise that many Gradle class accepting and generating files.

Represent files is a very important part of a great build tool. Gradle contains many utilities to allow you manipulate the file easily and flexibly.

Understanding Gradle configuration

Configuration is a fundamental concept in Dependency management of Gradle. The name "configuration" may be not so intuitive . Actually , its just a list of file, the file is your dependencies files, it could be in your local cache, or in a repository host on a web server.

Copy files from multiple locations to one destination with Gradle copy task

copy task is copy the file and keep their directory structure. Suppose, you have multiple project ... } task copyMd( type: Copy) { def n = 0 def testcol = files('.') testcol ... ' + (n) + '.md' } includeEmptyDirs = false } Copy files around is quite a common task in any ... directories, each of them contains one or more markdown files, these files may nested deep

Eclipse Gradle dependencies problem

There is a little problem with the Eclipse Gradle project plugin. It may confuse people at some point.

I was trying to test the redis client for Java. And the dependency in gradle.build looks like this.

How to use ext in gradle build script

Usually, the ext in gradle build script is used to define constants. For example, the version.

In C++, you may use the const variable or #define macro. When the value changes, only one place need to be changed.

Gradle Eclipse and JUnit example

you don't have to worry about the JUnit dependency. Lets create a Gradle project in Eclipse ... The usual way to work with JUnit include ... these steps. Download the JUnit JAR, unpack JUnit to a local folder and run command java ... -classpath junit.jar;. junit.textui.TestRunner With automation build tool like Gradle , it can be much

Configure Gradle buildscript

The buildscript is used to configures the classpath for current build.gradle script file. The repositories and dependencies defined inside buildscript closure are used by gradle script, for example, apply a third party plugin.

The repositories and dependencies outside buildscript closure are used by your project, for example the Java sources.

Using Ant in Gradle

Gradle supports Ant very well through its AntBuilder, actually you can use Gradle as a wrapper of Ant script. The closure of Groovy language strong resemble the Ant XML syntax.

When call Ant task in Gradle, the first parameter is a map which correspond to the attributes of the task element. For example

Previous Page 1 2 3 4 Next Page