This repository has been archived by the owner on Dec 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
76 lines (63 loc) · 2.43 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '2.0.21'
ext.min_sdk_version = 21
ext.compile_sdk_version = 32
ext.target_sdk_version = 32
ext.group_id = 'software.tingle'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.6.0'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}
allprojects {
repositories {
google()
mavenCentral()
}
}
ext.getPublishVersion = { -> return System.getenv("VERSION_NAME") ?: "1.0-SNAPSHOT" }
ext.getPublishUsername = { -> return System.getenv("PUBLISHING_USERNAME") ?: "" }
ext.getPublishPassword = { -> return System.getenv("PUBLISHING_PASSWORD") ?: "" }
ext.getPublishStagingProfileId = { -> return System.getenv("PUBLISHING_PROFILE_ID") ?: "" }
ext.getPublishUrl = { -> return System.getenv("PUBLISHING_URL") ?: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" }
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID")
ext["signing.password"] = System.getenv("SIGNING_PASSWORD")
// If the key content is in an environmental var, write it to "tmp/key.gpg" and update
// ext['signing.secretKeyRingFile'] to point to it
def keyContent = System.getenv("SIGNING_KEY")
if (keyContent != null) {
def tempDirectory = new File("$rootProject.rootDir/tmp")
mkdir tempDirectory
def keyFile = new File("$tempDirectory/key.gpg")
keyFile.createNewFile()
def os = keyFile.newDataOutputStream()
os.write(keyContent.decodeBase64())
os.close()
keyContent = ''
ext['signing.secretKeyRingFile'] = keyFile.absolutePath
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId = getPublishStagingProfileId()
username = getPublishUsername()
password = getPublishPassword()
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}