forked from openmobilehub/omh-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
67 lines (56 loc) · 2.21 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
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version "2.0.1" apply false
id("com.github.hierynomus.license") version "0.16.1"
}
downloadLicenses {
includeProjectDependencies = true
dependencyConfiguration = "debugRuntimeClasspath"
}
subprojects {
repositories {
mavenCentral()
google()
maven("https://s01.oss.sonatype.org/content/groups/staging/")
}
}
tasks.register("installPrePushHook", Copy::class) {
from("tools/scripts/pre-push")
into(".git/hooks")
fileMode = 0b000_111_111_111
}
tasks.register("installPreCommitHook", Copy::class) {
from("tools/scripts/pre-commit")
into(".git/hooks")
fileMode = 0b000_111_111_111
}
tasks {
val installPrePushHook by existing
val installPreCommitHook by existing
getByName("prepareKotlinBuildScriptModel").dependsOn(installPrePushHook)
getByName("prepareKotlinBuildScriptModel").dependsOn(installPreCommitHook)
}
val ossrhUsername by extra(getValueFromEnvOrProperties("OSSRH_USERNAME"))
val ossrhPassword by extra(getValueFromEnvOrProperties("OSSRH_PASSWORD"))
val mStagingProfileId by extra(getValueFromEnvOrProperties("SONATYPE_STAGING_PROFILE_ID"))
val signingKeyId by extra(getValueFromEnvOrProperties("SIGNING_KEY_ID"))
val signingPassword by extra(getValueFromEnvOrProperties("SIGNING_PASSWORD"))
val signingKey by extra(getValueFromEnvOrProperties("SIGNING_KEY"))
// Set up Sonatype repository
nexusPublishing {
repositories {
sonatype {
stagingProfileId.set(mStagingProfileId.toString())
username.set(ossrhUsername.toString())
password.set(ossrhPassword.toString())
// Add these lines if using new Sonatype infra
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
fun getValueFromEnvOrProperties(name: String): Any? {
val localProperties = gradleLocalProperties(rootDir)
return System.getenv(name) ?: localProperties[name]
}