forked from GTNewHorizons/Applied-Energistics-2-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon.gradle
40 lines (34 loc) · 1.63 KB
/
addon.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
SourceSet functionalTestSet = null
sourceSets {
functionalTestSet = create("functionalTest") {
java {
srcDir("src/functionalTest/java")
compileClasspath += sourceSets.patchedMc.output + sourceSets.main.output
}
}
}
configurations { configs ->
// Keep all dependencies from the main mod in the functional test mod
named(functionalTestSet.compileClasspathConfigurationName).configure {it.extendsFrom(named("compileClasspath").get())}
named(functionalTestSet.runtimeClasspathConfigurationName).configure {it.extendsFrom(named("runtimeClasspath").get())}
named(functionalTestSet.annotationProcessorConfigurationName).configure {it.extendsFrom(named("annotationProcessor").get())}
}
tasks.register(functionalTestSet.jarTaskName, Jar) {
from(functionalTestSet.output)
archiveClassifier.set("functionalTests")
// we don't care about the version number here, keep it stable to avoid polluting the tmp directory
archiveVersion.set("1.0")
destinationDirectory.set(new File(buildDir, "tmp"))
}
tasks.named("assemble").configure {
dependsOn(functionalTestSet.jarTaskName)
}
// Run tests in the default runServer/runClient configurations
tasks.named("runServer", JavaExec).configure {
dependsOn(functionalTestSet.jarTaskName)
classpath(configurations.named(functionalTestSet.runtimeClasspathConfigurationName), tasks.named(functionalTestSet.jarTaskName))
}
tasks.named("runClient", JavaExec).configure {
dependsOn(functionalTestSet.jarTaskName)
classpath(configurations.named(functionalTestSet.runtimeClasspathConfigurationName), tasks.named(functionalTestSet.jarTaskName))
}