forked from sysgears/grain-theme-business
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
99 lines (81 loc) · 2.24 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
apply plugin: 'maven'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'com.sysgears.grain'
version = '0.4.0'
defaultTasks 'preview'
ext {
mainClassName = 'com.sysgears.grain.Main'
compatibilityVersion = JavaVersion.VERSION_1_5
}
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
clean.doLast { ant.delete(dir: '.cache'); ant.delete(dir: 'target') }
buildscript {
project.ext {
grainProps = new Properties()
grainProps.load(new FileInputStream("$project.projectDir/application.properties"))
grainVersion = grainProps.getProperty('grain.version')
if (!project.grainVersion) {
throw new RuntimeException('Grain version is not set in properties file')
}
}
}
configurations.all {
exclude group: 'commons-logging'
exclude group: 'rhino'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/groups/public/'
}
}
dependencies {
compile "com.sysgears.grain:grain:$project.grainVersion"
compile 'org.codehaus.groovy:groovy:2.1.2'
}
sourceSets {
main {
groovy {
srcDirs = ['theme/src']
}
}
}
project.ext {
classpath = sourceSets.main.runtimeClasspath
}
task gendeps {
doLast {
def classpath = project.classpath.files
def depFile = new File(".site-${project.grainVersion}.dep")
depFile.withWriter { writer ->
classpath.findAll { it.name.endsWith('.jar') }.sort {
!it.name.endsWith("grain-${project.grainVersion}.jar")
}.each {
writer.append(it.toString()).append('\n')
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}
idea {
module {
excludeDirs = ['.cache', '.idea', '.gradle', '.nb-gradle', '.settings', 'bin', 'out', 'target', 'gradle'].collect { file(it) }
}
}
task generate(type: JavaExec) {
logging.captureStandardOutput LogLevel.INFO
classpath sourceSets.main.runtimeClasspath
main = mainClassName
args name
}
task preview(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = mainClassName
args name
}