/
build.gradle
83 lines (69 loc) · 2.18 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
77
78
79
80
81
82
83
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.episode6.hackit.deployable:deployable:0.2.3'
}
}
group = "com.episode6.hackit.gdmc"
version = "0.1.12"
wrapper {
gradleVersion = "5.3"
distributionType = "all"
}
repositories {
jcenter()
google()
}
apply plugin: 'groovy'
apply plugin: 'com.episode6.hackit.deployable.gradle-plugin'
apply plugin: com.episode6.hackit.gdmc.plugin.GdmcPlugin
// The plugin source code lives in 'buildSrc' so that we may apply it to ourselves to resolve test dependencies
sourceSets.main.groovy.srcDirs += 'buildSrc/src/main/groovy'
configurations {
// A place for dependencies that must be placed in the pluginClasspath for testing
// but do not need to be compile dependencies. (i.e. this is for plugins we need to
// test for compatibility with)
alsoUnderTest
}
// apply project dependencies from shared file
apply from: 'project-dependencies.gradle'
dependencies {
implementation localGroovy()
implementation gradleApi()
testImplementation("org.spockframework:spock-core") {
exclude module: 'groovy-all'
}
testImplementation gradleTestKit()
testImplementation 'com.episode6.hackit.groovykit:gk-files'
testImplementation 'com.episode6.hackit.groovykit:gk-versions'
alsoUnderTest 'com.episode6.hackit.deployable:deployable'
alsoUnderTest 'com.android.tools.build:gradle'
}
sourceSets {
// an alternate reality version of the main sourceSet with the
// alsoUnderTest config included on the runtimeClasspath.
// This hack allows us to test our plugin along side other plugins
// that aren't actually part of the build (but we want to ensure)
// compatibility with.
codeUnderTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.runtimeClasspath + configurations.alsoUnderTest
}
}
gradlePlugin {
pluginSourceSet sourceSets.codeUnderTest
}
// validate project dependencies that we can't use gdmc to resolve
task validateImplDeps(type: com.episode6.hackit.gdmc.task.GdmcValidateDepsTask) {
dependencies = {
configurations.implementation.dependencies
}
}
test {
testLogging {
showStandardStreams = true
}
dependsOn validateImplDeps
}