-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
73 lines (63 loc) · 1.92 KB
/
build.gradle
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
apply plugin: 'groovy'
apply plugin: 'java-gradle-plugin'
apply plugin: 'maven-publish'
sourceSets {
integrationTest
}
repositories {
mavenCentral()
}
dependencies {
compile gradleApi()
compile localGroovy()
testCompile 'com.android.tools.build:gradle:1.2.0'
integrationTestCompile gradleApi()
integrationTestCompile localGroovy()
}
description = 'Clojure plugin for the Gradle-based Android build system'
group = 'org.clojure-android'
version = '0.1.0-SNAPSHOT'
project.ext.compileSdkVersion = 'android-21'
project.ext.buildToolsVersion = '22.0.1'
project.ext.androidSdkDir = getAndroidSdkDir()
publishing {
repositories {
maven {
name = 'test'
url "${buildDir}/test-repo"
}
}
publications {
test(MavenPublication) {
from components.java
version = "${version}-test"
}
}
}
task integrationTest(type: Test) {
systemProperty 'android.sdk.dir', project.androidSdkDir
systemProperty 'clojure.plugin.version', "${version}-test"
systemProperty 'test.maven.repo', publishing.repositories.test.url
systemProperty 'compile.sdk.version', project.compileSdkVersion
systemProperty 'build.tools.version', project.buildToolsVersion
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
}
integrationTest.description 'Runs the integration tests.'
integrationTest.dependsOn ':publishTestPublicationToTestRepository'
integrationTest.group 'verification'
integrationTest.doFirst {
if (project.androidSdkDir == null) {
throw new GradleScriptException('No valid ANDROID_HOME detected', null)
}
}
String getAndroidSdkDir() {
String androidHome = System.getenv('ANDROID_HOME')
if (androidHome != null) {
File f = new File(androidHome)
if (f.isDirectory()) {
return f.absolutePath
}
}
return null
}