forked from TNG/keycloak-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (51 loc) · 1.89 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import static groovy.io.FileType.FILES
plugins {
id 'com.github.node-gradle.node' version '7.0.1'
}
def nodeDir = 'bin/nodejs'
def yarnDir = 'bin/yarn'
def nodeVersionString = '18.18.0'
node {
// Version of node to use.
version = nodeVersionString
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'https://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file(nodeDir)
// Set the work directory for Yarn
yarnWorkDir = file(yarnDir)
// Set the work directory where node_modules should be located
nodeProjectDir = file("${project.projectDir}")
}
yarn_build {
dependsOn yarn_install
def files = []
projectDir.traverse(type: FILES, nameFilter: ~/.*\.js(on){0,1}$/) {
files << it
}
inputs.files(fileTree("$projectDir/src"), fileTree("$projectDir/public"), fileTree("$projectDir/tests"), files)
outputs.dir("$projectDir/dist")
}
tasks.register('copyNode', Copy) {
dependsOn nodeSetup
if (org.gradle.internal.os.OperatingSystem.current().isLinux()) {
from "${projectDir}/${nodeDir}/node-v${nodeVersionString}-linux-x64/"
into "${projectDir}/${nodeDir}/node/"
} else if (org.gradle.internal.os.OperatingSystem.current().isMacOsX()) {
from "${projectDir}/${nodeDir}/node-v${nodeVersionString}-darwin-x64/"
into "${projectDir}/${nodeDir}/node/"
} else if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
from "${projectDir}/${nodeDir}/node-v${nodeVersionString}-win-x64/"
into "${projectDir}/${nodeDir}/node/"
}
}
yarnSetup.dependsOn copyNode
tasks.register('build') {
dependsOn yarn_build
}
yarn_e2e {
mustRunAfter ':example-integration-docker:composeUp'
}