Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
81 lines (72 loc) · 2.48 KB
/
Copy pathbuild.gradle
File metadata and controls
81 lines (72 loc) · 2.48 KB
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
plugins {
id 'com.android.library' version '9.2.1' apply false
id 'com.diffplug.spotless' version '8.0.0'
}
spotless {
java {
target 'java/**/*.java'
googleJavaFormat('1.25.2')
}
}
tasks.register('format') {
group = 'formatting'
description = 'Format all SoLoader Java sources.'
dependsOn 'spotlessApply'
}
tasks.register('formatCheck') {
group = 'verification'
description = 'Check formatting of all SoLoader Java sources.'
dependsOn 'spotlessCheck'
}
def artifactVersions = ['ANNOTATION', 'NATIVELOADER', 'SOLOADER'].collect { artifact ->
def matcher = file("artifacts/${artifact}").text =~ /(?m)^VERSION\s*=\s*['"]([^'"]+)['"]/
if (!matcher.find()) {
throw new GradleException("Missing version in artifacts/${artifact}")
}
matcher.group(1)
}
if (artifactVersions.toSet().size() != 1) {
throw new GradleException("SoLoader artifact versions must match: ${artifactVersions}")
}
subprojects {
group = 'com.facebook.soloader'
version = artifactVersions[0]
def publishingProject = project
pluginManager.withPlugin('maven-publish') {
publishingProject.pluginManager.apply('signing')
publishing.repositories {
maven {
name = 'staging'
url = rootProject.layout.buildDirectory.dir('staging-deploy').get().asFile.toURI()
}
}
publishingProject.signing {
required = { publishingProject.hasProperty('signing.keyId') }
sign publishing.publications
}
publishing.publications.withType(MavenPublication).configureEach {
pom {
name = 'SoLoader'
description = publishingProject.description
url = 'https://github.com/facebook/soloader'
licenses {
license {
name = 'Apache-2'
url = 'https://github.com/facebook/soloader/blob/main/LICENSE'
}
}
developers {
developer {
id = 'facebook'
name = 'Facebook'
}
}
scm {
url = 'https://github.com/facebook/soloader.git'
connection = 'scm:git:https://github.com/facebook/soloader.git'
developerConnection = 'scm:git:git@github.com:facebook/soloader.git'
}
}
}
}
}