-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
105 lines (93 loc) · 2.77 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
plugins {
id "java"
id "maven-publish"
id "com.timgroup.jarmangit" version "1.1.86"
}
ext {
githubUrl = "https://github.com/tim-group/simple-zmtp1"
}
group = "com.timgroup"
if (System.getenv("BUILD_NUMBER")) version = "1.0.${System.getenv('BUILD_NUMBER')}"
description = "A plausibly simple ZMTP/1.0 library"
jar {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'TIM Group',
'Implementation-Vendor-Id': project.group,
'Implementation-URL': githubUrl
)
}
}
tasks.withType(JavaCompile).all {
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
options.encoding = "UTF-8"
options.incremental = true
options.deprecation = true
}
repositories {
mavenCentral()
}
dependencies {
testCompile "junit:junit:4.12"
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
assemble.dependsOn(sourcesJar)
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
assemble.dependsOn(javadocJar)
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
repositories {
if (project.hasProperty("repoUrl")) {
maven {
name "nexus"
url "${project.repoUrl}/repositories/yd-release-candidates"
credentials {
username = project.repoUsername
password = project.repoPassword
}
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId project.ext.has('artifactId') ? project.ext.artifactId
: project == rootProject ? project.name
: rootProject.name + project.path.replace(':', '-')
from components.java
artifact(sourcesJar)
artifact(javadocJar)
pom.withXml {
asNode().children().last() + {
resolveStrategy = DELEGATE_FIRST
name project.ext.has('pomName') ? project.ext.pomName : project.name
description project.description
url githubUrl
licenses {
license {
name 'The BSD 2-Clause License'
url 'http://opensource.org/licenses/BSD-2-Clause'
distribution 'repo'
}
}
developers {
developer {
email '[email protected]'
}
}
}
}
}
}
}