-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
77 lines (69 loc) · 2.58 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
import java.util.Properties
/**
* Note: To configure GitHub credentials, you have to do one of the following:
* <ul>
* <li>Add `githubUsername` and `githubAccessToken` to Global Gradle Properties</li>
* <li>Set `GITHUB_USERNAME` and `GITHUB_ACCESS_TOKEN` in your environment variables</li>
* <li>Create a `github.properties` file in your project folder with the following content:</li>
* </ul>
*
* <pre>
* githubUsername="YOUR_GITHUB_USERNAME"
* githubAccessToken="YOUR_GITHUB_ACCESS_TOKEN"
* </pre>
*/
val githubProperties = Properties().apply {
rootProject.file("github.properties").takeIf { it.exists() }?.inputStream()?.use { load(it) }
}
val githubUsername: String = rootProject.findProperty("githubUsername") as String? // Global Gradle Properties
?: githubProperties.getProperty("githubUsername") // github.properties file
?: System.getenv("GITHUB_USERNAME") // Environment Variables
?: error("GitHub username not found")
val githubAccessToken: String = rootProject.findProperty("githubAccessToken") as String? // Global Gradle Properties
?: githubProperties.getProperty("githubAccessToken") // github.properties file
?: System.getenv("GITHUB_ACCESS_TOKEN") // Environment Variables
?: error("GitHub Access Token not found")
buildscript {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20")
classpath("com.android.tools.build:gradle:8.7.1")
classpath("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.0.21-1.0.25")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
maven("https://maven.pkg.github.com/tribalfs/sesl-androidx") {
credentials {
username = githubUsername
password = githubAccessToken
}
}
maven("https://maven.pkg.github.com/tribalfs/sesl-material-components-android") {
credentials {
username = githubUsername
password = githubAccessToken
}
}
maven("https://maven.pkg.github.com/tribalfs/oneui-design") {
credentials {
username = githubUsername
password = githubAccessToken
}
}
}
}
plugins {
id("org.jetbrains.kotlin.android") version "2.0.21" apply false
id("com.google.dagger.hilt.android") version "2.52" apply false
}
tasks.register<Delete>("clean") {
delete(layout.buildDirectory)
}