File: build.gradle

package info (click to toggle)
android-platform-tools-base 2.2.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 113,928 kB
  • sloc: java: 696,396; xml: 45,920; cpp: 2,526; ansic: 1,432; sh: 508; lisp: 110; javascript: 108; makefile: 17
file content (100 lines) | stat: -rw-r--r-- 3,074 bytes parent folder | download | duplicates (2)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
apply plugin: 'java'
apply plugin: 'jacoco'

evaluationDependsOn(':base:builder-model')
evaluationDependsOn(':base:builder-test-api')

dependencies {
    compile project(':base:builder-model')
    compile project(':base:builder-test-api')
    compile project(':base:profile')

    compile project(':base:sdklib')
    compile project(':base:sdk-common')
    compile project(':base:common')
    compile project(':base:manifest-merger')
    compile project(':base:ddmlib')

    compile 'com.android.tools.analytics-library:protos:debian'
    compile 'com.android.tools.analytics-library:shared:debian'
    compile 'com.android.tools.analytics-library:tracker:debian'

    compile 'com.squareup:javawriter:2.5.0'
    compile 'org.bouncycastle:bcpkix-jdk15on:1.48'
    compile 'org.bouncycastle:bcprov-jdk15on:1.48'
    compile 'org.ow2.asm:asm:5.0.4'
    compile 'org.ow2.asm:asm-tree:5.0.4'

    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-all:1.9.5'
    testCompile 'com.google.truth:truth:0.28'
    testCompile project(':base:testutils')
    testCompile project(':base:sdklib')
}

test {
    if (Runtime.runtime.availableProcessors() >= 2) {
        maxParallelForks = Runtime.runtime.availableProcessors() / 2
    }
}

group = 'com.android.tools.build'
archivesBaseName = 'builder'
version = rootProject.ext.buildVersion

project.ext.pomName = 'Android Builder library'
project.ext.pomDesc = 'Library to build Android applications.'


jar.manifest.attributes("Builder-Version": version)

def generated = new File("${project.buildDir}/generated/java")

sourceSets {
    main {
        java {
            srcDir generated
            srcDir '../profile/src/main/java'
        }
    }
}

def componentPluginVersion = rootProject.ext.experimentalVersion
task generateVersionConstantsJava {
    inputs.property("apiVersion", apiVersion)
    inputs.property("nativeApiVersion", nativeApiVersion)
    inputs.property("version", version)
    inputs.property("componentPluginVersion", componentPluginVersion)
    ext.versionFile = new File(generated, "com/android/builder/Version.java")
    outputs.file(versionFile)
}
generateVersionConstantsJava << {
    versionFile.parentFile.mkdirs()
    versionFile.text = """
package com.android.builder;

public final class Version {
    private Version() {}
    public static final String ANDROID_GRADLE_PLUGIN_VERSION = "$version";
    public static final String ANDROID_GRADLE_COMPONENT_PLUGIN_VERSION = "$componentPluginVersion";
    public static final int BUILDER_MODEL_API_VERSION = $apiVersion;
    public static final int BUILDER_NATIVE_MODEL_API_VERSION = $nativeApiVersion;

    // Getter method for the plugin version so that it is not inlined.
    public static String getAndroidGradlePluginVersion() {
        return ANDROID_GRADLE_PLUGIN_VERSION;
    }
    public static String getAndroidGradleComponentPluginVersion() {
        return ANDROID_GRADLE_COMPONENT_PLUGIN_VERSION;
    }
}
"""
}

tasks.compileJava.dependsOn generateVersionConstantsJava

configurations {
    provided
    sourcesProvided
}