com.mobgen.halo.android.gradle.HaloAuth.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.gradle
import org.gradle.api.GradleException
import org.gradle.api.Project;
/**
* Auth link to the libraries.
*/
public class HaloAuth {
/**
* The google client id.
*/
String googleClient
/**
* The facebook client id.
*/
String facebookClient
/**
* Configures the google authentication.
* @param clientId The token to configure google.
*/
public void google(String clientId){
if(clientId && !googleClient){
this.googleClient = clientId
}
}
/**
* Configures the facebook credentials.
* @param clientId
*/
public void facebook(String clientId){
if(clientId && !facebookClient){
this.facebookClient = clientId
}
}
/**
* Configures the dependencies.
* @param project The project.
* @param dependencyMode The dependency mode.
* @param dependencyVersion The dependency version of the plugin.
*/
public void configureDependencies(Project project, String dependencyMode, String dependencyVersion) {
project.dependencies.add(dependencyMode, "${HaloPlugin.GROUP_NAME}:halo-auth:${dependencyVersion}")
if(facebookClient){
project.dependencies.add(dependencyMode, "com.facebook.android:facebook-android-sdk:${Version.FACEBOOK_VERSION}")
}
if(googleClient){
project.dependencies.add(dependencyMode, "com.google.android.gms:play-services-auth:${Version.GOOGLE_VERSION}")
}
}
}