use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4JSXTest method testOnlyN4JSX.
/**
* Compile a single n4jsx file without any n4js files in the workspace.
*/
@Test
public void testOnlyN4JSX() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
String react = wsRoot + "/react";
String p1Root = wsRoot + "/" + "P1";
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "projects", p1Root, react);
assertFilesCompiledToES(1, p1Root);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class N4JSXTest method testCombinedWithN4JS_singleFile.
/**
* Same as {@link #testCombinedWithN4JS()}, but the files are compiled individually using 'singlefile' mode.
*/
@Test
public void testCombinedWithN4JS_singleFile() throws ExitCodeException {
final String wsRoot = workspace.getAbsolutePath().toString();
String p2Root = wsRoot + "/" + "P2";
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "singlefile", p2Root + "/src/foo.n4js");
assertFilesCompiledToES(1, p2Root);
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "singlefile", p2Root + "/src/bar.n4jsx");
assertFilesCompiledToES(2, p2Root);
new N4jscBase().doMain("--projectlocations", wsRoot, "--buildType", "singlefile", p2Root + "/src/bar2.n4jsx");
assertFilesCompiledToES(3, p2Root);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class AT_IDEBUG_532_transpilecrashTest method testCompileOfExtendedIterator_from_RuntimeLibrary.
/**
* The Problem was, that nothing was compiled.
*/
@Test
public void testCompileOfExtendedIterator_from_RuntimeLibrary() throws ExitCodeException {
String proot = workspace.getAbsolutePath().toString();
String[] args = { "--projectlocations", proot, "--buildType", "allprojects", "--verbose" };
// compile
new N4jscBase().doMain(args);
// Make sure, we get here and have exactly one file compiled:
assertFilesCompiledToES(1, proot);
}
use of org.eclipse.n4js.hlc.base.N4jscBase in project n4js by eclipse.
the class UpdateShippedCode method cleanAndcompile.
private static void cleanAndcompile(File... foldersContainingProjectFolders) {
final String foldersContainingProjectsStr = Stream.of(foldersContainingProjectFolders).map(file -> file.getAbsolutePath()).collect(Collectors.joining(File.pathSeparator));
// Clean all projects first
final String[] cleanArgs = { "--clean", "--buildType", "allprojects", "--projectlocations", foldersContainingProjectsStr };
try {
new N4jscBase().doMain(cleanArgs);
} catch (ExitCodeException e) {
println("ERROR: while cleaning the projects, an ExitCodeException is thrown; " + "code: " + e.getExitCode() + ", " + "message: " + e.getMessage());
e.printStackTrace();
throw new RuntimeException(e);
}
// Then compile the projects
final String[] args = { "--buildType", "allprojects", "--projectlocations", foldersContainingProjectsStr };
try {
new N4jscBase().doMain(args);
} catch (ExitCodeException e) {
println("ERROR: headless compiler threw ExitCodeException (probably code compiled with errors); " + "code: " + e.getExitCode() + ", " + "message: " + e.getMessage());
e.printStackTrace();
throw new RuntimeException(e);
}
}
Aggregations