-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
build.gradle.kts
81 lines (74 loc) · 2.61 KB
/
build.gradle.kts
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("maven-publish")
id("com.github.ben-manes.versions") version "0.51.0"
id("net.ossindex.audit") version "0.4.11"
id("io.freefair.maven-central.validate-poms") version "8.10.2"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
val dependencyVersions = listOf(
"com.squareup.okio:okio-jvm:3.9.1",
"net.bytebuddy:byte-buddy:1.15.10",
"net.bytebuddy:byte-buddy-agent:1.15.10",
"org.apache.commons:commons-compress:1.27.1",
"org.apache.commons:commons-lang3:3.17.0",
"org.codehaus.groovy:groovy:3.0.22",
"org.codehaus.groovy:groovy-json:3.0.22",
"org.apache.groovy:groovy:4.0.23",
"org.apache.groovy:groovy-json:4.0.23",
"org.jetbrains:annotations:26.0.1",
"org.junit:junit-bom:5.11.3",
)
val dependencyVersionsByGroup = mapOf<String, String>()
subprojects {
repositories {
// mavenLocal()
// fun findProperty(s: String) = project.findProperty(s) as String?
// listOf(
// "docker-client/*"
// ).forEach { repo ->
// maven {
// name = "github"
// setUrl("https://maven.pkg.github.com/$repo")
// credentials {
// username = System.getenv("PACKAGE_REGISTRY_USER") ?: findProperty("github.package-registry.username")
// password = System.getenv("PACKAGE_REGISTRY_TOKEN") ?: findProperty("github.package-registry.password")
// }
// }
// }
mavenCentral()
}
}
allprojects {
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force(dependencyVersions)
eachDependency {
val forcedVersion = dependencyVersionsByGroup[requested.group]
if (forcedVersion != null) {
useVersion(forcedVersion)
}
}
// https://docs.gradle.org/current/userguide/resolution_rules.html
dependencySubstitution {
substitute(module("org.bouncycastle:bcpkix-jdk15on"))
.using(module("org.bouncycastle:bcpkix-jdk18on:1.79"))
}
}
}
}
fun findProperty(s: String) = project.findProperty(s) as String?
val isSnapshot = project.version == "unspecified"
nexusPublishing {
repositories {
if (!isSnapshot) {
sonatype {
// 'sonatype' is pre-configured for Sonatype Nexus (OSSRH) which is used for The Central Repository
stagingProfileId.set(System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: findProperty("sonatype.staging.profile.id")) //can reduce execution time by even 10 seconds
username.set(System.getenv("SONATYPE_USERNAME") ?: findProperty("sonatype.username"))
password.set(System.getenv("SONATYPE_PASSWORD") ?: findProperty("sonatype.password"))
}
}
}
}
//project.apply("debug.gradle.kts")