Commit Graph

42 Commits (master)

Author SHA1 Message Date
Noah 7816a8a362 Update package paths and README 2018-10-05 08:30:57 -07:00
Tobias Schmidt 8ed2cd0f6d Fix go format of generated code
The following changes make the generated code go fmt compatible.
2015-10-23 03:48:06 -04:00
Tamir Duberstein 57e5327e97 Replace `go-nyet` with `go tool vet --shadow`
`go-nyet` is deprecated.
2015-08-07 16:36:36 -04:00
Tamir Duberstein ff362dd1f1 Use `filepath` everywhere instead of `path`
For non-slashed paths (e.g. Windows) `path` does the wrong thing.
Sadly this is not documented, but a cursory glance at the go sources
reveals that `filepath` uses `os.PathSeparator` everywhere while
`path` uses a literal `"/"`.
2015-07-02 11:44:17 -04:00
Tamir Duberstein ca29b0b7f5 Insert a newline 2015-05-28 10:30:35 -04:00
Tamir Duberstein 36d53ead3a Insert "generated by" comments
This allows Github to suppress diffs in generated files.
2015-05-27 19:52:04 -04:00
Tamir Duberstein dfcf23b04e camelCase instead of snake_case 2015-05-11 21:44:51 -04:00
Tamir Duberstein 4fc85e2b3c Better Makefiles 2015-05-11 21:39:32 -04:00
Tamir Duberstein dada32c78b Early return 2015-05-11 15:47:48 -04:00
Tamir Duberstein 6b468a429a bintree 2015-05-11 15:46:01 -04:00
Tamir Duberstein ba26659a34 bindataFileInfo 2015-05-11 15:45:16 -04:00
Tamir Duberstein 4f258b3140 Comment style 2015-05-11 15:44:41 -04:00
Tamir Duberstein ffff253524 bindataRead 2015-05-11 15:42:14 -04:00
Tamir Duberstein fff92e7dec Incorporate go-nyet 2015-05-11 09:48:50 -04:00
Tamir Duberstein c3e4c77465 Emit `errcheck`-passing code 2015-05-08 16:15:37 -04:00
Tamir Duberstein 476077970b Regenerate testdata 2015-05-08 16:15:24 -04:00
Andrew Bates 465fc29db9 Implementation for following symlinks
This is an implementation where findFiles will follow symlinks and keep
track of paths already followed.  No paths will be evaluated more than
once, therefore preventing recursive link evaluation.

Commit includes test cases and test data
2015-04-16 09:38:06 -04:00
Jim Teeuwen 452770b024 Merge pull request #64 from riywo/fix/recursive_knownFuncs
Fix bug of knownFuncs usage when findFiles is called recursively
2014-12-09 16:43:41 +01:00
Ryosuke IWANAGA f80b50711d Fix bug of knownFuncs usage when findFiles is called recursively 2014-12-09 22:07:31 +09:00
Ryosuke IWANAGA fc595e391e Update testdata/out 2014-12-09 14:41:25 +09:00
Jim Teeuwen c385518c06 Performs some minor cleanup.
Adds testdata output for a debug build.
Fixes README to reflect new features and behaviour.
2013-10-30 15:24:59 +01:00
Jim Teeuwen cca9f8e6b7 Removes output of both debug and release code. There really
is no point to this.

All output (including TOC) is now written to a single output file.
This allows us to have different output file names to be specified.
Each for a different version generated code with its own build tags.
Consequently offering much greater flexibility in the way generated
code is to be used in a host application.

Fixes test outputs to match all these changes.
2013-10-30 14:45:04 +01:00
Jim Teeuwen 12a480432a Implements writing of TOC file. Refactors code for debug and release
writers. Adds output examples for various output modes.
2013-10-30 13:14:58 +01:00
Jim Teeuwen efd0c57cfd Fixes some minor translation issues. 2013-10-30 11:42:09 +01:00
Jim Teeuwen 7125d6f515 Adds an extra testdata file to ensure that there are no
name collisions in the generated code, when it comes to
multiple assets with the same file name.

