mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-10-26 08:06:09 +01:00
Fix missing yarn on gradle run
This commit is contained in:
@@ -18,10 +18,13 @@ package com.cloudogu.scm
|
||||
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import com.moowork.gradle.node.NodeExtension
|
||||
|
||||
class IntegrationTestPlugin implements Plugin<Project> {
|
||||
|
||||
void apply(Project project) {
|
||||
project.plugins.apply("com.github.node-gradle.node")
|
||||
|
||||
def extension = project.extensions.create("scmServer", ScmServerExtension, project)
|
||||
|
||||
project.tasks.register('write-server-config', WriteServerConfigTask) {
|
||||
@@ -32,8 +35,11 @@ class IntegrationTestPlugin implements Plugin<Project> {
|
||||
it.extension = extension
|
||||
}
|
||||
|
||||
def nodeExt = NodeExtension.get(project)
|
||||
|
||||
project.tasks.register("startScmServer", RunTask) {
|
||||
it.extension = extension
|
||||
it.nodeExtension = nodeExt
|
||||
it.waitForCompletion = false
|
||||
it.frontend = false
|
||||
it.configFileDirectory = './src/main/resources'
|
||||
|
||||
@@ -49,6 +49,7 @@ class RunPlugin implements Plugin<Project> {
|
||||
}
|
||||
project.tasks.register("run", RunTask) {
|
||||
it.extension = extension
|
||||
it.nodeExtension = nodeExt
|
||||
dependsOn 'write-server-config', 'prepare-home', 'yarnSetup'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.cloudogu.scm
|
||||
|
||||
import com.moowork.gradle.node.task.NodeTask
|
||||
import com.moowork.gradle.node.NodeExtension
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
@@ -33,6 +34,9 @@ class RunTask extends DefaultTask {
|
||||
@Input
|
||||
boolean waitForCompletion = true
|
||||
|
||||
@Input
|
||||
NodeExtension nodeExtension
|
||||
|
||||
@Nested
|
||||
ScmServerExtension extension
|
||||
|
||||
@@ -56,6 +60,7 @@ class RunTask extends DefaultTask {
|
||||
@Option(option = 'configFileDirectory', description = 'Path to config file')
|
||||
String configFileDirectory = ''
|
||||
|
||||
|
||||
@TaskAction
|
||||
void exec() {
|
||||
List<Closure<Void>> actions = new ArrayList<>()
|
||||
@@ -146,10 +151,15 @@ class RunTask extends DefaultTask {
|
||||
}
|
||||
|
||||
private Closure<Void> createFrontend() {
|
||||
def yarnBinDir = nodeExtension.variant.yarnBinDir.getAbsolutePath()
|
||||
def nodeBinDir = nodeExtension.variant.nodeBinDir.getAbsolutePath()
|
||||
def path = yarnBinDir + File.pathSeparator + nodeBinDir + File.separator + System.getenv().get("PATH");
|
||||
|
||||
def frontend = project.tasks.create('boot-frontend', NodeTask) {
|
||||
script = new File(project.rootProject.projectDir, 'scripts/turbo-runner.js')
|
||||
args = ['run', 'serve', '--filter=@scm-manager/ui-webapp']
|
||||
environment = [
|
||||
'PATH': path,
|
||||
'NODE_ENV': 'development',
|
||||
'ANALYZE_BUNDLES': analyzeBundles
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user