forked from sysgears/grain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
224 lines (188 loc) · 6.29 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
import java.security.MessageDigest
apply plugin: 'maven'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'signing'
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'org.eclipse.jgit:org.eclipse.jgit:3.1.0.201310021548-r' }
}
ext {
applicationProperties = new Properties()
applicationProperties.load(new FileInputStream("$project.projectDir/src/main/resources/application.properties"))
grainVersion = applicationProperties.getProperty('grain.version')
if (!grainVersion) { throw new RuntimeException('Grain version is not set in the properties file') }
title = 'Grain Static Website Building Framework'
url = 'http://www.sysgears.com/grain'
licenseName = 'Apache License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
localGHPagesRepoDir = '../grain.gh-pages'
localGHPagesRepoCanonicalPath = new File(localGHPagesRepoDir).canonicalPath
javaCompatibilityVersion = 1.6
mainClassName = 'com.sysgears.grain.Main'
}
group = 'com.sysgears.grain'
version = project.grainVersion
sourceCompatibility = project.javaCompatibilityVersion
targetCompatibility = project.javaCompatibilityVersion
defaultTasks 'build'
configurations.all {
exclude group: 'commons-logging'
exclude group: 'rhino'
}
configurations {
deployerJars
}
repositories {
mavenCentral()
}
dependencies {
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.2') {
exclude module: 'groovy'
}
compile 'net.sf.jpathwatch:jpathwatch:0.95'
compile 'org.eclipse.jetty:jetty-server:8.1.8.v20121106'
compile 'org.eclipse.jetty:jetty-servlet:8.1.8.v20121106'
compile 'javax.servlet:javax.servlet-api:3.0.1'
compile 'org.yaml:snakeyaml:1.11'
compile 'org.codehaus.gpars:gpars:1.0.0'
compile 'com.github.rjeschke:txtmark:0.9'
compile 'org.python:jython-standalone:2.7-b1'
compile 'org.jruby:jruby-core:1.7.3'
compile 'org.jruby:jruby-stdlib:1.7.3'
compile 'com.googlecode.htmlcompressor:htmlcompressor:1.5.2'
compile 'com.yahoo.platform.yui:yuicompressor:2.4.7'
compile 'commons-io:commons-io:2.4'
compile 'commons-cli:commons-cli:1.2'
compile 'org.codehaus.groovy:groovy-xml:2.1.2'
compile 'org.jsoup:jsoup:1.7.2'
compile('ch.qos.logback:logback-classic:1.0.13') {
exclude group: 'org.slf4j'
}
compile 'org.slf4j:jcl-over-slf4j:1.7.5'
compile 'oauth.signpost:signpost-core:1.2.1.2'
compile 'oauth.signpost:signpost-commonshttp4:1.2.1.2'
compile 'com.google.inject:guice:4.0-beta'
compile 'com.google.inject.extensions:guice-assistedinject:4.0-beta'
compile 'javax.inject:javax.inject:1'
compile 'org.codehaus.groovy:groovy-ant:2.2.1'
compile 'org.pegdown:pegdown:1.4.2'
testCompile('org.spockframework:spock-core:0.7-groovy-2.0') {
exclude module: 'groovy-all'
}
testCompile('org.spockframework:spock-guice:0.7-groovy-2.0') {
exclude module: 'groovy-all'
}
compile 'org.codehaus.groovy:groovy:2.2.1'
deployerJars 'org.apache.maven.wagon:wagon-ssh:2.2'
}
sourceSets {
main {
groovy {
srcDirs = ['src/main/groovy']
}
}
}
signing {
sign configurations.archives
}
task getToolsMD5Checksum {
def md5 = MessageDigest.getInstance('MD5')
file('tools').eachFileRecurse { file ->
if (file.isFile()) {
md5.update(file.bytes)
}
}
def messageDigest = md5.digest()
def sb = new StringBuilder()
messageDigest.each {
sb.append(String.format('%02x', it))
}
project.ext.toolsMD5 = sb.toString()
}
task createSharedManifest(dependsOn: getToolsMD5Checksum) {
project.ext.sharedManifest = manifest {
attributes 'Implementation-Title': project.title,
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-Rev': project.toolsMD5,
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Main-Class': project.mainClassName
}
}
jar {
manifest = project.manifest {
from sharedManifest
}
from(project.rootProject.projectDir) {
include 'tools/**'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from(sourceSets.main.allSource) {
exclude 'logback.xml'
}
}
task javadocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'javadoc'
from groovydoc.destinationDir
}
task groovydocJar(type: Jar, dependsOn: groovydoc) {
classifier = 'groovydoc'
from groovydoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
archives groovydocJar
archives jar
}
ext.pomConfiguration = {
name project.title
description '''Grain is a static web site building framework for Groovy that makes demanding static web site
implementation an intuitive and enjoyable task to do.'''
url project.url
inceptionYear '2013'
scm {
url 'https://github.com/sysgears/grain'
connection 'scm:https://github.com/sysgears/grain.git'
developerConnection 'scm:[email protected]:sysgears/grain.git'
}
licenses {
license {
name project.licenseName
url project.licenseUrl
distribution 'repo'
}
}
developers {
developer {
id 'sysgears'
name 'SysGears LLC'
email '[email protected]'
}
}
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
configuration = configurations.deployerJars
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') {
authentication(userName: System.getProperty('sonatypeUsername'), password: System.getProperty('sonatypePassword'))
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: System.getProperty('sonatypeUsername'), password: System.getProperty('sonatypePassword'))
}
pom.project(pomConfiguration)
}
}
idea {
module {
excludeDirs = ['.idea', '.gradle', 'build'].collect { file(it) }
}
}