This commit is contained in:
Basile Burg 2016-12-27 03:21:38 +01:00
parent e3066166a5
commit 38ed00c5ad
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
6 changed files with 62 additions and 8 deletions

View File

@ -9,23 +9,24 @@ Runnable modules don't have to be explicitly saved because Coedit will handle th
For example it's possible to execute the _Compile and run file_ action directly after the _New runnable module_ action .
By default the binary is produced in the folder where is located the D source but this can be changed in the options applied to this feature.
A runnable is useful to quickly test an idea or to use a module as a script without messing with all the parameters that a project would require.
A runnable is useful to quickly test an idea, learn how to use new libraries, or even to use modules as scripts, always without messing with the parameters that a project would require.
#### Shebang line
By default runnables don't need any setting however the shebang line can be used when specific compiler options are required.
Two typical scenario:
- the runnable will be debugged so symbolic debugging information must be generated with `-g`.
- the runnable must be linked with a C static library so linker flags `-L-lthelib` must be specified.
- the runnable will be debugged so DWARF information must be generated with `-g`.
- the runnable must be linked with a C static library so the linker flag `-L-lthelib` must be specified.
Coedit doesn't handle the program specified after the She-Bang, which means that any of the following script line are valid:
Coedit doesn't handle the program specified after the She-Bang, which means that any of the following script lines are valid:
- `#!runnable-flags: --whatever`
- `#!usr/bin/dmd --whatever`
- `#!options --whatever`
In the three cases, every non white character after the She-Bang is ignored.
Options are detected after the first non white character of the script line.
#### Runnable I/O handling
@ -67,8 +68,8 @@ Note that the action _Run file unittest_ is based on the same internal function
![](img/options_runnables.png)
- __alwaysToFolder__: When checked the folder specified in __outputFolder__ is handled, even if the runnable module is not part of the current project.
- __compiler__: Select the [compiler](options_compilers_paths) used to produce the runnable binary.
- __compiler__: Select the [compiler](options_compilers_paths) used to produce the runnable binary. When GDC or LDC is selected their bridges based on DMD command line interface are used (GDMD and LDMD).
- __detectLibraries__: When checked the static libraries used by the runnable are detected from the [library manager](widgets_library_manager) by performing import analysis. When unchecked, all the library manager entries are passed and the compiler does the selection.
- __detectMain__: When checked the `main()` function is detected automatically and the `-main` switch is set accordingly. When not checked `-main` is never passed. This options is useful with the **Run file unittests** action because it allows to test a module that's also a valid program.
- __outputFolder__: Defines a folder where the runnable binary is output. If the runnable is part of the project this folder is used otherwise __alwaysToFolder__ must also be checked. When the folder is a relative path, it is solbed using the runnable module parent directory as root.
- __outputFolder__: Defines a folder where the runnable binary is output. If the runnable is part of the project this folder is used otherwise __alwaysToFolder__ must also be checked. When the folder is a relative path, it is solved using the runnable module parent directory as root.
- __staticSwitches__: Defines a list of switches that are always passed to the compiler when a runnable is produced or when a module is tested.

View File

@ -1 +1,51 @@
### Symbolic strings
The symbolic strings represent variables defined by the software. They are used by several widgets:
- the [runnable modules shebang line](features_runnables).
- the [native project confirguration widget](widgets_native_project_configuration): many fields accept symbols.
- the [custom tools](widgets_custom_tools): parameters, working directory.
- the [process input](widgets_process_input): the input field can include a symbol.
- the [GDB commander](widgets_gdbcommander) custom commands.
Possible symbols, by context, include:
Application:
- **`<CAF>`**: also _`<CoeditApplicationFile>`_. Expanded to Coedit filename.
- **`<CAP>`**: also _`<CoeditApplicationPath>`_. Expanded to Coedit path.
Environment:
- **`<ENV_HOME>`**: Expanded to the user home directory. This is the equivalent of `HOME` (on a Posix system) or `USERHOME` (on a Windows system).
- **`<ENV_TEMP>`**: Expanded to the user temporary directory.
- **`<ENV_USER>`**: Expanded to the user name.
Current file:
- **`<CFF>`**: also _`<CurrentFileFile>`_. Expanded to the current file filename.
- **`<CFP>`**: also _`<CurrentFilePath>`_. Expanded to the current file path.
- **`<CI>`**: also _`<CurrentIdentifier>`_. Expanded to the identifier located at the caret position.
- **`<CL>`**: also _`<CurrentLine>`_. Expanded to the current line of code.
- **`<CS>`**: also _`<CurrentSelection>`_. Expanded to the current selection.
Current project:
- **`<CPF>`**: also _`<CurrentProjectFile>`_. Expanded to the project filename.
- **`<CPFS>`**: also _`<CurrentProjectFiles>`_. Expanded to a list that contains each D source of the project. Each item is separated by a line ending.
- **`<CPN>`**: also _`<CurrentProjectName>`_. Expanded to the project name (it's filename minus its path and extension)
- **`<CPO>`**: also _`<CurrentProjectOutput>`_. Expanded to the project output filename (a static library filename, a program name, etc.)
- **`<CPOP>`**: also _`<CurrentProjectOutputPath>`_. Expanded to the project output parent directory.
- **`<CPP>`**: also _`<CurrentProjectPath>`_. Expanded to the project path.
- **`<CPR>`**: also _`<CurrentProjectRoot>`_. Expanded to the field _RootFolder_ of a CE project (n/a if the current project is for DUB).
- **`<CPCD>`**: also _`<CurrentProjectCommonFilesDirectory>`_. Expanded to the sources common directory.
The expanded form of a symbol is never empty. When a symbol expands to nothing it's set to a pair of back quotes, e.g **\``** for a **`<CPP>`** when no project is opened.
The slices located before and after the symbols are passed in their original form, e.g:
`http://www.google.com/search?q="dlang.org"<CI>&btnI=Im+Feeling+Lucky`
is expanded to:
`http://www.google.com/search?q="dlang.org"indexOf&btnI=Im+Feeling+Lucky` if **indexOf** is the current identifier.

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -285,7 +285,7 @@ begin
'CFF', 'CurrentFileFile' : Result += fSymbols[CFF];
'CFP', 'CurrentFilePath' : Result += fSymbols[CFP];
'CI', 'CurrentIdentifier' : Result += fSymbols[CI];
'CL', 'CUrrentLine' : Result += fSymbols[CL];
'CL', 'CurrentLine' : Result += fSymbols[CL];
'CS', 'CurrentSelection' : Result += fSymbols[CS];
//
'CPF', 'CurrentProjectFile' : Result += fSymbols[CPF];