we are developing an application consisting of a f...
# gradle
t
we are developing an application consisting of a frontend and a backend part. the frontend aprt is started via
npm start
and the backend part can be startet via
./gradlew bootRun
. to ease start of the whole application i'd like to provide a gradle task which would start both. while starting each part alone is wasy, is there a way to start both in parallel with a single task? How would this tasks look like?
t
add a task
startFrontend
for
npm start
in Gradle (https://docs.gradle.org/current/dsl/org.gradle.api.tasks.Exec.html) and then add following task:
Copy code
task startAll(dependsOn: ['bootRun', 'startFrontend'])
t
that doesn;t work because both tasks must run in parallel - which is impossible that way, as both tasks will run indefinitly
as i said before we explicitly disabled parallel runs as it sometimes caused errors for us
t
but you can pass
--parallel
for this case
t
true, but still kind of ugly in my eyes 😉 i'd love if i could convince gradle to always run THESE TWO and only these two tasks in paralell
t
as far as I know there is no such way if you disable parallel builds
t
allright. thank you 🙂
what i just realized: when i kill gradle
node
won't stop running. is that a gradle or a node problem?
t
which way are you running
node
?
t
i'm using
<https://github.com/srs/gradle-node-plugin>
s
NpmTask
which in the end will run
npm start
t
funny. thanks for googling for me 😉