-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
58 lines (43 loc) · 1.62 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "com.github.jruby-gradle:jruby-gradle-plugin:1.5.0"
}
}
// Adds 'assemble', 'check', 'build', and 'clean' tasks.
// See: https://docs.gradle.org/current/userguide/standard_plugins.html#sec:base_plugins
apply plugin: 'base'
apply plugin: 'com.github.jruby-gradle.base'
dependencies {
jrubyExec 'rubygems:jekyll:3.4.0'
// Without this, we get: LoadError: no such file to load -- bundler
jrubyExec 'rubygems:bundler:1.14.4'
}
ext {
source = file("src/main/jekyll/").absolutePath
destination = file("build/_site").absolutePath
commonFlags = [ '--source', source, '--destination', destination ]
}
import com.github.jrubygradle.JRubyExec
task jekyllBuild(type: JRubyExec, group: 'Jekyll', description: 'Build your site.') {
// Enable task to be UP-TO-DATE.
inputs.file source
outputs.file destination
script "jekyll"
scriptArgs "build"
scriptArgs commonFlags
// Consider enabling this to help us determine when pages need to be pushed to Nexus.
// A copy of .jekyll-metadata could be stored in the repo and then compared to the local file.
// See https://jekyllrb.com/docs/configuration/#incremental-regeneration
// scriptArgs "--incremental"
}
tasks.assemble.dependsOn tasks.jekyllBuild
task jekyllServe(type: JRubyExec, group: 'Jekyll', description: 'Serve your site locally.') {
// This task starts a server; it is never considered UP-TO-DATE.
outputs.upToDateWhen { false }
script "jekyll"
scriptArgs "serve"
scriptArgs commonFlags
}