Commit Graph

123 Commits

Author SHA1 Message Date
Paweł Błaszczyk
85c2b05609 In case of error, exit status should be different than 0. 2014-01-07 17:41:09 +01:00
jimt
37aa0dc02e Merge pull request #15 from pblaszczyk/fix
Fix for handling prefix value and output not formatted according to go fmt.
2014-01-03 12:11:32 -08:00
Paweł Błaszczyk
28919a6a56 Output files are not formatted in accordance with go fmt. 2014-01-03 19:45:37 +01:00
Paweł Błaszczyk
7bd7bcfcdf Fix for ignored trailing path separator in prefix. 2014-01-03 18:46:33 +01:00
Jim Teeuwen
b903585359 Revises README to reflect changes to command line API. 2013-11-16 12:20:14 +01:00
Jim Teeuwen
4674192d6b Implement supp-ort for multiple input paths in command line tool. 2013-11-16 12:19:19 +01:00
Jim Teeuwen
14a0ff90f8 Adds -o flag to specify output file name. 2013-11-16 12:08:37 +01:00
Jim Teeuwen
67221add2e Replaces CONTRIBUTE file with CONTRIBUTING.md file.
The list of contributors is no longer included, as it
can be deduced from the git commit history. No need
to maintain it twice.
2013-11-16 11:57:31 +01:00
jimt
f43e6bd89c Merge pull request #13 from inconshreveable/experimental
Proposed changes after experimenting with batchconvert
2013-11-12 01:41:44 -08:00
Alan Shreve
bd1a47dfea be more helpful on no-argument invocation 2013-11-08 21:31:55 +02:00
Alan Shreve
8e87ecda2a return errors from calls to Asset() instead of ever panicking 2013-11-08 21:28:49 +02:00
Alan Shreve
7ab45c816f add support for converting multiple directories simultaneously 2013-11-08 17:21:11 +02:00
Alan Shreve
2c7ab48825 use 'go' command style recursion indicators on path inputs rather than a recursive flag 2013-11-08 17:14:25 +02:00
Jim Teeuwen
965fbe401b Fixes some formatting in README. 2013-11-01 10:36:39 +01:00
Jim Teeuwen
b1eab644d7 Fixes Config.validate() to create the directory of the output
file, if it does not exist.
2013-11-01 10:34:25 +01:00
Jim Teeuwen
ca6a684780 Fixes another code comment. 2013-11-01 10:30:39 +01:00
Jim Teeuwen
f5e037a829 Fixes some code comments. 2013-11-01 10:27:50 +01:00
Jim Teeuwen
a36b3d3839 Adds the -r command line flag. This determines if the input
directory should be processed recursively or not. The default
is false.

Fixes the package to use this flag.

Revises the README and adds a docs.go file which holds
package documentation.
2013-10-30 16:08:29 +01: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
560fbff5df Main directory becomes the library. go-bindata subdir holds
the command code.
2013-10-29 16:17:14 +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
jimt
79847ab3e9 Merge pull request #12 from octplane/issue-11
Fix for issue #11
2013-10-02 06:05:46 -07:00
Pierre Baillet
3b99b93ffc Fix for issue #11 2013-10-02 08:50:28 +02:00
jimt
edbc082b2f Merge pull request #10 from octplane/mine/master
Make bindata usable as a Library
2013-09-30 15:07:12 -07:00
Pierre Baillet
de61f8ffd8 Additionale export
- SafeFuncname
- Tiny doc patch
2013-09-30 21:49:43 +02: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
jimt
6fb0150f0c Merge pull request #9 from eliasnaur/master
Added support for build tags with the -tags flag
2013-09-19 08:39:46 -07:00
Elias Naur
f813d1c931 Added support for build tags with the -tags flag 2013-09-19 17:27:54 +02:00
Jim Teeuwen
871202fb0f Bumps minor version. 2013-08-01 12:12:39 +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
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
6a3f0aca94 Bumps version number. 2013-07-07 13:04:43 +02:00
Jim Teeuwen
10c722dc95 Fixes bug in StringWriter, which causes the compiler to
generate a segfault when there are too many string
concatenations. This happens when we convert a file of
about 100kb or larger.

The fix modifies the StringWriter to write the file data
out into a single, long string, without concatenations.

This addresses issue #5
2013-07-07 13:02:07 +02:00
jimt
0877d93299 Minor cleanup of README. 2013-03-09 13:37:09 +01:00
jimt
b6af78b318 Merges translation functions into translate.go.
Runs gofmt on code.
2013-03-09 13:31:48 +01:00
jimt
5f066faee3 Fix issue 4. Removes debug output from pipe mode. 2013-01-26 21:06:46 +01:00
jimt
cd9bcb69b1 Fixes grammar issues in comments for generated functions. 2012-10-12 14:15:18 +02:00
jimt
015755bcf8 Fixes some inconsistencies in README. 2012-09-04 17:15:15 +02:00
jimt
fea0373680 Merge pull request #3 from ajhager/master
Fix Writers returning n-1 bytes written.
2012-07-14 11:20:48 -07:00
Joseph Hager
93063b64a3 Fix Writers returning n-1 bytes written.
ByteWriter and StringWriter were returning n-1 bytes written which was
causing io.Copy to error out with a ShortWrite. This would cause files
that were larger than the io.Copy internal buffer (32 * 1024) to stop
after the first chunk.
2012-07-13 14:57:50 -04:00