Commit Graph

20 Commits (master)

Author SHA1 Message Date
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 6b468a429a bintree 2015-05-11 15:46:01 -04:00
Tamir Duberstein fff92e7dec Incorporate go-nyet 2015-05-11 09:48:50 -04:00
Serhan Şen 9178943e13 Always split by forward slashes when writing the TOC tree.
At that point, all slashes are normalized as forward slashes.
2015-03-21 16:36:03 +01:00
Jens Breitbart 81e20ed1b7 Added MustAsset function. 2015-03-08 12:42:30 +01:00
Ryosuke IWANAGA f9f833bc6e Add AssetInfo() into debug mode using type asset 2014-12-08 07:31:35 +09:00
Jordan Liggitt 853793af8f Output TOC and tree in sorted order to make output stable between invocations. Addresses issue #49 2014-09-29 16:32:04 -04:00
Sebastian Thiel 6ca6b73691 AssetDir is now able to list the data root.
Previously, it was impossible to get a listing of entries right underneath
the data root.

Such a query is now possible by passing an empty string as data root.
2014-08-07 16:24:25 +02:00
Elazar Leibovich c15090e68a Support directory listing with AssetDir(dirname string)
Signed-off-by: Elazar Leibovich <elazarl@gmail.com>
2014-07-13 12:50:11 +03:00
Jim Teeuwen 17800c65a0 Fixes formatting of various generated outputs to be
more compatible with `go fmt`. This partially addresses
issue #34

Signed-off-by: Jim Teeuwen <jimteeuwen@gmail.com>
2014-05-28 14:43:02 +02:00
Anand Gaitonde and Michael Maximilien f93f031745 Asset retrieval is independent of OS Path
That is for Windows \\ are replaced with / since the
asset map uses paths with /
2014-05-16 10:34:04 -07:00
yosssi ff2ab748eb Remove the unnecessary line break of the TOC footer 2014-05-13 00:39:28 +09:00
yosssi e764a84fdf Fix the following things:
* Change `for name, _ := range _bindata` to `for name := range _bindata {`
* Format the souce codes
2014-05-12 18:15:42 +09:00
yosssi 57a8ec74ce Add `AssetNames` function which returns the names of the assets. 2014-05-12 13:59:00 +09:00
Alan Shreve 8e87ecda2a return errors from calls to Asset() instead of ever panicking 2013-11-08 21:28:49 +02: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
Pierre Baillet e6d1b0ecbd Made the code usable as a library
- Library is named bindata
- Currently exports: Translate
- The library code is in lib/
2013-09-30 21:48:27 +02: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 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