-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
152 lines (135 loc) · 4.38 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
150
151
152
import org.bytedeco.gradle.javacpp.BuildTask
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "org.bytedeco.gradle-javacpp-build" version "$javacppVersion"
}
group = "org.bytedeco"
version = "11.2.0-$javacppVersion"
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
api "org.bytedeco:javacpp:$javacppVersion"
javacppPlatform "org.bytedeco:javacpp-platform:$javacppVersion"
javacppPlatform "org.bytedeco:gcc:$version:linux-x86_64"
testRuntimeOnly "org.bytedeco:javacpp:$javacppVersion:$javacppPlatform"
testImplementation "junit:junit:4.13.1"
}
tasks.withType(BuildTask) {
includePath = ["$buildDir/$javacppPlatform/install/include"]
linkPath = ["$buildDir/$javacppPlatform/install/lib"]
}
javacppBuildCommand {
buildCommand = ["bash", "build.sh"]
}
javacppBuildParser {
classOrPackageNames = ["org.bytedeco.gcc.presets.*"]
outputDirectory = file("src/gen/java/")
}
javacppBuildCompiler {
copyLibs = true
}
jar {
manifest {
attributes 'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' '),
'Implementation-Title': 'JavaCPP Presets for GCC',
'Implementation-Vendor': 'Bytedeco',
'Implementation-Version': version,
'Specification-Title': 'JavaCPP Presets for GCC',
'Specification-Vendor': 'Bytedeco',
'Specification-Version': version
}
}
javadoc {
failOnError = false
options.links = ["http://bytedeco.org/javacpp/apidocs"]
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
artifacts {
archives javadocJar
archives sourcesJar
}
def pomClosure = {
name = "Bytedeco GCC"
delegate.description = "Bytedeco JavaCPP presets for GCC"
url = "https://github.com/bytedeco/gcc/"
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 = "[email protected]"
}
developer {
id = "supergrecko"
name = "Mats Larsen"
email = "[email protected]"
}
}
scm {
url = "https://github.com/bytedeco/gcc"
connection = "scm:git:git://github.com/bytedeco/gcc.git"
developerConnection = "scm:git:ssh://[email protected]/bytedeco/gcc.git"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifacts = [jar, javacppJar, javadocJar, sourcesJar] + javacppBuild.existingArtifacts(configurations.javacppPlatform)
pom pomClosure
}
mavenJavacppPlatform(MavenPublication) {
groupId project.group
artifactId project.name + "-platform"
artifacts = [javacppPlatformJar, javacppPlatformJavadocJar, javacppPlatformSourcesJar]
pom pomClosure
pom.withXml javacppBuild.xmlAction(configurations.javacppPlatform)
}
}
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.mavenJavacppPlatform
}
}