summaryrefslogtreecommitdiff
path: root/src/rebar_app_utils.erl
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1596 from ferd/local-apps-override-depsFred Hebert2017-08-091-1/+9
|\ | | | | Allow top-level apps to take precedence over deps
| * Allow top-level apps to take precedence over depsFred Hebert2017-08-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use case has been described in issue #1478 where a local application can exist while being declared as a dependency as well. This allows, for example, to work on a release where all applications may require to be published independently, or to provide some form of 'vendoring' with a local app. The fix is done by decoupling the dependency source resolution form the dependency parsing. The reason for this being that the discovery phase needs to parse apps for their top-level deps, and dep installation needs to resolve the packages with accuracy. In the current implementation, both code paths call to the same function. This patch splits up the precise discovery and makes it happen *only* when installing dependencies, and only if a top-level app does not already define the application needing resolving. One weakness of this fix is that it necessarily breaks cycle detection in dependencies that involve a root application depending on itself since its own version as a dep will not be expanded. There appears to be no possible way to prevent this, but should be rare enough to be worth the tradeoff for the common case.
* | Unicode support in all the placesFred Hebert2017-08-061-11/+13
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Type specifications and edocs improvementsFred Hebert2016-11-271-2/+77
| | | | | | Includes improvments and function documentation for all modules (in alphabetical order) up to rebar_core, and may have included more in other modules as I saw fit to dig and understand more of the internals.
* Fix crash when doing hash check with missing indexFred Hebert2016-08-271-1/+10
| | | | | | | | | | Specifically, when fetching an application where the expected hash is unknown, the hash is validated from the hex index; when the index is available, the hash is fetched fine and later inserted in the lock file. However, if the index is not available, the call would simply crash. This patch fixes thing so that instead, the index is refreshed before giving up and failing.
* Equivalent trim_all in bin split for <17.xFred Hebert2016-08-251-1/+1
| | | | | | | | | | | | | | | | | | The trim_all option used in binary:split/3 is not supported in 17.x. This patch makes an equivalent operation by eliminating empty split fragments. From the docs: trim Removes trailing empty parts of the result (as does trim in re:split/3. trim_all Removes all empty parts of the result. The new expression is therefore equivalent to the old one, but with the added benefit of compatibility. Fixes #1275
* Merge pull request #1207 from ferd/pkg-local-hash-lockFred Hebert2016-06-221-7/+16
|\ | | | | lock file contains expected hash for pkg dependencies
| * Fetch hashes from index prior to fetchingFred Hebert2016-05-241-1/+8
| |
| * Support package hashes in structure and lockfileFred Hebert2016-05-241-7/+9
| | | | | | | | | | | | | | | | | | - the internal representation for package locks moves from `{Name, {pkg, PkgName, Vsn}, Lvl}` to `{Name, {pkg, PkgName, Vsn, Hash}, Lvl}` - the internal representation for packages moves from `{pkg, PkgName, Vsn}` to `{pkg, PkgName, Vsn, Hash}` - the hash can be `undefined`, meaning no check will be done - no checking is done yet.
* | Don't die when source deps with [raw] are usedFred Hebert2016-05-271-1/+6
|/ | | | | This adds support for their format both on the first read and when looking for modifications to dependencies.
* only apply default and prod profile to dependenciesTristan Sloughter2016-01-091-1/+3
|
* convert ~> versions to highest matchingTristan Sloughter2015-12-261-24/+14
|
* parse versions in deps tree output and support checkoutsTristan Sloughter2015-09-121-1/+1
|
* fix dialyzer warningsTristan Sloughter2015-09-091-1/+1
|
* support _checkouts overriding package dep that doesn't exist in registryTristan Sloughter2015-09-031-27/+38
|
* fixes for overrides of depsTristan Sloughter2015-08-311-2/+4
|
* update use of hooks and plugins with state in app_infoTristan Sloughter2015-08-311-1/+1
|
* build on already created AppInfo instead of having to do copyTristan Sloughter2015-08-311-5/+0
|
* fix erl_opts to not be inheritedTristan Sloughter2015-08-311-6/+6
|
* remove state record from app_info recordTristan Sloughter2015-08-311-1/+0
|
* wip: move state into app_infoTristan Sloughter2015-08-311-17/+19
|
* set parent on already fetched apps so tree worksTristan Sloughter2015-08-291-1/+1
|
* simplify package dep parsing and handlingTristan Sloughter2015-08-251-69/+21
|
* support pkg attribute on dep to declare package name different from app nameTristan Sloughter2015-08-231-4/+31
|
* improve error messages for packages by checking its existance before fetchingTristan Sloughter2015-08-231-2/+16
|
* replace use of dict of packages and registry with single ets tableTristan Sloughter2015-08-211-7/+2
|
* this patch treats pkg and src deps as equals, so level decides winnerTristan Sloughter2015-08-211-2/+127
| | | | | | | | Instead fetching and resolving src deps (which could depend on pkg deps) and then pkg deps this patch combines the two into a single set of iterations by level. The only difference between src and pkg deps in this new install_deps is how their deps list is found -- from the config or lock file for src deps and from the neighbors of the vertex for pkg.
* Fix some unknown functions/types dialyzer warningsJames Fish2015-08-091-1/+2
|
* include app.src.script in app discover and always use if availableTristan Sloughter2015-07-261-1/+8
|
* include applications list in compile sortTristan Sloughter2015-04-151-1/+0
|
* copy project apps to deps output dir for compilationTristan Sloughter2015-02-281-5/+8
|
* remove unneeded get_modules_list functionTristan Sloughter2015-02-221-17/+6
|
* consolidate app validation and exist checksTristan Sloughter2015-02-221-77/+39
|
* remove unused functions from app utilsTristan Sloughter2015-02-171-26/+5
|
* return an error when an app file is missingnuex2015-02-071-0/+1
|
* move dir functions from utils to new module rebar_dirTristan Sloughter2014-12-011-1/+1
|
* slowly widdling away at dialyzer errorsTristan Sloughter2014-09-201-50/+1
|
* more efficient check for existing depTristan Sloughter2014-09-201-0/+3
|
* inefficient way, but safer, of checking if an app is already downloadedTristan Sloughter2014-09-201-1/+13
|
* remove use of 17+ function lists:droplast/1Tristan Sloughter2014-09-171-1/+1
|
* start of moving to splitting state from config parsingTristan Sloughter2014-08-171-8/+8
|
* large refactoringTristan Sloughter2014-08-161-1/+4
| | | | | | | | Removed separate compilers Resolves apps to build Finds avail deps before pulling/building Includes relx Simplifies build commands
* Remove experimental flagsTuncer Ayaz2014-01-141-9/+0
| | | | | | | | Remove experimental flag from: * qc compile_only=true * eunit compile_only=true * src/foo.app.src.script * eunit tests=
* Allow script to be evaluated when app file is loadedEric Merritt2012-09-071-1/+23
| | | | | | This allows an <app-name>.app.src.script to be defined and evaluated when <app-name>.app.src or <app-name>.app are loaded. This allows the user to add project specific manipulations to app metadata.
* Finalize app=, skip_app=, suite= deprecationsTuncer Ayaz2012-07-231-2/+2
|
* Do not use application:set_envTuncer Ayaz2012-07-231-9/+9
|
* Remove shared stateTuncer Ayaz2012-07-131-45/+50
|
* Cleanup and simplify deprecated option handlingTuncer Ayaz2012-01-011-22/+2
|
* Move vcs_vsn/2 to rebar_utilsTuncer Ayaz2011-12-281-56/+1
|
* Universally support apps=/skip_apps=Tuncer Ayaz2011-12-121-33/+63
|