Java resource bundle to json converter
npm install grunt-resource-json>A grunt task for converting java resource bundles to json.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the
Getting Started guide, as it explains how to create
a Gruntfile as well as install and use Grunt plugins.
Once you're familiar with that process, you may install this plugin with this command:
``shell`
npm install grunt-resource-json --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-resource-json');
command._Task targets, files and options may be specified according to the Grunt Configuring tasks guide.
$3
#### key_mapper
Type:
Function
Default: nullSpecified function will be invoked to provide additional key to group properties from a single file.
Null value means that no additional key will be provided.
$3
#### Simple conversion
In this example, running
grunt resource_json will convert the two specified source files (in order) to json, merge them and write the output to dist/built.json.`js
// Project configuration.
grunt.initConfig({
resource_json: {
dist: {
src: ["test/fixtures/multiple_files_no_key_mapper/1", "test/fixtures/multiple_files_no_key_mapper/2"],
dest: 'dist/build.json'
},
}
});
`#### Key mapper function
In this example, running
grunt resource_json will convert the two specified source files (in order) to jsons with addtional key, merge them and write the output to dist/built.json.`js
// Project configuration.
var path = require('path');grunt.initConfig({
resource_json: {
dist: {
options: {
key_mapper: path.basename
},
src: ["test/fixtures/multiple_files_no_key_mapper/1", "test/fixtures/multiple_files_no_key_mapper/2"],
dest: 'dist/build.json'
}
},
});
`` * 2014-11-29 v0.1.0 First version.