Commit Graph

6 Commits (658f2bddf47893406f0f7744e47ae9b1a9988569)

Author SHA1 Message Date
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