summaryrefslogtreecommitdiff
path: root/test/rebar_compile_SUITE.erl
Commit message (Collapse)AuthorAgeFilesLines
* Do not apply overrides to a root application.Fred Hebert2019-05-191-21/+52
| | | | | | | | | | | | | Overrides should apply to a layer below where they are declared. This patch makes it so if the project root is an application (i.e. it isn't 'root' and therefore not an umbrella project), we omit applying overrides in rebar_app_discover. This in turn required changing a bunch of tests, because all the tests worked with the idea that all overrides applied to all apps to validate that they get inherited properly. The changes re-structure the cases so they are written with an umbrella app, demonstrating that the changes stick.
* Remove debuggingJustin Wood2019-04-161-2/+0
|
* test for app file lintingJustin Wood2019-04-041-2/+20
|
* Fix handling of updated files in extra_src_dirsFred Hebert2019-02-011-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes cases where changes in .hrl files would not be picked up in .erl files that are in extra source directories (such as those defined with `extra_src_dirs` or modules in the test/ directory during a CT or Eunit run). The problem was due to the way the Directed Acyclic Graph (DAG) of dependencies between files was being loaded and stored by the compiler modules. Prior to this fix, a single DAG would be used for all runs. On a regular run, the prior DAG is loaded from disk, re-checked, and if changed, it would get re-written to disk with the changes deciding what to re-compile. However, whenever extra source directories were specified, a second run would be done which swaps target directories around in the compiler modules. Bug 1: this second run was done without properly tracking the private .hrl files (in src/), so the changes were invisible. This has been fixed by re-adding the paths. The problem is that the DAG handling is self-contained; just invoking it was sufficient to get it loaded and rewritten to disk. But since runs with extra src dirs were done on different sets, the compilation of extra src dirs would be done with bad historical data (all the modules in src/ are dropped, all those in test/ are re-added); this DAG was then written to disk once again, polluting the next non-extra run. This is bug 2, and it is fixed by adding an optional label to each run so that a regular or extra compile round can be distinguished, each tracking their own files in their own DAG. A single test (and a lot of diffing) were sufficient for this.
* check for mib_first_files regression in umbrella_mib_first_testStefan Grundmann2018-12-051-9/+57
| | | | | | | consider A-MIB imports from B-MIB: rebar compile MUST FAIL if mib_first_files is ["mibs/A-MIB.mib"] rebar compile MUST SUCCEED if mib_first_files is ["mibs/B-MIB.mib"]
* fix to include beams built from src files in subdirs in modules listTristan Sloughter2018-11-231-1/+7
|
* fix base path used for yrl/xrl includefile configs (#1952)Tristan Sloughter2018-11-231-2/+148
|
* check last modified time on erl files for xrl and yrl files before compilingTristan Sloughter2018-11-091-6/+19
|
* Abstracted path managementFred Hebert2018-10-111-2/+3
| | | | | | | | | | | | | | | | Move path management out of rebar_utils manual code path function handling (which we leave there for backwards compat), and centralize them to allow easier coordination of paths between plugins and deps. On top of path handling, do a check of loaded modules to only purge and reload those that actually need it done in order to prevent all kinds of weird interaction and accidental purge kills. It also allows the possible cohabitation of both at once, with a "in case of conflict pick X" as a policy Changing path handling in providers also highlighted a bunch of bugs in some tests and appears to fix some in other providers, specifically around plugins.
* fix yrl compiler and add test (#1906)Tristan Sloughter2018-10-061-3/+20
|
* properly support top level app erl_opts from REBAR_CONFIG os var (#1889)Tristan Sloughter2018-09-211-2/+26
| | | | | | When REBAR_CONFIG was set it would not effect the top level app's configuration because app_discover was rereading the top level rebar.config which ignored REBAR_CONFIG. Instead this patch has it use the existing configuration from REBAR_CONFIG.
* add option to compiler provider to only build dependencies (#1888)Tristan Sloughter2018-09-191-1/+20
|
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-131-64/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
* Introduce support of add and del operations under erl_opts directiveAlexander Petrovsky2018-05-311-12/+375
|
* Fix override_deps test from suite rebar_compile_SUITEAlexander Petrovsky2018-05-301-6/+7
|
* Fix test mocking for profile overridesFred Hebert2017-11-211-2/+4
|
* Merge branch 'profile_dep_countertest' of https://github.com/lrascao/rebar3 ↵Fred Hebert2017-11-211-0/+15
|\ | | | | | | into lrascao-profile_dep_countertest
| * Profile deps counter testLuis Rascao2017-10-161-0/+15
| |
* | Fix include paths in profile multiapp edge caseFred Hebert2017-10-231-0/+35
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compiling of OTP applications is done by first topographically sorting them according to their dependencies, deps-first. This allows all compilation to take place in order. In the current code, the same logic extends to top-level applications in an umbrella project. Unfortunately, there are cases where this is not going to be true: when an application has extra_src_dirs entries (or additional directories or files) to conditionally compile under some profiles, it may start depending on another top-level application dedicated to that profile for include files. However, such an app will never make it to production and neither will the compilation artifacts that create the dependency. Under that scenario, current rebar3 is unusable. This patch makes it so that the compilation provider instead changes the logic for top-level apps: rather than copying their directories one by one and compiling them in order, it: 1. copies all top-level apps to the build directory so the files are in their proper locations 2. adds the top-level apps to the path (after the global hooks have run, so the existing scope and env has not changed) 3. runs the compilation as usual. Fixes #1651
* Recompile when include files changesuexcxine2017-08-291-0/+49
|
* use proper skips in compiler tests that use unavailable functionsalisdair sullivan2017-02-051-17/+29
|
* Make test work on all OTPsFred Hebert2017-01-291-1/+4
|
* Add regression for #1410Fred Hebert2017-01-291-1/+33
|
* comment `ERL_COMPILER_OPTIONS` testsalisdair sullivan2017-01-281-0/+9
|
* consider `ERL_COMPILER_OPTIONS` when recompilingalisdair sullivan2017-01-281-5/+93
| | | | | | 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
* Add 'recursive' optionSiri Hansen2016-11-211-2/+40
| | | | | | | | | | | | 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.
* Fix private includes when compiling in test profileFred Hebert2016-09-301-1/+70
| | | | | | | | | | | | | | 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.
* recompile all files when a parse transform given as an opt needs updatingalisdair sullivan2016-09-201-2/+103
| | | | | | | | | 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/+42
| | | | | | | | 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
* REBAR-1184 exclude tests for `ERL_COMPILER_OPTIONS` on r15alisdair sullivan2016-06-111-2/+5
|
* REBAR-1184 always recompile if `ERL_COMPILER_OPTIONS` env var is setalisdair sullivan2016-06-111-2/+45
| | | | partially addresses #1184
* Add module directory to include pathLuis Rascao2016-01-261-2/+64
| | | | | | | | | | 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
* only apply default and prod profile to dependenciesTristan Sloughter2016-01-091-5/+35
|
* remove mib header file in `priv/mibs/include'alisdair sullivan2015-12-081-6/+0
|
* symlink mib hrl output in apps `include' directoriesalisdair sullivan2015-12-061-0/+6
| | | | this restores compatibility with rebar2 and erlang.mk
* Added tests and fixed a bugPhil Toland2015-12-011-4/+10
|
* refactor `rebar_erlc_compiler`alisdair sullivan2015-10-261-73/+560
| | | | | | | | | | | | | | | | | | | * 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-30/+1
| | | | | | compiled" This reverts commit 9d82215296205d2d30c152c7d7c6fcb8e4a92443.
* Support proper paths in non-erl first filesFred Hebert2015-10-121-2/+51
| | | | | 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-2/+31
| | | | to `rebar_erlc_compiler`
* override 'deps' now automatically overrides '{deps,default}'Tristan Sloughter2015-08-231-2/+42
|
* Add tests for mixed deps installsFred Hebert2015-08-161-1/+2
| | | | | Requires a rework of other test suites using the same dep-handling mechanism.
* add test for clean --allTristan Sloughter2015-07-281-2/+36
|
* do not install profile deps of depsTristan Sloughter2015-07-181-2/+27
|
* only look for top level apps and those directly under apps/ or lib/Tristan Sloughter2015-07-161-4/+4
|
* ensure necessary directories exist to compile mibs filesTristan Sloughter2015-07-061-3/+49
|
* Fixed two tests for windows 8.1 and added touch functionalityDaniel Widgren2015-06-261-3/+5
|
* Adding erl_first_files testFred Hebert2015-06-261-2/+44
| | | | | | The test works by using a parse transform that stamps modules with an attribute as it runs them. It then compiles everything, loads the module, and makes sure the stamps respect the defined order.
* plugins providerTristan Sloughter2015-06-181-132/+1
|
* store plugin providers in app_info's state for depsTristan Sloughter2015-05-281-17/+13
|