-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
119 lines (100 loc) · 3.07 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
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'codenarc'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.5
group = 'com.nagternal.groovy'
version = '0.1'
defaultTasks = ['build']
repositories {
mavenCentral()
}
dependencies {
compile('org.codehaus.groovy:groovy:2.1.5',
'org.clojure:clojure:1.5.1')
testCompile group: 'junit', name: 'junit', version: '4.+'
}
codenarc {
configFile = file("${project.projectDir}/config/codenarc/codenarc.groovy")
}
jar {
manifest {
attributes 'Implementation-Title': 'Groovy Clojure Extension', 'Implementation-Version': version
}
}
task groovydocJar(type: Jar) {
classifier = 'javadoc'
from groovydoc
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives groovydocJar
archives sourcesJar
}
signing {
if (hasProperty('signing.password')) {
sign configurations.archives
}
}
def isDevBuild
def isCiBuild
def isReleaseBuild
def sonatypeRepositoryUrl
//set build variables based on build type (release, continuous integration, development)
if (hasProperty('release')) {
isReleaseBuild = true
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
} else if (hasProperty("ci")) {
isCiBuild = true
version += "-SNAPSHOT"
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
} else {
isDevBuild = true
}
uploadArchives {
repositories {
mavenDeployer {
if(isReleaseBuild) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
if (isDevBuild) {
repository(url: "file://localhost/tmp/myRepo/")
}
else {
repository(url: sonatypeRepositoryUrl) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
pom.project {
name 'groovy=clojure'
packaging 'jar'
description 'groovy-clojure is a library for interop between Groovy and Clojure'
url 'https://github.com/Bijnagte/groovy-clojure'
scm {
url 'scm:git@github.com:Bijnagte/groovy-clojure.git'
connection 'scm:git@github.com:Bijnagte/groovy-clojure.git'
developerConnection 'scm:git@github.com:Bijnagte/groovy-clojure.git'
}
licenses {
license {
name 'The MIT License (MIT)'
}
}
developers {
developer {
id 'Bijnagte'
name 'Dylan Bijnagte'
}
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.8'
}