-
Notifications
You must be signed in to change notification settings - Fork 350
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
79 lines (65 loc) · 2.14 KB
/
settings.gradle.kts
File metadata and controls
79 lines (65 loc) · 2.14 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
@file:Suppress("UnstableApiUsage")
data class GprCredentials(val user: String, val key: String)
fun loadGprCredentials(): GprCredentials {
// 优先从环境变量读取
val envUser = System.getenv("GIT_ACTOR")?.takeIf { it.isNotBlank() }
val envKey = System.getenv("GIT_TOKEN")?.takeIf { it.isNotBlank() }
if (envUser != null && envKey != null) {
return GprCredentials(envUser, envKey)
}
// 从 signing.properties 读取
val propsFile = File(rootDir, "signing.properties")
if (!propsFile.exists()) {
throw GradleException(
"Missing GitHub credentials. Please either:\n" +
" 1. Set GIT_ACTOR and GIT_TOKEN environment variables, or\n" +
" 2. Create 'signing.properties' with 'gpr.user' and 'gpr.key'"
)
}
val props = java.util.Properties().apply {
propsFile.inputStream().use { load(it) }
}
val user = props.getProperty("gpr.user")?.takeIf { it.isNotBlank() }
val key = props.getProperty("gpr.key")?.takeIf { it.isNotBlank() }
if (user == null || key == null) {
throw GradleException("'gpr.user' and 'gpr.key' must be set in 'signing.properties'")
}
return GprCredentials(user, key)
}
val gprCredentials by lazy { loadGprCredentials() }
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
google()
mavenCentral()
mavenLocal()
maven("https://maven.pkg.github.com/ReChronoRain/HyperCeiler") {
credentials {
username = gprCredentials.user
password = gprCredentials.key
}
}
maven("https://jitpack.io")
maven("https://api.xposed.info")
}
}
rootProject.name = "HyperCeiler"
include(
"app",
// ":library:hook",
":library:libhook",
":library:xposed-api-101",
":library:core",
":library:provision",
":library:common",
":library:processor",
":library:hidden-api",
)