Commit Graph

22 Commits

Author SHA1 Message Date
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
Elias Naur
f813d1c931 Added support for build tags with the -tags flag 2013-09-19 17:27:54 +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
98703b5677 Adds a check to ensure the specified output directory actually exists. 2013-07-26 23:47:30 +02:00
Jim Teeuwen
f0faa42c2f Changes the meaning of the -out command line flag.
This now expects a directory path to store the generated file(s) in.
This was previously a path with file name. We now always use
the filename, inferred from the input path.
2013-07-25 23:58:17 +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
6a3f0aca94 Bumps version number. 2013-07-07 13:04:43 +02:00
jimt
5f066faee3 Fix issue 4. Removes debug output from pipe mode. 2013-01-26 21:06:46 +01: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
ed2cd8b81c Some more code cleanup. 2012-06-07 23:34:34 +02:00
jim teeuwen
665944b444 Remove some unneccesary code bits. 2012-06-07 23:28:16 +02:00
jim teeuwen
6214789c41 Fixed typo in flag description text. 2012-03-28 01:43:03 +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
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
5b255b58ee Changed code to use new rune type unicode code points. 2011-10-26 11:59:30 +02:00
jim teeuwen
2985202b2b Fix function and package names if the user supplied versions start with a digit. 2011-06-27 18:45:39 +02:00
jim teeuwen
55b35257df Added facilities to pipe file data into stdin. 2011-06-17 18:52:40 +02:00
jim teeuwen
c539ce1afc wrong license header in main.go 2011-06-17 18:01:49 +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