forked from jvoegele/gradle-android-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
76 lines (63 loc) · 2.34 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
74
75
76
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'eclipse'
version = '1.0.0-SNAPSHOT'
group = 'com.jvoegele.gradle.plugins'
configurations {
sshDeploy
integrationTestCompile {
extendsFrom testCompile
}
integrationTestRuntime {
extendsFrom integrationTestCompile, testRuntime
}
}
repositories {
mavenCentral()
}
dependencies {
sshDeploy 'org.apache.maven.wagon:wagon-ssh:1.0-beta-7'
}
uploadArchives {
repositories.mavenDeployer {
//configuration = configurations.sshDeploy
//repository(url: "scp://[email protected]/web/public/maven2")
repository(url: "file:///tmp/maven2")
}
}
dependencies {
// Add all JAR files in the lib directory of theGradle installation directory
// to the groovy configuration (is also used by compile configuration)
groovy fileTree(dir: new File(gradle.gradleHomeDir, 'lib'), includes: ['**/*.jar'])
}
// Make sure all code is compiled, tested and checked before uploadArchives.
uploadArchives.dependsOn ':build'
sourceSets {
integrationTest {
groovy.srcDir file('src/integTest/groovy')
resources.srcDir file('src/integTest/resources')
compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.integrationTestCompile
runtimeClasspath = classes + compileClasspath + configurations.integrationTestRuntime
}
}
task integrationTest(type: Test, dependsOn: jar) {
testClassesDir = sourceSets.integrationTest.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
systemProperties['integTest.androidProjects'] = new File(testClassesDir, 'androidProjects').absolutePath
doFirst {
if (!System.getenv('ANDROID_HOME')) {
throw new GradleException('ANDROID_HOME environment variable must be defined to run integration tests')
}
}
}
task developerBuild {
dependsOn build, integrationTest
}
clean << {
//TODO: will this work on Windows? I intentionally used the file() method so as
// to be platform independent, but I didn't test this outside MacOS/Linux
def gradleCacheDir = file("${System.properties['user.home']}/.gradle/cache")
def pluginCacheDir = file("$gradleCacheDir/$project.group/$project.name")
logger.warn "Clearing Gradle artifact cache at $pluginCacheDir"
ant.delete dir: pluginCacheDir
}