-
Notifications
You must be signed in to change notification settings - Fork 21
/
publish.gradle
88 lines (79 loc) · 3.06 KB
/
publish.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
configure([
project(':luajava'),
project(':lua51'),
project(':lua52'),
project(':lua53'),
project(':lua54'),
project(':luajit'),
project(':luaj'),
project(':jsr223')
]) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: project(':').file('javadoc.gradle')
apply from: project(':').file('pom.gradle')
java {
withSourcesJar()
withJavadocJar()
}
afterEvaluate { project ->
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
//noinspection GroovyImplicitNullArgumentCall
fromResolutionResult()
}
}
setPom(pom, '')
}
if (project.tasks.findByName('jnigen')) {
mavenPlatform(MavenPublication) {
artifactId = artifactId + '-platform'
if (project.tasks.findByName('jnigenJarNativesDesktop')) {
artifact jnigenJarNativesDesktop {}
}
if (project.tasks.findByName('jnigenJarNativesIOS')) {
artifact jnigenJarNativesIOS {}
}
// TODO: Add riscv64 to the list once Android NDK & jnigen supports RISC-V Android builds.
['arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86'].each { arch ->
if (project.tasks.findByName("jnigenJarNativesAndroid$arch")) {
artifact "jnigenJarNativesAndroid$arch" {}
}
}
setPom(pom, ' Native Libraries')
}
}
}
repositories {
maven {
name = 'OSSRH'
url = rootProject.version.toString().endsWith('-SNAPSHOT')
? 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
: 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
useInMemoryPgpKeys(
System.getenv("GPG_KEY_ID"),
System.getenv("GPG_SECKEY"),
System.getenv("GPG_PASSPHRASE"),
)
sign publishing.publications.mavenJava
if (project.tasks.findByName('jnigen')) {
sign publishing.publications.mavenPlatform
}
}
}
}