1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
apply plugin: 'groovy'
dependencies {
compile project(':base:gradle-core')
compile gradleApi()
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.28'
}
group = 'com.android.tools.build'
archivesBaseName = 'gradle'
version = rootProject.ext.buildVersion
project.ext.pomName = 'Gradle Plug-in for Android'
project.ext.pomDesc = 'Gradle plug-in to build Android applications.'
jar.manifest.attributes("Plugin-Version": version)
jar.manifest.attributes("Inception-Date": rootProject.ext.inceptionDate)
def generated = new File("${project.buildDir}/generated/java")
sourceSets {
main {
java {
srcDir generated
}
}
}
def pluginVersion = rootProject.ext.buildVersion;
def componentPluginVersion = rootProject.ext.experimentalVersion;
task generateVersionConstantsJava {
inputs.property("pluginVersion", pluginVersion)
inputs.property("componentPluginVersion", componentPluginVersion)
ext.versionFile = new File(generated, "com/android/build/gradle/internal/Version.java")
outputs.file(versionFile)
}
generateVersionConstantsJava << {
versionFile.parentFile.mkdirs()
versionFile.text = """
package com.android.build.gradle.internal;
public final class Version {
private Version() {}
public static final String ANDROID_GRADLE_PLUGIN_VERSION = "$pluginVersion";
public static final String ANDROID_GRADLE_COMPONENT_PLUGIN_VERSION = "$componentPluginVersion";
}
"""
}
tasks.compileJava.dependsOn generateVersionConstantsJava
test {
environment("CUSTOM_REPO", rootProject.file("../out/repo"))
testLogging {
events "failed"
}
if (Runtime.runtime.availableProcessors() >= 2) {
maxParallelForks = Runtime.runtime.availableProcessors() / 2
}
}
groovydoc {
exclude "**/internal/**"
includePrivate false
docTitle "Gradle Plugin for Android"
header ""
footer "Copyright (C) 2012 The Android Open Source Project"
}
task javadocJar(type: Jar, dependsOn:groovydoc) {
classifier 'javadoc'
from groovydoc.destinationDir
}
|