summaryrefslogtreecommitdiff
path: root/stringmetric-core/build.gradle
blob: 312e6c04c98b7026c84beb420ee1f5ab190aeacb (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
105
106
107
108
109
110
111
112
113
apply plugin: 'maven'
apply plugin: 'signing'

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

dependencies {
	testCompile 'com.google.caliper:caliper:0.5-rc1'
}

sourceSets {
	benchmark {
		output.resourcesDir "${project.buildDir}/classes/benchmark"

		java {
			srcDir 'source/benchmark/java'
		}
		resources {
			srcDir 'source/benchmark/resource'
		}
		scala {
			srcDir 'source/benchmark/scala'
		}
	}
	main {
		output.resourcesDir "${project.buildDir}/classes/main"

		java {
			srcDir 'source/core/java'
		}
		resources {
			srcDir 'source/core/resource'
		}
		scala {
			srcDir 'source/core/scala'
		}
	}
	test {
		output.resourcesDir "${project.buildDir}/classes/test"

		java {
			srcDir 'source/test/java'
		}
		resources {
			srcDir 'source/test/resource'
		}
		scala {
			srcDir 'source/test/scala'
		}
	}
}

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}"
					}
				}
			}
		}
	}
}