-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
62 lines (48 loc) · 1.9 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
plugins {
id 'base'
id "com.github.node-gradle.node" version "3.5.1"
}
node {
// Whether to download and install a specific Node.js version or not
// If false, it will use the globally installed Node.js
// If true, it will download node using above parameters
// Note that npm is bundled with Node.js
download = true
// Version of node to download and install (only used if download is true)
// It will be unpacked in the workDir
version = "18.16.0"
// Version of Pnpm to use
// Any Pnpm task first installs Pnpm in the pnpmWorkDir
// It uses the specified version if defined and the latest version otherwise (by default)
pnpmVersion = "8.3.1"
// Base URL for fetching node distributions
// Only used if download is true
// Change it if you want to use a mirror
// Or set to null if you want to add the repository on your own.
distBaseUrl = "https://nodejs.org/dist"
// Specifies whether it is acceptable to communicate with the Node.js repository over an insecure HTTP connection.
// Only used if download is true
// Change it to true if you use a mirror that uses HTTP rather than HTTPS
// Or set to null if you want to use Gradle's default behaviour.
allowInsecureProtocol = null
// The directory where Node.js is unpacked (when download is true)
workDir = file("${project.projectDir}/.gradle/nodejs")
// The directory where pnpm is installed (when a pnpm task is used)
pnpmWorkDir = file("${project.projectDir}/.gradle/pnpm")
}
task deleteDist(type: Delete){
delete "${project.projectDir}/dist/"
}
task pnpmBuild(type: PnpmTask) {
args = ['build']
mustRunAfter 'pnpmInstall'
}
task cleanFrontend {
dependsOn 'deleteDist'
}
task buildFrontend {
dependsOn 'pnpmInstall'
dependsOn 'pnpmBuild'
}
tasks.findByName('build').dependsOn 'buildFrontend'
tasks.findByName('clean').dependsOn 'cleanFrontend'