-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
executable file
·114 lines (86 loc) · 2.61 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
defaultTasks 'full'
ext {
resumeBase = 'resume'
portfolioBase = 'portfolio'
}
project.ext {
rawDirectory = 'raw'
cookedDirectory = 'cooked'
resumeLatexFile = resumeBase + '.tex'
resumePdfFile = resumeBase + '.pdf'
portfolioLatexFile = portfolioBase + '.tex'
portfolioPdfFile = portfolioBase + '.pdf'
}
task pdflatexResume1(type: Exec) {
outputs.upToDateWhen{false}
workingDir project.rawDirectory
standardOutput = new ByteArrayOutputStream() // stops output to STDOUT
commandLine 'pdflatex', project.resumeBase
}
task pdflatexResume2(type: Exec) {
outputs.upToDateWhen{false}
workingDir project.rawDirectory
standardOutput = new ByteArrayOutputStream() // stops output to STDOUT
commandLine 'pdflatex', project.resumeBase
}
task cookResume() {
dependsOn pdflatexResume1, pdflatexResume2
doFirst {
println "Cooking $project.resumeLatexFile in /$project.rawDirectory."
}
outputs.file file("$project.rawDirectory/$project.resumePdfFile")
doLast {
println "Cooked $project.resumeLatexFile to $project.resumePdfFile."
}
}
task pdflatexPortfolio1(type: Exec) {
outputs.upToDateWhen{false}
workingDir project.rawDirectory
standardOutput = new ByteArrayOutputStream() // stops output to STDOUT
commandLine 'pdflatex', project.portfolioBase
}
task pdflatexPortfolio2(type: Exec) {
outputs.upToDateWhen{false}
workingDir project.rawDirectory
standardOutput = new ByteArrayOutputStream() // stops output to STDOUT
commandLine 'pdflatex', project.portfolioBase
}
task cookPortfolio() {
dependsOn pdflatexPortfolio1, pdflatexPortfolio2
doFirst {
println "Cooking $project.portfolioLatexFile in /$project.rawDirectory."
}
outputs.file file("$project.rawDirectory/$project.portfolioPdfFile")
doLast {
println "Cooked $project.portfolioLatexFile to $project.portfolioPdfFile."
}
}
task deliverResume(type: Copy) {
outputs.upToDateWhen{false}
from cookResume
into project.cookedDirectory
doLast {
println "Delivered $project.resumePdfFile to /$project.cookedDirectory."
}
}
task deliverPortfolio(type: Copy) {
outputs.upToDateWhen{false}
from cookPortfolio
into project.cookedDirectory
doLast {
println "Delivered $project.portfolioPdfFile to /$project.cookedDirectory."
}
}
task flush(type: Delete) {
dependsOn deliverResume, deliverPortfolio
outputs.upToDateWhen{false}
delete {
fileTree(dir: project.rawDirectory, excludes: ['**/*.tex', '**/*.cls', 'portfolioImages/*.*'])
}
doLast {
println "Flushed /$project.rawDirectory of temporary $resumeBase and $portfolioBase files."
}
}
task full {
dependsOn flush
}