summaryrefslogtreecommitdiff
path: root/src/rebar_file_utils.erl
Commit message (Collapse)AuthorAgeFilesLines
* compiler behaviour (#1893)Tristan Sloughter2018-10-051-3/+8
| | | | | | | | | | | | | | | | * 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
* fix & testDmitry2018-04-231-2/+6
|
* ensure Dest exists before copying to itDmitry2018-04-221-2/+2
|
* Drop the /is switch to robocopy for win7Fred Hebert2017-12-041-2/+2
| | | | Has no ill effect as tested on Win10
* OTP-21 readiness, Full Unicode supportFred Hebert2017-11-161-1/+1
| | | | | | | | | | | | This replaces all deprecated function usage by alternative ones based on a version switch enacted at compile time, preventing all warnings. This will likely introduce some possible runtime errors in using a Rebar3 compiled on OTP-20 or OTP-21 back in versions 19 and earlier, but we can't really work around that. A bunch of dependencies have been updated to support OTP-21 without warnings as well.
* Avoid guessing on utf8 decoding of app filesFred Hebert2017-10-131-8/+13
| | | | | | | | | Rather than trying one method and then the other, allow the caller to specify the encoding of the expected file. All other schemes are risky and won't work well. Rollback the function's default interface to the binary format in case any plugin used it for non-unicode content, preserving backwards compat.
* fix sys config mergingTristan Sloughter2017-09-011-2/+3
|
* Support Windows with non-NTFS filesystemsWilliam H2017-08-101-7/+35
| | | | | | | | | | | The code for symlink handling failed whenever a win32 platform with no symlink capability would be detected. This patch is provided by William H from the support ticket at http://www.rebar3.org/v3/discuss/598225c90365bb00144bc07f, which adds detection of failures in non-NTFS scenarios on Win32, and then copies files instead of bailing out. The end result should be appropriate support for such a platform.
* Unicode support in all the placesFred Hebert2017-08-061-19/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Re-fix the windows file movementFred Hebert2017-01-271-33/+45
| | | | and clean up a bit
* Fix mv command on windowsFred Hebert2017-01-271-18/+87
| | | | | | | Requires changing a bunch of arguments for xerocopy since it does not allow to rename while copying. Lots of tests added
* Type specifications and edocs improvementsFred Hebert2016-11-271-4/+2
| | | | | | 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.
* Allow rebar3 to edoc itselfFred Hebert2016-11-171-2/+2
|
* Avoid backward-compatibility-breaking changes.Alexander Sedov2016-10-111-8/+10
|
* Made reading sys.configs consistent with OTP specification.Alexander Sedov2016-10-111-5/+8
|
* Ignore mv warningsDavid de Boer2016-09-151-3/+8
| | | | | | | In some cases, mv will throw a warning, while still moving the files correctly and returning a 0 return code: "mv: can't preserve ownership of ... Permission denied".
* Fixes for windows environment: 1) copy empty directories when cloning (since ↵Steve Strong2016-06-281-2/+2
| | | | git occasionally has a refs directory with no files in it - if the directory is not present, then git does not believe it is a git repo) and 2) change order of git rev-parse arguments to match git docs
* Merge pull request #1227 from ferd/compiler-source-formatFred Hebert2016-06-111-1/+19
|\ | | | | Compiler source paths in output are now relative
| * Option to format compiler sourcesGarrett Smith2016-05-021-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 support for passing a sys_config to common testTristan Sloughter2016-06-111-0/+15
|/
* fix dirs robocopy and canonical paths in windowsFred Hebert2016-01-071-4/+12
| | | | | | | | | | | | - robocopying a directory into another directory recursively expects the directory name to be properly mapped onto the destination, otherwise all the files are copied into the given path. This patches things so a directory-to-directory robocopy works as expected in a linux mindset so tests pass - the test for canonical paths didn't expect a windows environment at all; the test (and library) is modified to be consistent in that environment: always with a native format and with proper support of drive letters.
* preserve attributes when copying files in rebar_utils:cp_r for unixTristan Sloughter2015-11-251-1/+1
|
* function name changes:alisdair sullivan2015-09-141-18/+18
| | | | | `reduce_path/1` -> `canonical_path/1` `relative_path/2` -> `path_from_ancestor/2`
* extract `retarget_path/2', `relative_path/2' and `reduce_path/1' andalisdair sullivan2015-09-131-1/+28
| | | | add tests
* Use raw bytestream when writing filesFred Hebert2015-08-291-2/+2
| | | | | | | This patch forces write_file_if_contents_differ/2 to use raw bytes as when writing files. This fixes an issue where UTF-8 characters are processed and written back as ISO-8859-1 into the file, which makes it impossible to use UTF-8 characters in .app.src files.
* remove replacement of home dir with ~ in update outputTristan Sloughter2015-08-261-5/+0
|
* use 'default' for default hex repo path in cache and include in info messagesTristan Sloughter2015-08-221-1/+5
|
* Tidy up "Linking.." messages during compileRichard Jones2015-07-221-1/+1
| | | | | | | | | | | | Linking message will only be printed the first time the link or copy actually happens. Note: rebar_file_utils:symlink_or_copy will now return 'exists' instead of ok, if it did nothing because the link exists. Nothing was checking the return value yet, so seemed reasonable.
* Escape paths and args in shell commandsFred Hebert2015-07-181-19/+18
| | | | | | | Basic escaping is done only. Fancy hex sequences are not covered, but this should otherwise take care of the most common issues. Fixes #497
* Changed cases on robocopy so it uses variables in a better wayDaniel Widgren2015-07-051-22/+22
|
* Fix for different robocopy behaviour when moving files or folders.CarlosEDP2015-07-011-11/+23
|
* Fix for robocopy commandCarlosEDP2015-07-011-3/+8
|
* Fixed review commentsDaniel Widgren2015-06-261-2/+2
|
* Fixed so that release tests now pass. Got all green tests.Daniel Widgren2015-06-261-13/+39
|
* Fixed two tests for windows 8.1 and added touch functionalityDaniel Widgren2015-06-261-15/+34
|
* Fix windows-related issuesViacheslav V. Kovalev2015-06-261-6/+9
|
* print and format error message for bad .app files and all bad configsTristan Sloughter2015-05-221-1/+17
|
* use relative path on non-windows and copy if link failsTristan Sloughter2015-02-281-2/+19
|
* add functions `system_tmpdir/0,1` and `reset_dir/1`alisdair sullivan2015-01-151-1/+31
| | | | (in `rebar_file_utils`)
* properly escape pathsTristan Sloughter2014-11-271-6/+6
|
* file_utils: properly report errors (fix #95)Tuncer Ayaz2014-04-111-3/+3
| | | | While at it, improve the error message printed by rebar_utils:sh/2.
* Do not rewrite .app file if it didn't changeLev Walkin2012-08-081-1/+13
|
* Clean up specsTuncer Ayaz2012-08-061-3/+3
|
* Fix R13B03 build (Reported-by: Sergey Nartimov)Tuncer Ayaz2012-07-281-1/+1
|
* Fix eunit testing of apps that have no erl filesEric B Merritt2012-07-031-0/+2
| | | | | | | 'Erlang' projects that do not contain any erlang files (Joxa, LFE, Elixir, etc) break the eunit task. It attempts to copy an empty list of source files to the .eunit directory. This change makes copying an empty list a simple no-op.
* Remove ?FAIL in favor of ?ABORTDave Smith2012-06-081-1/+1
|
* Fix copying dir to non-existing dir in Win32Jesse Gumm2012-02-201-0/+19
|
* rebar_file_utils: simplify commands on WindowsJan Klötzke2011-10-201-3/+3
|
* Fix regressions in rebar_file_utilsTuncer Ayaz2011-09-151-5/+9
|
* Fix regression in rebar_file_utils:cp_r/2Tuncer Ayaz2011-09-041-2/+3
|