-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
90 lines (79 loc) · 1.97 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* Goslings - Git Repository Visualizer
* https://github.com/kaitoy/goslings
* MIT licensed
*
* Copyright (C) 2016 Kaito Yamada
*/
buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "com.moowork.gradle:gradle-node-plugin:${nodePluginVer}"
}
}
allprojects {
version = '0.0.1'
}
project(':goslings-client') {
apply plugin: 'com.moowork.node'
node {
version = nodeVer
yarnVersion = yarnVer
download = true
}
def logsDir = file 'logs'
def log = new File(logsDir, 'build.log')
def errLog = new File(logsDir, 'build.err.log')
def lsep = System.properties['line.separator']
def cacheDir = file '.gradle'
def buildDir = file 'dist'
def nodeModsDir = file 'node_modules'
if (!logsDir.exists()) {
logsDir.mkdir()
}
else {
delete log
delete errLog
}
yarnSetup {
execOverrides {
it.standardOutput = new FileOutputStream(log, true)
it.errorOutput = new FileOutputStream(errLog, true)
}
doFirst { log << "### ${name} ###${lsep}" }
}
yarn {
execOverrides {
it.standardOutput = new FileOutputStream(log, true)
it.errorOutput = new FileOutputStream(errLog, true)
}
doFirst { log << "### ${name} ###${lsep}" }
}
task build(type: YarnTask, dependsOn: yarn) {
description "Build ${project.name}."
args = ['run', devBuild ? 'devBuild' : 'build']
execOverrides {
it.standardOutput = new FileOutputStream(log, true)
// it.errorOutput = new FileOutputStream(errLog, true)
}
inputs.property 'devBuild', devBuild
inputs.dir nodeModsDir
inputs.dir 'src'
inputs.file 'package.json'
inputs.file 'webpack.config.js'
outputs.dir buildDir
doFirst { log << "### ${name} ###${lsep}" }
}
task clean {
doLast{
delete cacheDir, logsDir, nodeModsDir, buildDir
}
}
}
if (gradle.startParameter.taskNames.contains('genScript')) {
apply from: 'gradle/genScript.gradle'
}