com.datadog.gradle.plugin.internal.ProjectExt.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dd-sdk-android-gradle-plugin Show documentation
Show all versions of dd-sdk-android-gradle-plugin Show documentation
Plugin to upload Proguard/R8 mapping files to Datadog.
The newest version!
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
package com.datadog.gradle.plugin.internal
import com.datadog.gradle.plugin.DdAndroidGradlePlugin.Companion.LOGGER
import org.gradle.process.ExecOperations
import org.gradle.process.internal.ExecException
import java.io.ByteArrayOutputStream
internal fun ExecOperations.execShell(vararg command: String): String {
val outputStream = ByteArrayOutputStream()
val errorStream = ByteArrayOutputStream()
try {
this.exec {
@Suppress("SpreadOperator")
it.commandLine(*command)
it.standardOutput = outputStream
it.errorOutput = errorStream
}
} catch (e: ExecException) {
LOGGER.error(errorStream.toString("UTF-8"))
throw e
}
return outputStream.toString("UTF-8")
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy