blob: 7065dc49cb632e708f695f5e515ff406c086cb34 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.5">
<meta name="author" content="2019-08-08 13:15:33 CEST">
<title>N4JS IDE Specification</title>
<link rel="stylesheet" href="styles/spec.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
<!-- ************* docinfo ******************************************************************* -->
<!-- ************* Favicon ************-->
<link rel="icon" href="images/favicon.ico" />
<!-- ************* Back-to-top JQuery ************* -->
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
<link href="styles/prism.min.css" rel="stylesheet" />
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!-- ************* Styles ************* -->
<link rel="stylesheet" type="text/css" href="styles/n4jsspec-adoc.css">
<!-- ****************** NavBar ****************** -->
<div id="menubar">
<div class="banner">
<a href="https://www.eclipse.org/n4js/#"><img id="logo" src="images/n4js-logo.png" alt="Eclipse N4JS"></a>
</div>
<ul>
<li><a href="index.html">Index</a></li>
</ul>
</div>
<!-- ************* docinfo ******************************************************************* -->
<style>
.admonitionblock td.icon .icon-todo:before{content:"\f249";color:#f4ee42}
</style>
</head>
<body class="book toc2 toc-left">
<div id="header">
<h1>N4JS IDE Specification</h1>
<div class="details">
<span id="author" class="author">2019-08-08 13:15:33 CEST</span><br>
<span id="revnumber">version 0.9</span>
</div>
<div id="toc" class="toc2">
<div id="toctitle">Table of Contents</div>
<ul class="sectlevel1">
<li><a href="views.html#sec:Views">1. Views</a>
<ul class="sectlevel2">
<li><a href="views.html#_eclipse-standard-views">1.1. Eclipse Standard Views</a>
<ul class="sectlevel3">
<li><a href="views.html#sec:Project_Explorer_View">1.1.1. Project Explorer</a></li>
<li><a href="views.html#sec:Outline_View">1.1.2. Outline</a></li>
<li><a href="views.html#sec:Problems_View">1.1.3. Problems</a></li>
<li><a href="views.html#sec:Console_View">1.1.4. Console</a></li>
<li><a href="views.html#sec:History_View">1.1.5. History</a></li>
<li><a href="views.html#sec:Error_Log_View">1.1.6. Error Log</a></li>
</ul>
</li>
<li><a href="views.html#_n4js-specific-views">1.2. N4JS Specific Views</a>
<ul class="sectlevel3">
<li><a href="views.html#_test-results">1.2.1. Test Results</a></li>
<li><a href="views.html#_source-graphs">1.2.2. Source Graphs</a></li>
<li><a href="views.html#_api-compare">1.2.3. API Compare</a></li>
<li><a href="views.html#_performance-graphs">1.2.4. Performance Graphs</a></li>
<li><a href="views.html#_source-mapping">1.2.5. Source Mapping</a></li>
<li><a href="views.html#_xpect-view">1.2.6. Xpect View</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="navigation.html#_navigation">2. Navigation</a>
<ul class="sectlevel2">
<li><a href="navigation.html#sec:Outline_Navigation">2.1. Outline</a>
<ul class="sectlevel3">
<li><a href="navigation.html#_quick-outline">2.1.1. Quick Outline</a></li>
<li><a href="navigation.html#_normal-outline">2.1.2. Normal Outline</a></li>
</ul>
</li>
<li><a href="navigation.html#_navigation-commands">2.2. Navigation Commands</a>
<ul class="sectlevel3">
<li><a href="navigation.html#sec:Navigate_to_Declaration">2.2.1. Navigate to Declaration</a></li>
<li><a href="navigation.html#sec:find_by_references">2.2.2. Find by References</a></li>
<li><a href="navigation.html#sec:Open_Type_Declaration">2.2.3. Open Type Declaration</a></li>
</ul>
</li>
<li><a href="navigation.html#sec:Working_Sets">2.3. Working Sets</a>
<ul class="sectlevel3">
<li><a href="navigation.html#sec:Working_Set_Managers">2.3.1. Working Set Managers</a></li>
<li><a href="navigation.html#sec:Working_Set_Constraints">2.3.2. Working Set Constraints</a></li>
<li><a href="navigation.html#sec:Manual_Association_Working_Set_Manager_UI_Features">2.3.3. Manual Association Working Set Manager - UI Features</a></li>
<li><a href="navigation.html#sec:Project_Name_Filter_Working_Set_Manager">2.3.4. Project Name Filter Working Set Manager</a></li>
<li><a href="navigation.html#sec:Git_Repository_Working_Set_Manager">2.3.5. Git Repository Working Set Manager</a></li>
<li><a href="navigation.html#sec:Project_Location_Working_Set_Manager">2.3.6. Project Location Working Set Manager</a></li>
<li><a href="navigation.html#sec:N4JS_Project_Type_Working_Set_Manager">2.3.7. N4JS Project Type Working Set Manager</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="assistance.html#_assistance">3. Assistance</a>
<ul class="sectlevel2">
<li><a href="assistance.html#sec:Content_Assist">3.1. Content Assist</a>
<ul class="sectlevel3">
<li><a href="assistance.html#sec:Complete_Keywords">3.1.1. Complete Keywords</a></li>
<li><a href="assistance.html#sec:Complete_Annotations">3.1.2. Complete Annotations</a></li>
<li><a href="assistance.html#sec:Complete_Identifier_Reference">3.1.3. Complete Identifier Reference</a></li>
<li><a href="assistance.html#sec:Complete_Member_Overrides">3.1.4. Complete Member Overrides</a></li>
<li><a href="assistance.html#sec:Constructor_Completion">3.1.5. Constructor Completion</a></li>
<li><a href="assistance.html#sec:Complete_Function_Expression">3.1.6. Complete Function Expression with Known Type</a></li>
<li><a href="assistance.html#sec:Complete_Variable_and_Parameter_Names">3.1.7. Complete Variable and Parameter Names</a></li>
</ul>
</li>
<li><a href="assistance.html#sec:Quick_Fixes">3.2. Quick Fixes</a>
<ul class="sectlevel3">
<li><a href="assistance.html#sec:N4JS_Issue_Properties">3.2.1. N4JS Issue User data</a></li>
<li><a href="assistance.html#sec:N4JS_Issue_Fixes">3.2.2. N4JS Issue Fixes</a>
<ul class="sectlevel4">
<li><a href="assistance.html#sec:Linking_Issues">3.2.2.1. Linking Issues</a></li>
<li><a href="assistance.html#sec:Import_Issues">3.2.2.2. Import Issues</a></li>
<li><a href="assistance.html#sec:Visibility_Issues">3.2.2.3. Visibility Issues</a></li>
<li><a href="assistance.html#sec:Classifier_Issues">3.2.2.4. Classifier Issues</a></li>
<li><a href="assistance.html#sec:Function_Issues">3.2.2.5. Function Issues</a></li>
<li><a href="assistance.html#sec:Syntax_Issues">3.2.2.6. Syntax Issues</a></li>
<li><a href="assistance.html#sec:Conversion_Issues">3.2.2.7. Conversion Issues</a></li>
<li><a href="assistance.html#sec:Type_Issues">3.2.2.8. Type Issues</a></li>
<li><a href="assistance.html#sec:Expression_Issues">3.2.2.9. Expression Issues</a></li>
<li><a href="assistance.html#sec:Super_Keyword_Issues">3.2.2.10. Super Keyword Issues</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="assistance.html#sec:Quick_Assist">3.3. Quick Assist</a></li>
<li><a href="assistance.html#sec:Cleanup_Operations">3.4. Cleanup Operations</a>
<ul class="sectlevel3">
<li><a href="assistance.html#sec:Formatting">3.4.1. Formatting</a></li>
<li><a href="assistance.html#sec:Organize_Imports">3.4.2. Organize Imports</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="wizards.html#_wizards">4. Wizards</a>
<ul class="sectlevel2">
<li><a href="wizards.html#sec:N4JS_Project_Wizard">4.1. N4JS Project Wizard</a></li>
<li><a href="wizards.html#sec:Empty_N4JS_File">4.2. Empty N4JS File</a></li>
<li><a href="wizards.html#sec:Empty_JS_File">4.3. Empty JS File</a>
<ul class="sectlevel3">
<li><a href="wizards.html#sec:N4JS_Class_File_Wizard">4.3.1. N4JS Class Wizard</a></li>
<li><a href="wizards.html#field-properties">4.3.2. Field Properties</a></li>
<li><a href="wizards.html#visibility-issues-or-final-super-classes">4.3.3. Visibility issues or <code>@Final</code> super classes</a></li>
<li><a href="wizards.html#generation-1">4.3.4. Generation</a></li>
<li><a href="wizards.html#preview-1">4.3.5. Preview</a></li>
</ul>
</li>
<li><a href="wizards.html#sec:N4JS_Interface_Wizard">4.4. Interface Wizard</a>
<ul class="sectlevel3">
<li><a href="wizards.html#field-properties-1">4.4.1. Field Properties</a></li>
<li><a href="wizards.html#visibility-issues">4.4.2. Visibility Issues</a></li>
<li><a href="wizards.html#import-naming-conflicts">4.4.3. Import naming conflicts</a></li>
<li><a href="wizards.html#generation-2">4.4.4. Generation</a></li>
<li><a href="wizards.html#preview-2">4.4.5. Preview</a></li>
</ul>
</li>
<li><a href="wizards.html#sec:N4JS_Enum_File_Wizard">4.5. Enum Wizard</a>
<ul class="sectlevel3">
<li><a href="wizards.html#field-properties-2">4.5.1. Field Properties</a></li>
<li><a href="wizards.html#generation-3">4.5.2. Generation</a></li>
<li><a href="wizards.html#preview-3">4.5.3. Preview</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="execution_support.html#_execution-support">5. Execution Support</a>
<ul class="sectlevel2">
<li><a href="execution_support.html#sec:Non_UI_Execution">5.1. Non-UI Execution</a>
<ul class="sectlevel3">
<li><a href="execution_support.html#sec:Non_UI_Debugging">5.1.1. Non-UI Debugging</a></li>
</ul>
</li>
<li><a href="execution_support.html#sec:UI_Execution">5.2. UI Execution</a></li>
</ul>
</li>
<li><a href="test_support.html#_test-support">6. Test Support</a>
<ul class="sectlevel2">
<li><a href="test_support.html#sec:N4JS_Mangelhaft_support">6.1. N4JS Mangelhaft support</a>
<ul class="sectlevel3">
<li><a href="test_support.html#sec:Asynchronous_Tests">6.1.1. Asynchronous Tests, Test Isolation and Timeouts</a></li>
<li><a href="test_support.html#sec:Supported_xUnit_API">6.1.2. Supported xUnit API</a>
<ul class="sectlevel4">
<li><a href="test_support.html#sec:Test_Group">6.1.2.1. Test Group</a></li>
<li><a href="test_support.html#sec:Test_Method">6.1.2.2. Test Method</a></li>
<li><a href="test_support.html#sec:BeforeAll">6.1.2.3. BeforeAll Setup</a></li>
<li><a href="test_support.html#sec:Before_Setup">6.1.2.4. Before Setup</a></li>
<li><a href="test_support.html#sec:After_Teardown">6.1.2.5. After Teardown</a></li>
<li><a href="test_support.html#sec:AfterAll_Teardown">6.1.2.6. AfterAll Teardown</a></li>
<li><a href="test_support.html#sec:Test_Ignore">6.1.2.7. Test Ignore</a></li>
<li><a href="test_support.html#sec:Timeout">6.1.2.8. Timeout</a></li>
<li><a href="test_support.html#sec:Description">6.1.2.9. Description</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="test_support.html#sec:Test_Reporting">6.2. Test Reporting</a>
<ul class="sectlevel3">
<li><a href="test_support.html#sec:Test_Messages">6.2.1. Test Messages</a>
<ul class="sectlevel4">
<li><a href="test_support.html#_test-case-ids">6.2.1.1. Test Case IDs</a></li>
<li><a href="test_support.html#sec:Start_Session">6.2.1.2. Start Session</a></li>
<li><a href="test_support.html#sec:Ping_Session">6.2.1.3. Ping Session</a></li>
<li><a href="test_support.html#sec:End_Session">6.2.1.4. End Session</a></li>
<li><a href="test_support.html#sec:Start_Test">6.2.1.5. Start Test</a></li>
<li><a href="test_support.html#sec:End_Test">6.2.1.6. End Test</a></li>
<li><a href="test_support.html#sec:Ping_Test">6.2.1.7. Ping Test</a></li>
<li><a href="test_support.html#sec:Test_Catalog">6.2.1.8. Test Catalog</a></li>
<li><a href="test_support.html#sec:Test_Session_Example">6.2.1.9. Test Session Example</a></li>
</ul>
</li>
<li><a href="test_support.html#sec:Test_Runtime_Configuration">6.2.2. Test Runtime Configuration</a></li>
<li><a href="test_support.html#sec:Test_Plan">6.2.3. Test Plan</a></li>
<li><a href="test_support.html#sec:Test_Environment_Configuration">6.2.4. Test Environment Configuration</a></li>
<li><a href="test_support.html#sec:Test_Environment_Configuration_Example">6.2.5. Test Environment Configuration Example</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="help_system.html#_help-system">7. Help System</a>
<ul class="sectlevel2">
<li><a href="help_system.html#sec:Built_In_Help">7.1. Built-In Help</a></li>
<li><a href="help_system.html#sec:Context_Sensitive_Help">7.2. Context Sensitive Help</a></li>
<li><a href="help_system.html#sec:Cheat_Sheets">7.3. Cheat Sheets</a></li>
<li><a href="help_system.html#sec:JSDoc">7.4. JSDoc</a></li>
<li><a href="help_system.html#sec:Hovering">7.5. Hovering</a>
<ul class="sectlevel3">
<li><a href="help_system.html#sec:Show_Type_Information_of_Selection">7.5.1. Show Type Information of Selection</a></li>
</ul>
</li>
<li><a href="help_system.html#sec:Example_Projects_and_Files">7.6. Example Projects and Files</a></li>
</ul>
</li>
<li><a href="bug_management.html#_bug-management">8. Bug Management</a>
<ul class="sectlevel2">
<li><a href="bug_management.html#sec:Built_In_Xpect_Support">8.1. Built-In Xpect Support</a>
<ul class="sectlevel3">
<li><a href="bug_management.html#sec:Report_View">8.1.1. Report View</a></li>
<li><a href="bug_management.html#sec:Generate_Bug_Report">8.1.2. Generate Bug Report</a></li>
<li><a href="bug_management.html#sec:Supported_Xpect_Tests">8.1.3. Supported Xpect Tests</a>
<ul class="sectlevel4">
<li><a href="bug_management.html#sec:XPECT_N4JS_Errors">8.1.3.1. Errors, Warnings, Infos, Issues</a></li>
<li><a href="bug_management.html#sec:XPECT_N4JS_Noerrors">8.1.3.2. Noerrors</a></li>
<li><a href="bug_management.html#sec:XPECT_N4JS_Output">8.1.3.3. Output, OutputRegex</a></li>
<li><a href="bug_management.html#sec:XPECT_N4JS_Type_Of">8.1.3.4. Type Of</a></li>
<li><a href="bug_management.html#sec:XPECT_Advanced_Methods">8.1.3.5. Advanced methods</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#_cli">9. CLI</a>
<ul class="sectlevel2">
<li><a href="#sec:Headless_Compiler">9.1. Headless Compiler</a></li>
<li><a href="#sec:Headless_Dependencies">9.2. Headless Dependnecies</a></li>
<li><a href="#sec:Headless_Execution">9.3. Headless Execution</a>
<ul class="sectlevel3">
<li><a href="#sec:Cleaning_Headlessly">9.3.1. Cleaning Headlessly</a></li>
<li><a href="#sec:Running_Headlessly">9.3.2. Running Headlessly</a></li>
<li><a href="#sec:Information_about_running_headlessly">9.3.3. Information about running headlessly</a></li>
<li><a href="#sec:Testing_Headlessly">9.3.4. Testing Headlessly</a></li>
<li><a href="#sec:Information_about_testing_headlessly">9.3.5. Information about testing headlessly</a></li>
<li><a href="#_testresults">9.3.6. TestResults</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="appendix_a_license.html#sec:License">Appendix A: License</a></li>
<li><a href="appendix_b_acronyms.html#sec:Acronyms">Appendix B: Acronyms</a></li>
<li><a href="appendix_c_bibliography.html#_bibliography">Appendix C: Bibliography</a></li>
</ul>
</div>
</div>
<div id="content"><div class="sect1">
<h2 id="_cli"><a class="anchor" href="#_cli"></a><a class="link" href="#_cli">9. CLI</a></h2>
<div class="sectionbody">
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title=""></i>
</td>
<td class="content">
Parts of this document may be outdated.
</td>
</tr>
</table>
</div>
<div class="sect2 language-bash">
<h3 id="sec:Headless_Compiler"><a class="anchor" href="#sec:Headless_Compiler"></a><a class="link" href="#sec:Headless_Compiler">9.1. Headless Compiler</a></h3>
<div class="paragraph">
<p>The headless compiler is provided as a separate tool, coming as a single jar file <code>n4jsc.jar</code>. It is to be invoked via</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar n4jsc.jar</code></pre>
</div>
</div>
<div class="paragraph">
<p>Simply invoking the headless compiler with no further arguments will print out a description of command line options.</p>
</div>
<div class="paragraph">
<p>The headless compiler works in three major modes (given as arguments to the switch <code>-bt</code>):</p>
</div>
<div class="ulist">
<ul>
<li>
<p>compilation of single files (<code>-bt singlefile</code>, <em>default</em>),</p>
</li>
<li>
<p>compilation of given projects (<code>-bt projects</code>) or</p>
</li>
<li>
<p>compilation of all projects (<code>-bt allprojects</code>)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The command-line invocation usually has the form of</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar n4jsc.jar ^$[options]$^ file1 file2 ...</code></pre>
</div>
</div>
<div class="paragraph">
<p>Standard compiler <em>options</em>:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--buildType</code> , <code>-bt</code> <em>mode</em></dt>
<dd>
<p>With <em>mode</em> as exactly one of</p>
<div class="dlist">
<dl>
<dt class="hdlist1">singlefile</dt>
<dd>
<p>only the source files given by <em>file1</em>, <em>file2</em>, &#8230;&#8203; are compiled.</p>
</dd>
<dt class="hdlist1">projects</dt>
<dd>
<p><em>file1</em>, <em>file2</em>, &#8230;&#8203; denote projects (folders containing a <code>manifest.n4mf</code>). These projects will be compiled.</p>
</dd>
<dt class="hdlist1">allprojects</dt>
<dd>
<p>All project found under the project-root(s) are compiled. There should be no <em>file&#8230;&#8203;</em> given.</p>
</dd>
<dt class="hdlist1">dontcompile</dt>
<dd>
<p>Nothing will be compiled. There should be no <em>file&#8230;&#8203;</em> given. (This is the default if no <code>-t</code> option is given).</p>
</dd>
</dl>
</div>
</dd>
<dt class="hdlist1"><code>--projectlocations</code> (<code>-pl</code>) <code>path</code></dt>
<dd>
<p><a id="opt-projectlocations"></a> provide folder(s) to search for projects. If not set, the base folder of the running JVM will be taken as the location. Multiple folders are separated by the systems path-separator (’<code>:</code>’ on Mac / Unix and ’<code>;</code>’ on Windows). Only direct subfolders will be queried for projects. A subfolder is assumed to be a N4JS-project if it contains a <code>manifest.n4mf</code> file. All found projects are taken into consideration for dependency-resolution. Example on Linux:<br>
<code>-pl  /rootA/: /rootB:/some/absolute/path/to/projects</code>.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Advanced compiler options (optional):</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--notests</code></dt>
<dd>
<p>turn off compilation of code in test-folders. Can not be combined with <code>–testonly</code></p>
</dd>
<dt class="hdlist1"><code>--testonly</code></dt>
<dd>
<p>only compile test code. Externals and sources will not be compiled. Can not be combined with <code>–notests</code></p>
</dd>
<dt class="hdlist1"><code>--keepCompiling</code></dt>
<dd>
<p>try to compile even if some errors occur.</p>
</dd>
<dt class="hdlist1"><code>--preference</code> <em>file</em></dt>
<dd>
<p>uses <em>file</em> as there internal preferences-store similar to the preferences internally stored by the N4IDE.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Additional command line options (optional):</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--help</code> , <code>-h</code> </dt>
<dd>
<p>prints out help to the console and exits.</p>
</dd>
<dt class="hdlist1"><code>--verbose</code> , <code>-v</code></dt>
<dd>
<p>verbose output during build</p>
</dd>
<dt class="hdlist1"><code>--debug</code> </dt>
<dd>
<p>before executing, summarises the information of the current setup like resolved pathnames and other information, carries on with normal workflow and prints additional status information about loading and unloading projects and processing each resource.</p>
</dd>
<dt class="hdlist1"><code>--log</code></dt>
<dd>
<p>write a log file <code>n4jsc.log</code> to the base folder. (Change filename with <code>–logfile filename</code>)</p>
</dd>
</dl>
</div>
</div>
<div class="sect2 language-bash">
<h3 id="sec:Headless_Dependencies"><a class="anchor" href="#sec:Headless_Dependencies"></a><a class="link" href="#sec:Headless_Dependencies">9.2. Headless Dependnecies</a></h3>
<div class="paragraph">
<p>Compiler can manage dependencies of the processed projects:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--installMissingDependencies</code> , <code>-imd</code> </dt>
<dd>
<p>alnalyzes available projects and installs missing dependencies</p>
</dd>
<dt class="hdlist1"><code>--targetPlatformInstallLocation</code> , <code>-tl</code></dt>
<dd>
<p>location to which dependencies will be installed, if not provided temporal location will be used</p>
</dd>
<dt class="hdlist1"><code>--npmrcRootLocation</code></dt>
<dd>
<p>location of the <em>.npmrc</em> file to be used in <em>npm</em> invocations</p>
</dd>
</dl>
</div>
</div>
<div class="sect2 language-bash">
<h3 id="sec:Headless_Execution"><a class="anchor" href="#sec:Headless_Execution"></a><a class="link" href="#sec:Headless_Execution">9.3. Headless Execution</a></h3>
<div class="paragraph">
<p>For headless compiling, running and testing of N4JS code a general command line tool is provided. Many parameters of the different use cases are shared. Although you can combine the use cases each of them is described in its own section. This section is about running compiled code.</p>
</div>
<div class="paragraph">
<p>For compiling refer to <a href="#sec:Headless_Compiler">Headless Compiler</a> for executing tests refer to <a href="#_test_support">Tests</a>.</p>
</div>
<div class="sect3">
<h4 id="sec:Cleaning_Headlessly"><a class="anchor" href="#sec:Cleaning_Headlessly"></a><a class="link" href="#sec:Cleaning_Headlessly">9.3.1. Cleaning Headlessly</a></h4>
<div class="paragraph">
<p>It is possible to use the headless compiler to clean projects by using the following option</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--clean</code> (<code>-c</code>)</dt>
<dd>
<p>When this option is used. The headless compiler only cleans projects without compilation. Moreover, the use of this option requires that the option <code>-t</code> must be specified and must be either <code>-t projects</code> or <code>-t allprojects</code>.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>For instance, <code>n4jsc --clean -t allprojects -pl path/to/project</code> or <code>n4jsc --clean -t projects project1 project2</code> are valid use while <code>n4jsc --clean -t singlefile file1 file2</code> is invalid.
After the calling the command with <code>--clean (</code>-c`), the output folders of the specified projects (e.g. <code>src-gen</code> folders) are cleaned.</p>
</div>
</div>
<div class="sect3">
<h4 id="sec:Running_Headlessly"><a class="anchor" href="#sec:Running_Headlessly"></a><a class="link" href="#sec:Running_Headlessly">9.3.2. Running Headlessly</a></h4>
<div class="paragraph">
<p>Running code from the command line requires basically three different pieces of information:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The locations where projects, libraries and environments can be found must be given.</p>
</li>
<li>
<p>The starting point of execution must be given by pointing to a module.</p>
</li>
<li>
<p>Since there are multiple different project types, an adequate Runner has to be selected.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The follwing command line switches are used to provide this information:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--projectlocations</code> (<code>-pl</code>) <code>path</code></dt>
<dd>
<p>path of locations to search for projects (c.f. <a href="#sec:Headless_Compiler">Headless Compiler</a> ,<a href="#opt-projectlocations">Project Locations</a>)</p>
</dd>
<dt class="hdlist1"><code>--runWith</code> (<code>-rw</code>) <code>VAL</code></dt>
<dd>
<p>denotes the runner-id (as listed with --list-runners) or at least the last segment of it</p>
</dd>
<dt class="hdlist1"><code>--run</code> (<code>-r</code>) <code>FILE</code></dt>
<dd>
<p>source-module to run. Note you should point to the full location of the source file (*.n4js). The runner is <em>responsible to determine the compiled file</em>. It is not sufficient to give a project-relative path, it always needs to be a full path to the source file.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>It is possible to compile and run with a single CLI line. Compilation always precedes the execution. It the compilation fails the runner will not be started.</p>
</div>
<div class="paragraph">
<p>To ease the usage of different runners it is allowed to provide the last segment(s) of the runner-id in a case-insensitive way, e.g. one can use the runner with id <code>org.eclipse.n4js.runner.nodejs.NODEJS</code> as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --runWith org.eclipse.n4js.runner.nodejs.NODEJS ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>or in short</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --rw NODEJS ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>or even lower-cased with</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --rw nodejs ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>Assume having a common workspace location ’wsp’ with a project ’P1’ containing the module ’A’. The following line shows how to run this code:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar n4jsc.jar -pl wsp -rw nodejs -r wsp/P1/src/A.n4js</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="sec:Information_about_running_headlessly"><a class="anchor" href="#sec:Information_about_running_headlessly"></a><a class="link" href="#sec:Information_about_running_headlessly">9.3.3. Information about running headlessly</a></h4>
<div class="paragraph">
<p>Available runner-ids can be actively queried:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--listRunners</code> (<code>-lr</code>)</dt>
<dd>
<p>prints out a list of all available command-line runners</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<h4 id="sec:Testing_Headlessly"><a class="anchor" href="#sec:Testing_Headlessly"></a><a class="link" href="#sec:Testing_Headlessly">9.3.4. Testing Headlessly</a></h4>
<div class="paragraph">
<p>Testing code from the command line requires basically three different pieces of information:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>The locations where projects, libraries and environments can be found must be given.</p>
</li>
<li>
<p>The starting point of test execution must be given by pointing to what is supposed to be tested (single file / whole project)/</p>
</li>
<li>
<p>Since there are multiple different project types, an adequate Tester has to be selected.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>The follwing command line switches are used to provide this information:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--projectlocations</code> (<code>-pl</code>) <code>path</code></dt>
<dd>
<p>path of locations to search for projects (c.f. <a href="#sec:Headless_Compiler">Headless Compiler</a> ,<a href="#opt-projectlocations">Project Locations</a>)</p>
</dd>
<dt class="hdlist1"><code>--testWith</code> (<code>-tw</code>) <code>VAL</code></dt>
<dd>
<p>denotes the tester-id (as listed with --list-testers) or at least the last segment of it</p>
</dd>
<dt class="hdlist1"><code>--test</code> (<code>-t</code>) <code>FILE</code></dt>
<dd>
<p>source-module to run. Note you should point to the full location of the project with tests, specific folder inside project with tests or the test source file (*.n4js). It is not sufficient to give a project-relative path, it always needs to be a full path to the source file.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>It is possible to compile and run with a single CLI line. Compilation always precedes the execution. It the compilation fails the tester will not be started.</p>
</div>
<div class="paragraph">
<p>To ease the usage of different testers it is allowed to provide the last segment(s) of the tester-id in a case-insensitive way, e.g. one can use the runner with id <code>org.eclipse.n4js.tester.nodejs.NODEJS_MANGELHAFT</code> as follows:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --runWith org.eclipse.n4js.tester.nodejs.NODEJS_MANGELHAFT ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>or in short</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --rw NODEJS_MANGELHAFT ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>or even lower-cased with</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">.. --rw nodejs_mangelhaft ..</code></pre>
</div>
</div>
<div class="paragraph">
<p>Assume having a common workspace location ’wsp’ with a project ’P1’ containing the module ’TestA’. The following line shows how to execute this test code:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">java -jar n4jsc.jar -pl wsp -tw nodejs_mangelhaft -t wsp/P1/src/TestA.n4js</code></pre>
</div>
</div>
</div>
<div class="sect3">
<h4 id="sec:Information_about_testing_headlessly"><a class="anchor" href="#sec:Information_about_testing_headlessly"></a><a class="link" href="#sec:Information_about_testing_headlessly">9.3.5. Information about testing headlessly</a></h4>
<div class="paragraph">
<p>Available tester-ids can be actively queried:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><code>--listTesters</code> (<code>-lt</code>)</dt>
<dd>
<p>prints out a list of all available command-line testers</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<h4 id="_testresults"><a class="anchor" href="#_testresults"></a><a class="link" href="#_testresults">9.3.6. TestResults</a></h4>
<div class="paragraph">
<p>TODO</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Version 0.9<br>
Last updated 2019-08-08 13:15:33 CEST
</div>
</div>
<!-- ************* docinfo-footer *************************************************************** -->
<div class="Grid social" style="color:#d5dfea">
<div class="Cell Cell--2-12 m-Cell--withMargin">
<h2>Quick Links</h2>
<ul>
<li><a href="../downloads.html">Download</a></li>
<li><a href="../userguides/index.html">Documentation</a></li>
<li><a href="https://github.com/eclipse/n4js/">Source</a></li>
<li><a href="https://github.com/eclipse/n4js/issues">Issues</a></li>
</ul>
</div>
<div class="Cell Cell--2-12 m-Cell--withMargin">
<br/><br/>
<ul>
<li><a href="https://www.eclipse.org/forums/index.php/f/365/">Forum</a></li>
<li><a href="http://n4js.blogspot.de/">Blog</a></li>
<li><a href="https://dev.eclipse.org/mailman/listinfo/n4js-dev">Mailing List</a></li>
<li><a href="https://projects.eclipse.org/projects/technology.n4js">Eclipse Project Page</a></li>
<li><a href="https://twitter.com/n4jsdev">Tweets by n4jsdev</a></li>
</ul>
</div>
<div class="Cell Cell--2-12 m-Cell--withMargin">
<br/><br/>
<ul>
<li><a href="http://www.eclipse.org/">Eclipse Home</a></li>
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/legal/">Legal</a></li>
</ul>
</div>
<div style="clear: both; height: 0; overflow: hidden;"></div>
</div>
<!-- ************* UI Scripts ************* -->
<script type="text/javascript" src="scripts/back-to-top.js"></script>
<script type="text/javascript" src="scripts/treeview.js"></script>
<script type="text/javascript" src="scripts/toc.js"></script>
<!-- ************* Prism.js Syntax Highlighting ************* -->
<script src="scripts/prism.js"></script>
<script type="text/javascript">
// Add the 'toclist' id for search function
$(".toc2 > ul").attr('id', 'toclist');
// Generate a Search input form
$("#toclist > li:first-of-type").before('<input type="text" id="pagesearch" onkeyup="search()" placeholder="Search for section...">');
$("#toclist > li:first-of-type").before('<i id="clear" class="fa fa-times-circle-o"></i>');
$("#clear").click(function(){
$("#pagesearch").val('');
search();
$('.toc2 > ul').treeView('collapseAll');
});
// intialize Treeview.js
$(".toc2 > ul").treeView();
// Initialize Scrollspy
</script>
<!-- ************* docinfo-footer *************************************************************** -->
</body>
</html>