javaExecHandleBuilder.setSystemProperties(testTask.getSystemProperties()); javaExecHandleBuilder.setEnvironment(testTask.getEnvironment());
private void includeSourcesForTest(Project project) { JavaPluginConvention javaConvention = project.getConvention().getPlugin(JavaPluginConvention.class); SourceSet mainSourset = javaConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME); SourceSet testSourset = javaConvention.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME); FileCollection testClasspath = project .files(mainSourset.getAllSource().getSrcDirs().toArray()) .plus(project.files(testSourset.getAllSource().getSrcDirs().toArray())) .plus(testSourset.getRuntimeClasspath()); testSourset.setRuntimeClasspath(testClasspath); Test test = project.getTasks().withType(Test.class).getByName("test"); test.getSystemProperties().put("gwt.persistentunitcachedir", project.getBuildDir() + "/putnami/test"); }
private void includeSourcesForTest(Project project) { JavaPluginConvention javaConvention = project.getConvention() .getPlugin(JavaPluginConvention.class); SourceSet mainSourset = javaConvention.getSourceSets() .getByName(SourceSet.MAIN_SOURCE_SET_NAME); SourceSet testSourset = javaConvention.getSourceSets() .getByName(SourceSet.TEST_SOURCE_SET_NAME); FileCollection testClasspath = project.files(mainSourset.getAllSource() .getSrcDirs().toArray()) .plus(project.files(testSourset .getAllSource() .getSrcDirs() .toArray())) .plus(testSourset .getRuntimeClasspath()); testSourset.setRuntimeClasspath(testClasspath); Test test = project.getTasks().withType(Test.class).getByName("test"); test.getSystemProperties() .put("gwt.persistentunitcachedir", project.getBuildDir() + GwtExtension.DIRECTORY + "/test"); }