forked from michel-kraemer/underline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (84 loc) · 2.72 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
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'signing'
version = '1.0.0'
group = 'de.undercouch'
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.12'
}
jar {
// include license into jar
from 'LICENSE.txt'
}
task wrapper(type: Wrapper) {
gradleVersion = '2.8'
}
// package javadoc into a jar file
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
classifier = 'javadoc'
}
// package source into a jar file
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
// define artifacts for upload
artifacts {
archives jar
archives packageJavadoc
archives packageSources
}
// sign all artifacts
signing {
required { gradle.taskGraph.hasTask(uploadArchives) }
sign configurations.archives
}
// remove test dependencies from configuration-to-scope mapping
// this also removes them from the maven pom file
conf2ScopeMappings.mappings.remove(configurations.testCompile)
uploadArchives {
repositories {
mavenDeployer {
// sign artifacts before upload
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// upload to sonatype OSS
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: this.hasProperty('sonatypeUsername') ? sonatypeUsername : '',
password: this.hasProperty('sonatypePassword') ? sonatypePassword : '')
}
// pom file details
pom.project {
name 'underline'
packaging 'jar'
description 'A Git-like command-line parser with no strings attached'
url 'http://www.michel-kraemer.com'
scm {
url 'scm:git:git://github.com/michel-kraemer/underline.git'
connection 'scm:git:git://github.com/michel-kraemer/underline.git'
developerConnection 'scm:git:git://github.com/michel-kraemer/underline.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'michel-kraemer'
name 'Michel Kraemer'
email 'michel@undercouch.de'
}
}
}
}
}
}