Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android build.gradle what is group used for?

check build.gradle and there is a variable from project itself called "group". In the code i inherited its set to the application id but what is group used for ?

the gradle documentation it states:

void setGroup(Object group) Sets the group of this project.

UPDATE: From what i can tell from here it looks like groups are for grouping tasks together.

like image 505
j2emanue Avatar asked Jul 15 '15 19:07

j2emanue


People also ask

WHAT IS group in build Gradle?

group signifies the groupId of the project/task that is being worked on. com.example:my-project:0.1 ----------- ---------- --- | | | groupId artifact version.

What is group and name in Gradle?

In Gradle we can group related tasks using the group property of a task. We provide the name of our group and if we look at the output of the tasks task we can see our tasks grouped in section with the given name. In the next sample we create a new task publish and assign it the group name Publishing.

What is group and module in Gradle?

Group and module are properties for looking up libraries within maven repositories. For your dependency com.google.http-client:google-http-client:1.20.0. Group is com.google.http-client , module is google-http-client and the version is 1.20.0 .

What is a Buildtype in Gradle and what can you use it for?

A build type determines how an app is packaged. By default, the Android plug-in for Gradle supports two different types of builds: debug and release . Both can be configured inside the buildTypes block inside of the module build file.


1 Answers

The group is effectively a namespace for identifying the artifact or artifacts produced by a build. As an example, when you have a dependency like this:

dependencies {
    compile 'org.hibernate:hibernate-core:3.6.7.Final'
}

The org.hibernate is the group (or groupId in Maven parlance). So if your build produces a JAR file that is published to a repository, it is published under the group you specify in the build file:

group = "org.example"

I don't know if the group makes much sense outside of publishing artifacts. I only ever use it for JAR libraries.

like image 65
Peter Ledbrook Avatar answered Nov 09 '22 23:11

Peter Ledbrook