This should all receive unique entries, using their
directory paths to set them apart.
2013-10-30 02:19:24 +01:00
Jim Teeuwen ae16b2b3c6 Finishes imlpementing the various debug and release output
modes. For debug we always read assets from disk and ignore
the compression and memcopy options. For release mode, the
assets are all embedded and the compression/memcopy options
are taken into account.
2013-10-30 02:16:14 +01:00
Jim Teeuwen 17f2782db6 Implements output of debug code.
Partially imlpements output of release code.
Reorganizes testdata directory.
2013-10-30 02:11:04 +01:00
Jim Teeuwen c4d457542a Add some more test files and directories and implement locating
of asset files.
2013-10-29 18:23:52 +01:00
Jim Teeuwen 6187b52beb Strips existing code. Refactors directory structure and begins
implementation of version 3.0.1.
2013-10-29 16:16:12 +01:00
Jim Teeuwen 0cd33e9b7d Reverts change to -out flag. One should specify the full path
of the target file, instead of just the target directory.

This allows us to overwrite a generated file from a previous
build cycle. This addresses issue #8
2013-08-01 12:10:59 +02:00
Jim Teeuwen dcda30b1ad Runs go fmt. 2013-07-25 23:57:40 +02:00
Jim Teeuwen ff063d28c6 * Bump version to new release: 2.0.0
We do this, because the changes in this patch fundamentally
  alter the way code is generated by the tool. This will, in some
  cases, be incompatible with older versions.
* Performs cleanup and minor code fixes.
* Adds two new command line flags:
  * -prefix: This accepts a partial path. It is used when generating
    a target function name, as well as the key for the Table of Contents
    map (see below). The specified prefix is applied to the input
    file name, causing the prefix section to be stripped from the
    input file path. E.g.:
    ```
    input: /path/to/foo.x
    prefix: /path/to
    output: /foo.x
    ```
  * -toc: This is a boolean flag which tells the tool to generate
    a table of contents for the generated data files. It creates
    a separate 'bindata-toc.go' file, which defines a global map
    named `go_bindata`. It then appends an `init` function to the
    generated file. This function makes the data function register
    itself with the global map.
* Fixes the function names the tool infers from input file names
  to include the full path. This fixes potential name collisions
  when the same file name is processed from different directories.
  For example, we can now safely import the following two files:
  ```
   input file: css/ie/foo.css
   output function: css_ie_foo_css()

   input file: css/chrome/foo.css
   output function: css_chrome_foo_css()
  ```
2013-07-25 22:46:12 +02:00
jim teeuwen 98c1704190 Combine the old and new code generation methods. We can select the .rodata hack described in issue #1 by supplying the -m commandline flag. The default code generation mode is the old one. While it uses more memory, it is a safer version and offers no problems when used on platforms that restrict usage of the `unsafe` and `reflect` packages. Additionally I did some cleanup and refactoring of the code. Bumped version to 1.0.0 2012-06-22 14:12:15 +02:00
jim teeuwen 37af2a4b27 Fix generated code for both compressed and uncompressed modes. We now no longer require a memcpy to read the static file data and can get it directly from the .rodata section. This addresses issue #1 2012-06-13 14:17:25 +02:00
jim teeuwen 384e0cafe9 Added -u flag. When this is supplied to the program, no compression of the input data will take place. This also means the generated source code changes from a function to a global variable. The function is only there because it has to decompress the binary data. When no compression is used, this is obviously not necessary. Default behaviour is still the same (with compression) so existing code using this program will not break. Fixed README to reflect new behaviour. Added new testdata examples for both compressed and uncompressed output. 2012-03-28 01:39:01 +02:00
jim teeuwen 0450ba8421 Change signature of generated function to only return the decompressed byte slice. The error value is removed. Instead the function will panic when a decompression error occurs. This allows us to assign the data to global variables were necessary. A decompression error is considered a deal breaker and therefor the panic is warranted. 2012-03-08 11:47:57 +01:00
jim teeuwen fea0fad8ad Fix output for generated file. 2012-03-06 19:30:35 +01:00
jim teeuwen 02da4740e4 Fix generate doutput code. os.Error -> error. Remove calling of go fmt from code. This should really be done manually. 2012-02-11 16:49:43 +01:00
jim teeuwen 7df69a98df gofmt -s -w 2011-12-07 13:49:06 +01:00
jim teeuwen efcb2b8d06 gofix error 2011-11-02 16:40:26 +01:00
jim teeuwen 55b35257df Added facilities to pipe file data into stdin. 2011-06-17 18:52:40 +02:00
jim teeuwen 2a84f0bab0 Changed from package to command. Removed bindata dependency from generated go files by embedding the unpacking code in the generated function. 2011-06-17 17:44:59 +02:00