com.getkeepsafe.dexcount.GradleApi.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dexcount-gradle-plugin Show documentation
Show all versions of dexcount-gradle-plugin Show documentation
A Gradle plugin for counting methods in an .apk
package com.getkeepsafe.dexcount
import org.codehaus.groovy.runtime.InvokerHelper
import org.gradle.StartParameter
/**
* Attempts to isolate our use bits of the Gradle API that have changed in
* incompatible ways over time.
*/
final class GradleApi {
private GradleApi() {
// no instances
}
/**
* Return {@code true} if Gradle was launched with {@code --stacktrace},
* otherwise {@code false}.
*
* Gradle broke compatibility between 2.13 and 2.14 by repackaging
* the {@code ShowStacktrace} enum; consequently we need to refer to
* it by string name only.
*
* @param startParam
*/
static boolean isShowStacktrace(StartParameter startParam) {
Enum stacktrace = (Enum) InvokerHelper.invokeMethod(
startParam, "getShowStacktrace", null)
return "INTERNAL_EXCEPTIONS" != stacktrace.name()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy