-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.publishing.gradle
102 lines (89 loc) · 3.14 KB
/
build.publishing.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
subprojects {
apply plugin: 'maven-publish'
ext {
pub = [dev : [artifacts: ['jar',
'sourceJar',]],
full: [artifacts: ['jar',
'sourceJar',
'docJar',
'testJar',]],
]
pomConfig = {
name = project.description
description = project.description
url = 'https://www.opencypher.org'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
id = 'link'
name = 'The Link team'
email = '[email protected]'
url = 'https://www.opencypher.org'
}
}
scm {
url = 'https://github.com/opencypher/link'
}
}
}
publishing {
repositories {
maven {
name = 'buildDir'
url = "file://${rootProject.file(cfg.publishDir)}"
}
}
publications {
// We do not want to have dev and full publications for okapi-shade
if (project.name != "okapi-shade") {
dev(MavenPublication) {
from components.java
afterEvaluate {
pom pomConfig
artifacts = pub.dev.artifacts
.findResults { tasks.findByName(it) }
.findAll { it.enabled }
}
}
full(MavenPublication) {
from components.java
afterEvaluate {
pom pomConfig
artifacts = pub.full.artifacts
.findResults { tasks.findByName(it) }
.findAll { it.enabled }
}
}
}
// This publication is added only to get a `generatePomFileForJarPublication` task.
// We use that task to generate a pom.xml to be consumed by the Jar task.
// Without the pom.xml file our regular Jars, dependency resolution breaks when we shade them.
jar(MavenPublication) {
from components.java
}
}
}
jar {
from generatePomFileForJarPublication {
rename('pom-default.xml', "META-INF/maven/${project.group}/${project.name}/pom.xml")
}
}
if (project.name != "okapi-shade") {
// Convenience for quick publish to maven local
task devPublish {
group 'publishing'
description ' Publishes main jars to the local Maven repository.'
dependsOn tasks.publishDevPublicationToMavenLocal
}
}
// Task run by teamcity
task ci {
dependsOn tasks.check
dependsOn { tasks.publishFullPublicationToBuildDirRepository }
}
}