Reorganize how we deal with shared JavaScript test examples
When IntelliJ IDEA imports WALA's Gradle configuration, it creates what is calls a "module" for each sourceSet of each Gradle subproject. In so doing, it automatically picks up the source and resource directories used by each of these sourceSets. Unfortunately, IntelliJ IDEA does not allow multiple modules to share a single root directory as their source or resource directories, and that's exactly what was going on with the "example-src" subdirectory under "com.ibm.wala.cast.js.test.data". This revised Gradle configuration still has is copying the necessary "example-src" resources to the appropriate locations for use as test resources. But IntelliJ IDEA no longer treats "example-src" as a root directory for resources in the automatically-generated modules. So now we get along nicer with IntelliJ IDEA while keeping everything working with Gradle as well.
This commit is contained in:
parent
3d9e4d23d8
commit
858148e91b
|
@ -57,7 +57,6 @@ version '1.5.0-SNAPSHOT'
|
||||||
subprojects { subproject ->
|
subprojects { subproject ->
|
||||||
// skip generic Java setup for the few projects that have no Java code whatsoever
|
// skip generic Java setup for the few projects that have no Java code whatsoever
|
||||||
switch (subproject.name) {
|
switch (subproject.name) {
|
||||||
case 'com.ibm.wala.cast.js.test.data':
|
|
||||||
case 'com.ibm.wala-repository':
|
case 'com.ibm.wala-repository':
|
||||||
case ~/.*_feature/:
|
case ~/.*_feature/:
|
||||||
return
|
return
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main.java.srcDirs = ['src']
|
main.java.srcDirs = ['src']
|
||||||
test {
|
test.java.srcDirs = ['tests']
|
||||||
java.srcDirs = ['tests']
|
|
||||||
resources.srcDirs = [project(':com.ibm.wala.cast.js.test.data').file('examples-src')]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
@ -21,6 +18,12 @@ dependencies {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processTestResources {
|
||||||
|
def data = project(':com.ibm.wala.cast.js.test.data')
|
||||||
|
dependsOn data.processTestResources
|
||||||
|
from data.sourceSets.test.resources
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
maxHeapSize = '800M'
|
maxHeapSize = '800M'
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,7 @@ plugins {
|
||||||
id 'com.github.hauner.jarTest'
|
id 'com.github.hauner.jarTest'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.test {
|
sourceSets.test.java.srcDirs = ['harness-src']
|
||||||
java.srcDirs = ['harness-src']
|
|
||||||
resources.srcDirs = [project(':com.ibm.wala.cast.js.test.data').file('examples-src')]
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(
|
testCompile(
|
||||||
|
@ -22,6 +19,12 @@ dependencies {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processTestResources {
|
||||||
|
def data = project(':com.ibm.wala.cast.js.test.data')
|
||||||
|
dependsOn data.processTestResources
|
||||||
|
from data.sourceSets.test.resources
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
environment 'TRAVIS', 1
|
environment 'TRAVIS', 1
|
||||||
maxHeapSize = '800M'
|
maxHeapSize = '800M'
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
plugins {
|
sourceSets.test.resources.srcDirs = ['examples-src']
|
||||||
id 'base'
|
|
||||||
}
|
|
||||||
|
|
||||||
task downloadAjaxslt(type: VerifiedDownload) {
|
task downloadAjaxslt(type: VerifiedDownload) {
|
||||||
def version = '0.8.1'
|
def version = '0.8.1'
|
||||||
|
@ -21,3 +19,5 @@ task unpackAjaxslt(type: Sync, dependsOn: downloadAjaxslt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
clean.dependsOn cleanUnpackAjaxslt
|
clean.dependsOn cleanUnpackAjaxslt
|
||||||
|
|
||||||
|
processTestResources.dependsOn(unpackAjaxslt)
|
||||||
|
|
|
@ -2,10 +2,7 @@ plugins {
|
||||||
id 'com.github.hauner.jarTest'
|
id 'com.github.hauner.jarTest'
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.test {
|
sourceSets.test.java.srcDirs = ['harness-src']
|
||||||
java.srcDirs = ['harness-src']
|
|
||||||
resources.srcDirs = [project(':com.ibm.wala.cast.js.test.data').file('examples-src')]
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(
|
testCompile(
|
||||||
|
@ -21,7 +18,11 @@ dependencies {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
processTestResources.dependsOn ':com.ibm.wala.cast.js.test.data:unpackAjaxslt'
|
processTestResources {
|
||||||
|
def data = project(':com.ibm.wala.cast.js.test.data')
|
||||||
|
dependsOn data.processTestResources
|
||||||
|
from data.sourceSets.test.resources
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
maxHeapSize = '800M'
|
maxHeapSize = '800M'
|
||||||
|
|
Loading…
Reference in New Issue