forked from AndroidIDEOfficial/AndroidIDE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
158 lines (138 loc) · 3.82 KB
/
settings.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@file:Suppress("UnstableApiUsage")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
pluginManagement {
includeBuild("build-logic")
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.mooltiverse.oss.nyx:gradle:2.5.1")
}
}
FDroidConfig.load(rootDir)
if (FDroidConfig.hasRead && FDroidConfig.isFDroidBuild) {
gradle.rootProject {
val regex = Regex("^v\\d+\\.?\\d+\\.?\\d+-\\w+")
val simpleVersion = regex.find(FDroidConfig.fDroidVersionName!!)?.value
?: throw IllegalArgumentException("Invalid version '${FDroidConfig.fDroidVersionName}. Version name must have semantic version format.'")
project.setProperty("version", simpleVersion)
}
} else {
apply {
plugin("com.mooltiverse.oss.nyx")
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://s01.oss.sonatype.org/content/groups/public/") }
maven { url = uri("https://jitpack.io") }
}
}
rootProject.name = "AndroidIDE"
include(
":annotation-processors",
":annotation-processors-ksp",
":annotations",
":actions",
":app",
":build-info",
":common",
":editor",
":editor-api",
":editor-treesitter",
":eventbus",
":eventbus-android",
":eventbus-events",
":gradle-plugin",
":gradle-plugin-config",
":idestats",
":lexers",
":logger",
":logsender",
":logsender-sample",
":lookup",
":preferences",
":resources",
":shared",
":templates-api",
":templates-impl",
":treeview",
":uidesigner",
":xml-inflater",
":lsp:api",
":lsp:models",
":lsp:java",
":lsp:xml",
":subprojects:aaptcompiler",
":subprojects:appintro",
":subprojects:builder-model-impl",
":subprojects:flashbar",
":subprojects:framework-stubs",
":subprojects:fuzzysearch",
":subprojects:google-java-format",
":subprojects:java-compiler",
":subprojects:javac",
":subprojects:javac-services",
":subprojects:javapoet",
":subprojects:jaxp",
":subprojects:jdk-compiler",
":subprojects:jdk-jdeps",
":subprojects:jdt",
":subprojects:layoutlib-api",
":subprojects:projects",
":subprojects:tooling-api",
":subprojects:tooling-api-events",
":subprojects:tooling-api-impl",
":subprojects:tooling-api-model",
":subprojects:xml-dom",
":subprojects:xml-utils",
":termux:termux-app",
":termux:termux-emulator",
":termux:termux-shared",
":termux:termux-view",
":testing:android",
":testing:lsp",
":testing:tooling",
":testing:unit",
)
object FDroidConfig {
var hasRead: Boolean = false
private set
var isFDroidBuild: Boolean = false
private set
var fDroidVersionName: String? = null
private set
var fDroidVersionCode: Int? = null
private set
const val PROP_FDROID_BUILD = "ide.build.fdroid"
const val PROP_FDROID_BUILD_VERSION = "ide.build.fdroid.version"
const val PROP_FDROID_BUILD_VERCODE = "ide.build.fdroid.vercode"
fun load(rootDir: File) {
val propsFile = File(rootDir, "fdroid.properties")
if (!propsFile.exists() || !propsFile.isFile) {
hasRead = true
isFDroidBuild = false
return
}
val properties = propsFile.let { props ->
java.util.Properties().also {
it.load(props.reader())
}
}
hasRead = true
isFDroidBuild = properties.getProperty(PROP_FDROID_BUILD, null).toBoolean()
fDroidVersionName = properties.getProperty(PROP_FDROID_BUILD_VERSION, null)
fDroidVersionCode = properties.getProperty(PROP_FDROID_BUILD_VERCODE, null)?.toInt()
}
}