Index: build.gradle =================================================================== diff -u -r12553 -r12598 --- build.gradle (.../build.gradle) (revision 12553) +++ build.gradle (.../build.gradle) (revision 12598) @@ -2,13 +2,20 @@ //获取web项目的文件夹路径 def webProjectDir = project(':ssts-web').projectDir.getAbsolutePath() +def getDate() { + def date = new Date() + def formattedDate = date.format('yyyy-MM-dd HH:mm:ss') + return formattedDate +} def props = new Properties() + new File(webProjectDir + "/src/main/resources/jdbc.properties").withInputStream { stream -> props.load(stream) } // 获取jdbc.properties文件中定义的项目的名字 def projectName = props["project"] +println "编译时间:" + getDate() println "发布项目名称:" + projectName subprojects { @@ -57,20 +64,6 @@ options.compilerArgs << "-Xlint:-unchecked" } - /* - test { - // set heap size for the test JVM(s) - minHeapSize = "256m" - maxHeapSize = "512m" - - // set JVM arguments for the test JVM(s) - jvmArgs '-XX:MaxPermSize=256m' - - useTestNG() { - // runlist to executed. path is relative to current folder - suites 'src/test/java/test/forgon/AllTests.xml' - } - }*/ sourceSets { main { @@ -84,6 +77,7 @@ test { java { + srcDir 'src/main/java' srcDir 'src/test/java' } resources { @@ -93,6 +87,36 @@ } } + test { + // set heap size for the test JVM(s) + minHeapSize = "128m" + maxHeapSize = "512m" + + // show standard out and standard error of the test JVM(s) on the console + testLogging.showStandardStreams = true + + // set JVM arguments for the test JVM(s) + jvmArgs '-XX:MaxPermSize=256m' + + // listen to events in the test execution lifecycle + beforeTest { descriptor -> + logger.lifecycle("Running test: " + descriptor) + } + + // listen to standard out and standard error of the test JVM(s) + onOutput { descriptor, event -> + logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message ) + } + + ignoreFailures = true //use this to allow build to continue for CI purposes + useTestNG(){ + suites "src/test/resources/test/forgon/AllTests.xml" //pick up centralized xml suite for each sub project + } + //useTestNG() { + // runlist to executed. path is relative to current folder + //suites 'src/test/java/test/forgon/AllTests.xml' + //} + } configurations { all*.transitive = false @@ -249,7 +273,7 @@ compile 'net.sourceforge.jexcelapi:jxl:2.6.12' - compile group: 'taglibs', name: 'standard', version:'1.1.2' + //compile group: 'taglibs', name: 'standard', version:'1.1.2' compile group: 'informa', name: 'informa', version:'0.6.0'