2.0.1 • Published 3 years ago

gradle-to-js v2.0.1

Weekly downloads
52,269
License
Apache-2.0
Repository
github
Last release
3 years ago

gradle-to-js

NPM Version Build Status

What's this gradle-to-js thing?

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.

Files

var g2js = require('gradle-to-js/lib/parser');
g2js.parseFile('path/to/buildfile').then(function(representation) {
  console.log(representation);
});

Strings

var g2js = require('gradle-to-js/lib/parser');
g2js.parseText('key "value"').then(function(representation) {
  console.log(representation);
});

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.

./index.js test/sample-data/small.build.gradle
{
  "testblock": {
    "key1": "value1",
    "key2": "value2",
    "nestedKey": {
      "key3": "value3",
      "key4": "value4",
      "key5": {
        "key6": "value6"
      }
    }
  },
  "testblock2": {
    "key1": "value1",
    "key2": "value2"
  },
  "testblock3": "not really"
}

Author

Karl Lindmark

License

Apache 2.0

fork-appcenter-cli@infinitebrahmanuniverse/nolb-gradjotive-cli@everything-registry/sub-chunk-1782androidbuildserverdsokal-eas-cliswan-station-customer@dplus/rn-publish@cresc/cli@contrast/contrast@mandarisllc/rn-bugsnag-sourcemap-toolsspring-boot-dependency-checkerstein-code-push@anakz/backstage-plugin-library-check-backend@bazumax/appcenter-cli@bycedric/some-cli-test@capacitor/trampoline@capacitor/project@cogwheel-dev/project@lamantin/fastpush@littleseven/code-push-cli@nativescript-community/set-version@elastic.io/component-build-helper@mattoakes/appcenter-cli@kid_ken/code-push-cli@ohos/hpm-cli-x2h@rigor789/trapezedev-project@shm-open/code-push-climt-code-push-clinativescript-set-versionnativescript-app-sync-clinativescript-app-sync-cli8nativescript-code-push-clioss-license-checkparsers-p-customerreact-native-egenie-codepushscraper-utilsscraper-utils2react-native-myswitchrn-scaffoldreact-native-archivesreliable-clirupush-clireact-native-code-push-diffreact-native-simbootreact-native-set-versionreact-native-version-setreact-native-versionerreact-native-update-clireact-native-pu-hwnextpush-clipush-lewanrn-codepushrn-structurernfb-cligradle-version-updaterhsk-code-push-clilicense-lookuplibrarian-parsersmaxleap-hotload-cli@ts-pipeline/step-increment@szdziedzic/eas-cli@teammaestro/code-push-cli@teamslogup/code-push-cli@thanhvd/code-push-cli@trapezedev/project@varghesethomase/appcenter-cli@yiheyang/react-native-set-version@strawberry-code/react-native-set-version@suntree/taro-pushy-cliandroid-cliappcenter-cliappcenter-cli-androidappcenter-cli-ssgappcenter-cli-v2code-push-clicode-push-cli-rcode-push-cli-smallworldcode-push-cli-v2code-push-cli-yxcodepush-helpereas-clidroidarchidx-scannerern-corefdroid-toolsgenerator-fabric
2.0.1

3 years ago

2.0.0

6 years ago

1.2.1

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

1.0.0

9 years ago