builder.buildTestCases();
builder.outputTestCases();
}
private void outputTestCases() {
SimpleFileWriter writer = new SimpleFileWriter();
for (Entry<String, List<TestCase>> couple : testCases.entrySet()) {
String kind = couple.getKey();
String content = "";
List<TestCase> tests = couple.getValue();
for (TestCase testCase : tests) {
content += "/* " + testCase.getName() + " */\n";
content += toMediaQuery(kind, testCase.getTestCase());
}
try {
String outputDirectory = getCurrentDirectory() + OUTPUT_DIRECTORY;
ensureDirectory(outputDirectory);
writer.write(outputDirectory + kind + ".less", content);
} catch (IOException e) {
throw new IllegalStateException(e);
}
System.out.println(content);
}