
com.mixpanel.android.compile.TweaksGradlePlugin.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations-compiler Show documentation
Show all versions of annotations-compiler Show documentation
Annotation Processor for the Mixpanel library for Android
http://mixpanel.com/android-analytics/
The newest version!
package com.mixpanel.android.compile;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
class TweaksGradlePlugin implements Plugin {
// This must match the value of "version" in gradle.properties
// or you'll be installing old versions
private static final TARGET_VERSION = '0.1.0-RC1';
@Override
void apply(final Project project) {
project.getDependencies().add('compile', 'com.mixpanel.android:annotations:' + TARGET_VERSION)
project.getDependencies().add('provided', 'com.mixpanel.android:annotations-compiler:' + TARGET_VERSION)
project.afterEvaluate {
if (project.android.hasProperty("libraryVariants")) {
project.android.libraryVariants.all { variant ->
variant.javaCompile.options.compilerArgs += [
'-processor', 'com.mixpanel.android.compile.TweaksAnnotationProcessor',
'-Acom.mixpanel.android.compiler.RegistrarPackage=' + variant.applicationId
]
}
}
if (project.android.hasProperty("testVariants")) {
project.android.testVariants.all { variant ->
variant.applicationId
variant.javaCompile.options.compilerArgs += [
'-processor', 'com.mixpanel.android.compile.TweaksAnnotationProcessor',
'-Acom.mixpanel.android.compiler.RegistrarPackage=' + variant.applicationId
]
}
}
if (project.android.hasProperty("applicationVariants")) {
project.android.applicationVariants.all { variant ->
variant.javaCompile.options.compilerArgs += [
'-processor', 'com.mixpanel.android.compile.TweaksAnnotationProcessor',
'-Acom.mixpanel.android.compiler.RegistrarPackage=' + variant.applicationId
]
}
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy