summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
Commit message (Collapse)AuthorAgeFilesLines
* Recompile when include files changesuexcxine2017-08-291-2/+3
|
* Unicode support in all the placesFred Hebert2017-08-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done through 3 main change groups: - replacing `~s` by `~ts` in format strings, so that strings that contain unicode are properly printed rather than crashing - adding the `unicode` argument to all function of the `re` module to ensure transformations on strings containing unicode data are valid instead of crashing (see issue #1302) - replacing `ec_cnv:to_binary/1` and `ec_cnv:to_list/1` with matching functions in `rebar_utils`. The last point has been done, rather than modifying and updating erlware commons, because binary and list conversions can be a contentious subject. For example, if what is being handled is actually bytes from a given binary stream, then forcing a byte-oriented interpretation of the data can corrupt it. As such, it does not appear safe to modify erlware commons' conversion functions since it may not be safe for all its users. Instead, rebar3 reimplements a subset of them (only converting atoms and chardata, ignoring numbers) with the explicit purpose of handling unicode string data. Tests were left as unchanged as possible. This may impact the ability to run rebar3's own suites in a unicode path, but respects a principle of least change for such a large patch.
* recompile only if new option effects code generationTristan Sloughter2017-07-131-2/+17
|
* consider `ERL_COMPILER_OPTIONS` when recompilingalisdair sullivan2017-01-281-3/+13
| | | | | | on 19.x forward the compiler should now take into consideration the value of the environment variable `ERL_COMPILER_OPTIONS` when deciding whether or not to recompile a module
* Fix regex match for ignored fileFred Hebert2016-12-091-1/+1
| | | | | | | The regex mistakenly matched too many files (any character followed by an underscore) rather than only files starting in '._' This properly escapes the expressions to work in all cases.
* Restrict regexp to match on files starting with '._'Roberto Aloi2016-12-061-1/+1
|
* Add 'recursive' optionSiri Hansen2016-11-211-23/+30
| | | | | | | | | | | | The option {recursive,boolean()} can now be set pr directory in 'src_dirs' and 'extra_src_dirs', and on top level in the new 'erlc_compiler' option. Example config: {erlc_compiler,[{recursive,false}]}. {src_dirs,[{"src",[{recursive,true}]}]}. This will cause recursive compilation within the "src" directory, but not in any other directoires.
* Merge pull request #1380 from ferd/fix-self-edocFred Hebert2016-11-201-9/+3
|\ | | | | Allow rebar3 to edoc itself
| * Allow rebar3 to edoc itselfFred Hebert2016-11-171-9/+3
| |
* | Fix rebar3 dialyzer warningsFred Hebert2016-11-191-2/+4
|/ | | | Some tricky changes in there but should be okay
* Use all_src_dirs for include pathsFred Hebert2016-09-301-2/+2
| | | | Helps cover extra cases.
* Fix private includes when compiling in test profileFred Hebert2016-09-301-9/+14
| | | | | | | | | | | | | | When an include file is set in a private path (i.e. src/), the rebar3 compiler would not add them to the {i, Path} params -- only include/ and the project root were being added. This meant that when some extra source directories were added to the compile job, such as test/ when running under the test profile, the private include paths could not be shared with the test module. This patch fixes the issues (and adds tests) for such a specific case by adding all the configured include paths to the {i, Path} erl_opts arguments, yielding successful compile runs.
* Add support for behaviors, and not just behavioursBrujo Benavides2016-09-281-0/+2
|
* recompile all files when a parse transform given as an opt needs updatingalisdair sullivan2016-09-201-1/+15
| | | | | | | | | there's no way to detect which files actually rely on a parse transform passed to the compiler via the options (as opposed to `-compile(..)` so if any parse transforms are in modules that need recompiling just recompile the world fixes #1328
* normalize include dirs to absolute paths during compilationalisdair sullivan2016-06-121-3/+6
| | | | | | | | changed include files were not properly picked up by `erlc_compiler` in cases where they were in directories relative to the application source and not the current working dir of rebar3 fixes #1199
* Merge pull request #1232 from talentdeficit/REBAR-1184Fred Hebert2016-06-111-0/+7
|\ | | | | REBAR-1184 always recompile if `ERL_COMPILER_OPTIONS` env var is set
| * REBAR-1184 always recompile if `ERL_COMPILER_OPTIONS` env var is setalisdair sullivan2016-06-111-0/+7
| | | | | | | | partially addresses #1184
* | Fix alternative path printing, default is relativeFred Hebert2016-06-091-36/+10
| | | | | | | | | | | | | | This required moving the reporting functions to rebar_base_compiler but since this was already done for error_tuple, this seems to make sense. Paths are also reformatted for warnings in erlc files.
* | Rename 'unchanged' option to 'build'Fred Hebert2016-06-061-4/+4
| | | | | | | | | | This will allow us to eventually change the default type without it looking ridiculous.
* | Option to format compiler sourcesGarrett Smith2016-05-021-2/+37
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default rebar3 displays compiler sources as absolute paths in their original location, which is under the build dir. This change introduces an option 'compiler_source_format' to format sources in two alternative ways: relative absolute When either 'relative' or 'absolute' are specified, the file is resolved to its original location when it is a link. When 'relative' is specified, the path is displayed relative to the current working directory. When 'absolute' is specified, the path is absolute. The default value is 'unchaged' which leaves the compiler source unchanged. This is arguably too flexible as I suspect most people would opt for 'relative' all the time - it's the most compact representation of the file and is sufficient to find the source given cwd. The change however is meant to introduce the change gradually, preserving existing behavior and giving users a choice for formats. In time perhaps the default can be changed to 'relative' - but still allowing users to revert to the other two options ('absolutel' and 'unchanged') as needed.
* Add module directory to include pathLuis Rascao2016-01-261-2/+3
| | | | | | | | | | Several projects use an include path relative to the project's root. file:compile will look in three places for the include files: The current working directory The directory where the module is being compiled The directories given by the include option
* remove mib header file in `priv/mibs/include'alisdair sullivan2015-12-081-7/+1
|
* symlink mib hrl output in apps `include' directoriesalisdair sullivan2015-12-061-31/+39
| | | | this restores compatibility with rebar2 and erlang.mk
* Added tests and fixed a bugPhil Toland2015-12-011-1/+1
|
* Fix a small bug in the MIB compiler when building dependenciesPhil Toland2015-11-301-4/+8
| | | | | | | When compiling a dependency with a MIB file the generated hrl file is left in the root project directory in a file called "include". This has the perverse effect of messing up the search path for include files causing any dependencies with files in their "include" directory to fail to build after that.
* Fix error reports on missing include pathsFred Hebert2015-11-141-1/+1
| | | | | | | In some cases (nested includes?) paths end up in such a way that joining them breaks up and hard-crashes rebar3. This patch specifically handles this scenario to fix things by avoiding passing empty lists to filename:join.
* restore debug calls to `rebar_erlc_compiler` and `rebar_prv_eunit`alisdair sullivan2015-10-261-7/+9
|
* refactor `rebar_erlc_compiler`alisdair sullivan2015-10-261-80/+178
| | | | | | | | | | | | | | | | | | | * modify compiler interface to work on either application objects or directories containing source files * compile all sources in `src_dirs` to the application `ebin` dir and all sources in `extra_src_dirs` to a directory mirroring it's position in the app's `_build` directory. for example, `apps/foo/more` would compile to `_build/default/lib/foo/more` for `extra_src_dirs` in the root of a project with multiple applications (so orphan directories that don't "belong" to an application) compile to `_build/default/extras/more` * copy directories specified in `extra_src_dirs` into the `_build` directory so tools like `ct` and `xref` that expect source to be in a particular location still work * clean compiled artifacts from all `extra_src_dirs` * alter `eunit`, `ct` and `cover` to work with the new directory structure * billions of new tests
* Revert "add an export to allow specifing arbitrary extra erl files to be ↵alisdair sullivan2015-10-261-7/+0
| | | | | | compiled" This reverts commit 9d82215296205d2d30c152c7d7c6fcb8e4a92443.
* Support proper paths in non-erl first filesFred Hebert2015-10-121-6/+6
| | | | | This passes the directory to the option to ensure it works with more than configs at the root of the project.
* add an export to allow specifing arbitrary extra erl files to be compiledalisdair sullivan2015-09-211-0/+7
| | | | to `rebar_erlc_compiler`
* fix dialyzer warningsTristan Sloughter2015-09-091-3/+3
|
* move opts functions to new module rebar_optsTristan Sloughter2015-09-011-8/+8
|
* update use of hooks and plugins with state in app_infoTristan Sloughter2015-08-311-8/+9
|
* build on already created AppInfo instead of having to do copyTristan Sloughter2015-08-311-52/+52
|
* wip: move state into app_infoTristan Sloughter2015-08-311-48/+49
|
* update erlcinfo on disk if source file removedTristan Sloughter2015-08-221-12/+26
|
* fix leaking ets tables when compilation failedpvmart2015-08-181-11/+14
|
* fix leaking ets tables caused by digraphspvmart2015-08-171-1/+4
|
* Fix some unknown functions/types dialyzer warningsJames Fish2015-08-091-1/+1
|
* ensure necessary directories exist to compile mibs filesTristan Sloughter2015-07-061-2/+5
|
* methods for retrieving `src_dirs` and `extra_src_dirs`alisdair sullivan2015-05-191-2/+1
| | | | | | note that now ALL `src_dirs` across included profiles are compiled. previously only the last included profile's `src_dirs` were used
* Merge pull request #439 from talentdeficit/extra_src_dirsTristan Sloughter2015-05-171-1/+2
|\ | | | | generalize the "test" special dir into an {extra_src_dirs, [...]} option
| * generalize the "test" special dir into an {extra_src_dirs, [...]} optionalisdair sullivan2015-05-161-1/+2
| | | | | | | | | | | | like `src_dirs`, `extra_src_dirs` are directories to be copied to the `_build` dir and compiled. unlike `src_dirs` they are not added to the .app specification
* | remove use of `code:load_abs/1` in favor of `beam_lib:chunks/2` toalisdair sullivan2015-05-161-8/+14
|/ | | | avoid repeated loading and unloading of modules
* enable parse transformations in rebar configTristan Sloughter2015-04-261-6/+27
|
* remove warning if header not found, could be in a macroTristan Sloughter2015-04-231-4/+0
|
* real bootstrappingTristan Sloughter2015-04-221-1/+2
|
* track and cleanup code paths for different contextsTristan Sloughter2015-04-211-2/+0
|
* fix erl_first_files to check entire path of fileTristan Sloughter2015-04-201-3/+4
|