All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mobgen.halo.android.gradle.HaloAuth.groovy Maven / Gradle / Ivy

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}")
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy