Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
73 lines (56 loc) · 2.27 KB
/
Copy pathbuild.gradle
File metadata and controls
73 lines (56 loc) · 2.27 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
maven { url = "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.13.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.10'
// classpath 'com.google.gms:google-services:4.3.15'
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.9.0'
//noinspection GradleDependency
// classpath "com.github.triplet.gradle:play-publisher:3.6.0" // no more gplay build
// This is needed since android-connector:2.2.0 is built with Java 17
classpath 'com.android.tools:r8:9.0.32'
}
}
static String detectNdkVersion() {
def version = "27.2.12479018" // "21.4.7075529"
def androidHome = System.getenv("ANDROID_HOME")
if (androidHome == null) return version
if (new File(androidHome, "ndk/$version").isDirectory()) return version
def versionFile = new File(androidHome, "ndk-bundle/source.properties")
if (!versionFile.isFile()) return version
def versionProperties = new Properties()
versionProperties.load(versionFile.newDataInputStream())
return versionProperties.getProperty("Pkg.Revision", version)
}
ext {
ndkVersion = detectNdkVersion()
}
allprojects {
repositories {
// The order in which you list these repositories matter.
mavenCentral()
google()
}
if (project.projectDir.absolutePath.contains('/TMessagesProj_Modules/media/')) {
project.plugins.withId('com.android.library') {
project.android {
if (namespace == null) {
def manifestFile = file("${project.projectDir}/src/main/AndroidManifest.xml")
if (manifestFile.exists()) {
def manifest = new XmlSlurper().parse(manifestFile)
def manifestPackage = manifest.@package.text()
if (manifestPackage) {
namespace manifestPackage
}
}
}
}
}
}
}