gradle-to-js is a quick & dirty Gradle build file to JavaScript object parser. It is quick & dirty in the sense that it doesn't give you an exact replica of whatever the build file represents during runtime, as evaluations and similar bits are (currently) too much of a hassle to accurately represent while parsing.
Installation
Simply run the following command to include it into your project:
npm install gradle-to-js --save
Usage
As a module
Using gradle-to-js as a module, you can parse both strings and files as seen below.
The promise will eventually resolve an object matching the build file structure and values.
Using the CLI
You can also use the module directly from the CLI, and get a json representation out of it. Nifty ey? Currently only supporting files from this direction.
请发表评论