wjc
2025-04-30 f91ef956cf482ed4ce0885dc47794b783c20c415
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 {
    ext {
        agp_version = '4.1.3'
    }
    repositories {
        google()
        mavenCentral()
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url = uri("https://plugins.gradle.org/m2/") }
        maven {
            url "https://jitpack.io"
        }
        maven { url 'https://developer.huawei.com/repo/' }//(华为极光推送)
        maven { url 'https://repo1.maven.org/maven2/' }
 
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$agp_version"
        classpath 'io.github.didi.dokit:dokitx-plugin:3.5.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        //增加AGC插件配置,以便能同步“agconnect-services.json”文件中的信息.(华为极光推送)
        classpath 'com.huawei.agconnect:agcp:1.6.1.300'
    }
}
 
allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
        maven { url = uri("https://plugins.gradle.org/m2/") }
        maven {
            url 'https://maven.aliyun.com/repository/public'
        }
        maven {
            credentials {
                username '5f067ef57cd41782836ff14b'
                password 'RyTWP(4APhV8'
            }
            url 'https://packages.aliyun.com/maven/repository/2012126-release-Mc0DNo/'
        }
        //(华为极光推送)
        maven {
            url 'https://developer.huawei.com/repo/'
        }
        maven { url 'https://repo1.maven.org/maven2/' }
    }
}
 
task clean(type: Delete) {
    delete rootProject.buildDir
}
 
// 保证dex_files文件中指定的文件都加载到Main Dex中
afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = []
        }
        dx.additionalParameters += '--multi-dex'
        dx.additionalParameters += "--main-dex-list=$projectDir/dex_files".toString()
    }
}