...
 
Commits (3)
...@@ -52,23 +52,25 @@ tasks.withType(Test) { ...@@ -52,23 +52,25 @@ tasks.withType(Test) {
} }
// Copy Braille tables from submodule to working dir // Copy Braille tables from submodule to working dir
task copyBrailleTables(type: Copy) { def brailleTablesCopySpec = copySpec {
from "$projectDir/third_party/liblouis/tables/" from "$projectDir/third_party/liblouis/tables/"
into "$rootDir/src/main/resources/mapping/liblouis"
//from "$projectDir/third_party/liblouis/tables/"
//into "$rootDir/src/test/resources/mapping/liblouis"
} }
// Same for integrationtests task copyBrailleTables(type: Copy) {
with brailleTablesCopySpec
into "$projectDir/src/main/resources/mapping/liblouis"
}
task copyBrailleTablesTest(type: Copy) {
with brailleTablesCopySpec
into "$projectDir/src/test/resources/mapping/liblouis"
}
task copyBrailleTablesIntegrationTest(type: Copy) { task copyBrailleTablesIntegrationTest(type: Copy) {
with brailleTablesCopySpec
from "$projectDir/third_party/liblouis/tables/" into "$projectDir/src/integrationTest/resources/mapping/liblouis"
into "$rootDir/src/integrationTest/resources/mapping/liblouis"
} }
processResources.dependsOn copyBrailleTables
processResources.dependsOn copyBrailleTablesTest
processResources.dependsOn copyBrailleTablesIntegrationTest
// Abort if files are missing // Abort if files are missing
gradle.taskGraph.afterTask { copyBrailleTables -> gradle.taskGraph.afterTask { copyBrailleTables ->
if(copyBrailleTables.state.noSource){ if(copyBrailleTables.state.noSource){
...@@ -77,18 +79,30 @@ gradle.taskGraph.afterTask { copyBrailleTables -> ...@@ -77,18 +79,30 @@ gradle.taskGraph.afterTask { copyBrailleTables ->
} }
// Delete tables on "clean" task // Delete tables on "clean" task
clean { clean {
delete "$rootDir/src/main/resources/mapping/liblouis" delete "$projectDir/src/main/resources/mapping/liblouis"
delete "$rootDir/src/integrationTest/resources/mapping/liblouis" delete "$projectDir/src/test/resources/mapping/liblouis"
delete "$rootDir/src/test/resources/mapping/liblouis" delete "$projectDir/src/integrationTest/resources/mapping/liblouis"
} }
// Copy native liblouis libraries for major platforms to the resource folder // Copy native liblouis libraries for major platforms to the resource folder
task copyLibLouisBinary(type: Copy) { def liblouisBinaryCopySpec = copySpec {
from "$projectDir/third_party/liblouis_bin/bin/" from "$projectDir/third_party/liblouis_bin/bin/"
into "$rootDir/src/main/resources/native/liblouis" }
task copyLibLouisBinary(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/main/resources/native/liblouis"
}
task copyLibLouisBinaryTest(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/test/resources/native/liblouis"
}
task copyLibLouisBinaryIntegrationTest(type: Copy) {
with liblouisBinaryCopySpec
into "$projectDir/src/integrationTest/resources/native/liblouis"
} }
processResources.dependsOn copyLibLouisBinary processResources.dependsOn copyLibLouisBinary
processResources.dependsOn copyLibLouisBinaryTest
processResources.dependsOn copyLibLouisBinaryIntegrationTest
// Abort if files are missing // Abort if files are missing
gradle.taskGraph.afterTask { copyLibLouisBinary -> gradle.taskGraph.afterTask { copyLibLouisBinary ->
if(copyLibLouisBinary.state.noSource){ if(copyLibLouisBinary.state.noSource){
...@@ -97,11 +111,11 @@ gradle.taskGraph.afterTask { copyLibLouisBinary -> ...@@ -97,11 +111,11 @@ gradle.taskGraph.afterTask { copyLibLouisBinary ->
} }
// Delete libraries on "clean" task // Delete libraries on "clean" task
clean { clean {
delete "$rootDir/src/main/resources/native/liblouis" delete "$projectDir/src/main/resources/native/liblouis"
delete "$projectDir/src/test/resources/native/liblouis"
delete "$projectDir/src/integrationTest/resources/native/liblouis"
} }
//processResources.dependsOn copyBrailleTables
// Define the main class for the application // Define the main class for the application
mainClassName = 'de.tudresden.inf.mci.brailleplot.App' mainClassName = 'de.tudresden.inf.mci.brailleplot.App'
...@@ -121,7 +135,5 @@ checkstyleTest { ...@@ -121,7 +135,5 @@ checkstyleTest {
} }
// Needed for Integrationtests // Needed for integration tests
apply from: "$rootDir/integrationTest.gradle" apply from: "$rootDir/integrationTest.gradle"
integrationTest.dependsOn copyBrailleTablesIntegrationTest
sourceSets { sourceSets {
integrationTest { integrationTest {
java.srcDir 'src/integrationTest' java.srcDir 'src/integrationTest/java'
resources.srcDir 'src/integrationTest/resources' resources.srcDir 'src/integrationTest/resources'
compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath compileClasspath += sourceSets.main.output + configurations.testRuntimeClasspath
runtimeClasspath += output + compileClasspath runtimeClasspath += output + compileClasspath
} }
} }
task integrationTest(type: Test) { task integrationTest(type: Test) {
...@@ -15,4 +14,4 @@ task integrationTest(type: Test) { ...@@ -15,4 +14,4 @@ task integrationTest(type: Test) {
classpath = sourceSets.integrationTest.runtimeClasspath classpath = sourceSets.integrationTest.runtimeClasspath
mustRunAfter test mustRunAfter test
checkstyleIntegrationTest.enabled = false checkstyleIntegrationTest.enabled = false
} }
\ No newline at end of file
...@@ -23,7 +23,9 @@ public class AppTest { ...@@ -23,7 +23,9 @@ public class AppTest {
@Test @Test
public void smokeTest() { public void smokeTest() {
LiblouisBrailleTextRasterizer.initModule(); LiblouisBrailleTextRasterizer.initModule();
Assertions.assertEquals(0, mApp.run(new String[]{"-p", "src/test/resources/config/dummyprinter.properties", Assertions.assertEquals(0, mApp.run(new String[]{
"-i",
"-p", "src/test/resources/config/dummyprinter.properties",
"-c", "src/test/resources/examples_csv/2_line_chart.csv", "-c", "src/test/resources/examples_csv/2_line_chart.csv",
"-d", "LineChart", "-d", "LineChart",
"-t", "title", "-t", "title",
......