com.mobgen.halo.android.plugin.sdk.HaloExtension.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of halo-plugin Show documentation
Show all versions of halo-plugin Show documentation
This plugin helps on the configuration of the SDK.
package com.mobgen.halo.android.plugin.sdk
import com.mobgen.halo.android.plugin.sdk.modules.CoreModule
import com.mobgen.halo.android.plugin.sdk.modules.PushModule
import org.gradle.api.Project
/**
* The halo extension to configure the plugin.
*/
public class HaloExtension extends ProjectExtension {
/**
* The list of modules.
*/
private List modules
/**
* The client id
*/
public String clientId
/**
* The client secret
*/
public String clientSecret
/**
* The client id used for debug builds.
*/
public String clientIdDebug
/**
* The client secret used for debug builds.
*/
public String clientSecretDebug
/**
* The push notifications module.
*/
private PushModule pushModule
/**
* Halo extension constructor.
*/
public HaloExtension(Project project){
super(project)
}
/**
* Closure API for the convention object.
* @param pushClosure push closure.
*/
def push(Closure pushClosure) {
pushModule = new PushModule()
project.configure(pushModule, pushClosure)
}
/**
* Stores the api key for halo.
* @param clientId The api key
*/
def clientId(String clientId){
this.clientId = clientId
}
/**
* The client id that will be used for debug builds.
* @param clientId The client id that will be used for debug builds.
*/
def clientIdDebug(String clientId){
this.clientIdDebug = clientId
}
/**
* The client secret.
* @param clientSecret The client secret.
*/
def clientSecret(String clientSecret){
this.clientSecret = clientSecret
}
/**
* The client secret used for debug builds.
* @param clientSecretDebug The client secret.
*/
def clientSecretDebug(String clientSecredDebug){
this.clientSecretDebug = clientSecredDebug;
}
/**
* Builds all the modules configuring them based on the properties.
*/
public void buildHalo(){
modules = CoreModule.CoreBuilder.create()
.project(project)
.extension(this)
.build(pushModule)
}
/**
* Provides the modules.
* @return The modules.
*/
public List getModules(){
return modules
}
/**
* Provides the push module.
* @return The push module.
*/
public PushModule pushModule(){
return pushModule
}
}