srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
864 stars 212 forks source link

generate package.json from build.gradle definition #93

Open dsvensson opened 8 years ago

dsvensson commented 8 years ago

As both build.gradle and package.json wants version and project name, declaring the contents of package.json within build.gradle would be nice. Also makes the use of the typescript gradle plugin more coherent as the typescript dependency installed via npm would be declared in build.gradle. This is pretty much identical to what the bower plugin does, example as follows:

plugins {
    id 'com.craigburke.bower-installer' version '2.5.1'
}

bower {
    installBase = 'src/assets/bower' // <1>

    'angular'('1.3.x') {
        source 'angular.js' // <2>
    }

    'angular-animate'('1.3.x') {
        source 'angular-animate.js' >> '/angular/modules/' // <3>
    }

    'ui-router'('0.2.x') // <4>

    'bootstrap'('3.3.x') {
        source 'dist/css/*.min.css' >> 'styles/'
        source 'dist/fonts/**' >> 'fonts/'

        excludes 'jquery' // <5>
    }

    'animate.css'('https://github.com/daneden/animate.css.git') // <6>
}
srs commented 8 years ago

The way bower plugin does it looks pretty cool. Will investgate how we can do it in the node plugin. If you have any experimental code around this I will be happy to look at it.

dsvensson commented 8 years ago

Nopes, none, unfortunately. Realized I forgot to link to the bower gradle project, so here comes if you haven't found it already:

https://github.com/craigburke/bower-installer-gradle

srs commented 8 years ago

No worries, found it :-)