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

com.deploygate.gradle.plugins.entities.DeployGateExtension.groovy Maven / Gradle / Ivy

Go to download

This is the DeployGate plugin for the Gradle. You can build and deploy your apps to DeployGate by running a single task.

There is a newer version: 2.9.0
Show newest version
package com.deploygate.gradle.plugins.entities

import com.deploygate.gradle.plugins.Config
import com.deploygate.gradle.plugins.utils.HTTPBuilderFactory
import groovyx.net.http.ContentType
import org.gradle.api.NamedDomainObjectContainer

public class DeployGateExtension {
    def String token
    def String userName
    def String endpoint = Config.DEPLOYGATE_ROOT

    def NamedDomainObjectContainer apks
    def String notifyKey = null

    public DeployGateExtension(NamedDomainObjectContainer apkTargets) {
        this.apks = apkTargets
    }

    public apks(Closure closure) {
        apks.configure(closure)
    }

    def notifyServer(String action, HashMap data = null) {
        if (!notifyKey)
            return

        def query = ['key': notifyKey, 'command_action': action]
        if (data)
            query = query + data

        try {
            HTTPBuilderFactory.httpBuilder(endpoint).post path: "/cli/notify",
                    body: query, requestContentType: ContentType.URLENC
        } catch (ignored) {
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy