-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/create gradle page plugin #5
Conversation
8fe93e2
to
ae36fb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Just a small comment
|
||
project.node { | ||
version = '8.9.4' | ||
npmVersion = '5.6.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to be able to configure the versions of node and npm to use in build.gradle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we can do it out of the box with
node {
version = '8.9.4'
npmVersion = '5.6.0'
}
otherwise you need to add an extension for your plugin
Anyway sounds like a better idea to specify this in build.gradle instead of plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class NpmPagePlugin extends PagePlugin { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ This seems useless to me. I believe this should be done in PagePlugin
and ReactPagePlugin
override implementDistribution
contents { | ||
from('resources') { into '/' } | ||
from('build') { | ||
exclude 'distributions' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ You'll have trouble with this approach since some things will be added to build
directory (example for tests)
outputs.dirs('node_modules') | ||
} | ||
|
||
def buildNpm = project.task( [type: com.moowork.gradle.node.npm.NpmTask, dependsOn: project.tasks.npm_install] ,'buildNpm') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would name it 'buildFrontend' or 'buildPage'
|
||
def cleanNpm = project.task([:], 'cleanNpm') { | ||
doFirst { | ||
project.delete 'dist' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will not fit with ReactPlugin
Overall I think that we need a plugin extension to configure:
|
Although I think the plugin is a good idea I would rather make it work first with a standard gradle build, then improve it by implementing a plugin. Anyway this should definitively be used by ici module and published in bonita-dev-tools Furthermore, keep in mind that since react-script build in |
* Use processId filter from url * add tests * Update page version covers [RUNTIME-1011](https://bonitasoft.atlassian.net/browse/RUNTIME-1011)
* Use processId filter from url * add tests * Update page version covers [RUNTIME-1011](https://bonitasoft.atlassian.net/browse/RUNTIME-1011)
closes BS-18048