summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* remove use of lists:droplast, it doesn't exist pre-17Tristan Sloughter2015-04-171-1/+1
|
* Warn on bad use of include_lib but try to find the header anywayTristan Sloughter2015-04-111-19/+33
|
* rm old beams, make erlcinfo graph per app isntad of global to projectTristan Sloughter2015-04-101-13/+33
|
* pass objectfile name to opts_changed instead of recalculatingTristan Sloughter2015-04-101-6/+4
|