summaryrefslogtreecommitdiff
path: root/src/rebar_app_utils.erl
Commit message (Collapse)AuthorAgeFilesLines
* Only lint app files when compilingFred Hebert2019-06-021-1/+6
| | | | | | | | This allows to reduce the number of noise to only checking deps' app files when they're built, rather than on every run. Since main apps and checkouts are still compiled every time, the linting takes place there and then with a higher frequency.
* Merge pull request #2035 from ankhers/lint_app_fileFred Hebert2019-04-161-0/+31
|\ | | | | Add basic linting for .app file
| * An empty list on applications key should not be treated as missingJustin Wood2019-04-161-2/+2
| |
| * Change wording in application linting to be more clearJustin Wood2019-04-161-1/+1
| |
| * Add basic linting for .app fileJustin Wood2019-03-191-0/+31
| | | | | | | | | | This currently just checks for the existence of the description and applications keys and that the applications list has kernel and stdlib in it.
* | Refactor deps command to show lock vs config fileJose M Perez2019-04-011-0/+1
|/ | | | | | Deps command shows an * if the local state of the dependencies do not match the config file, highlighting the differences between the lock file and the config file if there are any.
* fix for mix projects that don't have app.src files (#1964)Tristan Sloughter2018-11-301-1/+2
|
* Fix package upgrade (issue #1945) (#1946)AndrĂ¡s Boroska2018-11-161-2/+1
|
* compiler behaviour (#1893)Tristan Sloughter2018-10-051-3/+2
| | | | | | | | | | | | | | | | * add compile type for dynamic project compilation * new rebar_compiler abstraction for running multiple compilers rebar_compiler is a new behaviour that a plugin can implement to be called on any ues of the compile provider to compile source files and keep track of their dependencies. * fix check that modules in .app modules list are from src_dirs * use project_type to find module for building projects * allow plugins to add project builders and compilers
* warn if the matched package is retired, skip prerelease (#1897)Tristan Sloughter2018-10-011-6/+35
| | | | | | | retired packages are now used the same as any other but a warning will be printed when it is resolved. prerelease versions are skipped unless explicitly given as the version in the constraint or lock file.
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-131-70/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* 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
|