Repository navigation
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
136 lines (121 loc) · 4.69 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
136 lines (121 loc) · 4.69 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import java.util.Properties
val localProps = Properties().apply {
val file = rootDir.resolve("local.properties")
if (file.exists()) file.inputStream().use(::load)
}
fun githubUser(): String? =
localProps.getProperty("gpr.user")
?: providers.gradleProperty("gpr.user").orNull
?: System.getenv("GITHUB_ACTOR")
fun githubToken(): String? =
localProps.getProperty("gpr.key")
?: providers.gradleProperty("gpr.key").orNull
?: System.getenv("GITHUB_TOKEN")
pluginManagement {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
google()
ivy {
// Standalone D8 builds are published as versioned JARs in the official R8 bucket.
name = "R8 releases"
url = uri("https://storage.googleapis.com/r8-releases/raw")
patternLayout { artifact("[revision]/[artifact].[ext]") }
metadataSources { artifact() }
content { includeModule("com.android.tools", "r8") }
}
maven {
// From PR #39: https://github.com/Jman-Github/Universal-Patch-Manager/pull/39
url = uri("https://maven.pkg.github.com/brosssh/registry")
credentials {
val gprUser: String? = githubUser()
val gprKey: String? = githubToken()
username = gprUser.orEmpty().ifBlank { "anonymous" }
password = gprKey.orEmpty()
}
}
maven {
// A repository must be specified for some reason. "registry" is a dummy.
url = uri("https://maven.pkg.github.com/revanced/registry")
credentials {
val gprUser: String? = githubUser()
val gprKey: String? = githubToken()
username = gprUser.orEmpty().ifBlank { "anonymous" }
password = gprKey.orEmpty()
}
}
maven {
// Morphe library is published to its repository-specific GitHub Packages endpoint.
url = uri("https://maven.pkg.github.com/MorpheApp/morphe-library")
content {
includeModule("app.morphe", "morphe-library")
}
credentials {
val gprUser: String? = githubUser()
val gprKey: String? = githubToken()
username = gprUser.orEmpty().ifBlank { "anonymous" }
password = gprKey.orEmpty()
}
}
maven {
// Morphe publishes multiple runtime artifacts under the app.morphe group from this endpoint.
url = uri("https://maven.pkg.github.com/MorpheApp/morphe-patcher")
content {
includeGroup("app.morphe")
}
credentials {
val gprUser: String? = githubUser()
val gprKey: String? = githubToken()
username = gprUser.orEmpty().ifBlank { "anonymous" }
password = gprKey.orEmpty()
}
}
maven {
// Morphe multidexlib2 is also published to its own GitHub Packages endpoint.
url = uri("https://maven.pkg.github.com/MorpheApp/multidexlib2")
content {
includeModule("app.morphe", "multidexlib2")
}
credentials {
val gprUser: String? = githubUser()
val gprKey: String? = githubToken()
username = gprUser.orEmpty().ifBlank { "anonymous" }
password = gprKey.orEmpty()
}
}
maven("https://git.reseam.app/api/packages/reseam/maven") {
content { includeGroup("app.reseam") }
}
maven("https://jitpack.io") {
metadataSources {
mavenPom()
artifact()
}
}
}
}
rootProject.name = "universal-patch-manager"
fun moduleExists(path: String): Boolean {
val relativePath = path.removePrefix(":").replace(':', '/')
val projectDir = rootDir.resolve(relativePath)
return projectDir.isDirectory && (
projectDir.resolve("build.gradle.kts").exists() ||
projectDir.resolve("build.gradle").exists()
)
}
fun includeIfAvailable(path: String) {
if (moduleExists(path)) include(path)
}
include(":app", ":api", ":upm-patcher-core", ":jvm-host", ":revanced21-patcher-core", ":revanced22-patcher-core")
includeIfAvailable(":morphe-runtime")
includeIfAvailable(":revanced.v21-runtime-plugin")
includeIfAvailable(":reseam-runtime")
include(":revanced-legacy-patcher-core")
include(":tools-patcher-core", ":revanced.v22-runtime-plugin")