-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
149 lines (138 loc) · 4.67 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
plugins {
id 'java-library'
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
}
group = 'org.bytedeco'
version = '1.5.10'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
dependencies {
api "org.bytedeco:javacpp:$version"
testImplementation 'junit:junit:4.13.2'
}
gradlePlugin {
// need to sign before publishing
automatedPublishing = false
plugins {
build {
id = 'org.bytedeco.gradle-javacpp-build'
implementationClass = 'org.bytedeco.gradle.javacpp.BuildPlugin'
}
platform {
id = 'org.bytedeco.gradle-javacpp-platform'
implementationClass = 'org.bytedeco.gradle.javacpp.PlatformPlugin'
}
}
}
jar {
manifest {
attributes 'Implementation-Title': 'Gradle JavaCPP',
'Implementation-Vendor': 'Bytedeco',
'Implementation-Version': project.version,
'Specification-Title': 'Gradle JavaCPP',
'Specification-Vendor': 'Bytedeco',
'Specification-Version': project.version
}
}
javadoc {
options.memberLevel = JavadocMemberLevel.PRIVATE
options.links = ['https://docs.oracle.com/javase/8/docs/api',
'https://docs.gradle.org/current/javadoc',
'http://bytedeco.org/javacpp/apidocs',
'http://www.slf4j.org/apidocs',
'http://junit.org/junit4/javadoc/4.13.2']
}
java {
withJavadocJar()
withSourcesJar()
}
def pomClosure = {
name = 'Gradle JavaCPP'
delegate.description = 'Gradle plugins to automate the build process of JavaCPP and JavaCV'
url = 'http://bytedeco.org/gradle-javacpp/'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
license {
name = 'GNU General Public License (GPL) version 2, or any later version'
url = 'http://www.gnu.org/licenses/'
distribution = 'repo'
}
license {
name = 'GPLv2 with Classpath exception'
url = 'http://www.gnu.org/software/classpath/license.html'
distribution = 'repo'
}
}
developers {
developer {
id = 'saudet'
name = 'Samuel Audet'
email = 'samuel.audet@gmail.com'
}
}
scm {
url = 'https://github.com/bytedeco/gradle-javacpp'
connection = 'scm:git:git://github.com/bytedeco/gradle-javacpp.git'
developerConnection = 'scm:git:ssh://git@github.com/bytedeco/gradle-javacpp.git'
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom pomClosure
}
buildPluginMarkerMaven(MavenPublication) {
groupId gradlePlugin.plugins.build.id
artifactId gradlePlugin.plugins.build.id + ".gradle.plugin"
pom pomClosure
pom.withXml {
def dependency = asNode().appendNode('dependencies').appendNode('dependency')
dependency.appendNode('groupId', group)
dependency.appendNode('artifactId', rootProject.name)
dependency.appendNode('version', version)
}
}
platformPluginMarkerMaven(MavenPublication) {
groupId gradlePlugin.plugins.platform.id
artifactId gradlePlugin.plugins.platform.id + ".gradle.plugin"
pom pomClosure
pom.withXml {
def dependency = asNode().appendNode('dependencies').appendNode('dependency')
dependency.appendNode('groupId', group)
dependency.appendNode('artifactId', rootProject.name)
dependency.appendNode('version', version)
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username System.getenv('CI_DEPLOY_USERNAME')
password System.getenv('CI_DEPLOY_PASSWORD')
}
}
}
}
signing {
useGpgCmd()
if (!version.endsWith('SNAPSHOT')) {
sign publishing.publications.mavenJava
sign publishing.publications.buildPluginMarkerMaven
sign publishing.publications.platformPluginMarkerMaven
}
}