summaryrefslogtreecommitdiff
path: root/build.gradle
blob: 6b6b35bddd2d3c952d5587dae4f3c7b031cbc903 (plain) (blame)
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
description = 'A Scala library of string metrics and phonetic algorithms.'
group = 'com.rockymadden.stringmetric'
version = '0.19.1'

ext.scm = 'scm:git@github.com:rockymadden/stringmetric.git'
ext.url = 'http://rockymadden.com/stringmetric/'

allprojects {
	apply plugin: 'idea'
}

subprojects {
	apply plugin: 'maven'
	apply plugin: 'scala'
	apply plugin: 'signing'

	compileScala {
		compileScala.scalaCompileOptions.additionalParameters = ['-optimise', '-target:jvm-1.6', '–Xdisable-assertions']
	}

	compileTestScala {
		compileTestScala.scalaCompileOptions.additionalParameters = ['-target:jvm-1.6']
	}

	dependencies {
		compile 'org.scala-lang:scala-compiler:2.10.0'
		compile 'org.scala-lang:scala-library:2.10.0'

		scalaTools 'org.scala-lang:scala-compiler:2.10.0'
		scalaTools 'org.scala-lang:scala-library:2.10.0'

		testCompile 'junit:junit:4.11'
		testCompile 'org.scalatest:scalatest_2.10.0:2.0.M5'
	}

	repositories {
		mavenCentral()
	}

	def isMavenDeployable = hasProperty('mavenRepositoryUrl') && hasProperty('mavenRepositoryUsername') && hasProperty('mavenRepositoryPassword')

	if (isMavenDeployable) {
		signing {
			sign configurations.archives
		}

		task scaladocJar(type: Jar, dependsOn: scaladoc) {
			classifier = 'javadoc'
			from "${project.buildDir}/docs/scaladoc"
		}

		task sourceJar(type: Jar, dependsOn: classes) {
			classifier = 'sources'
			from sourceSets.main.allSource
		}

		artifacts {
			archives jar
			archives scaladocJar
			archives sourceJar
		}

		uploadArchives {
			repositories {
				mavenDeployer {
					beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

					repository(url: mavenRepositoryUrl) {
						authentication(userName: mavenRepositoryUsername, password: mavenRepositoryPassword)
					}

					pom.project {
						description "${parent.project.description}"
						groupId "${parent.project.group}"
						name "${project.name}"
						packaging 'jar'
						url "${parent.project.url}"
						version "${parent.project.version}"

						developers {
							developer {
								id 'rockymadden'
								name 'Rocky Madden'
							}
						}
		 
						licenses {
							license {
								name 'Apache License v2.0'
								url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
								distribution 'repo'
							}
						}

						scm {
							url "${parent.project.scm}"
							connection "${parent.project.scm}"
						}
					}
				}
			}
		}
	}
}