forked from sanfengAndroid/FakeXposed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
78 lines (71 loc) · 2.8 KB
/
build.gradle
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
/*
* Copyright (c) 2021 FakeXposed by sanfengAndroid.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
static String getType(List allAbi) {
def type = 0
type |= allAbi.contains('x86') ? 1 : 0
type |= allAbi.contains('x86_64') ? 1 : 0
type |= allAbi.contains('armeabi-v7a') ? 2 : 0
type |= allAbi.contains('arm64-v8a') ? 2 : 0
return type == 1 ? 'x86' : type == 2 ? 'arm' : 'all'
}
ext {
props = new Properties()
if (project.hasProperty('configPath')) {
props.load(new FileInputStream(configPath))
} else if (project.file('local.properties').exists()) {
props.load(new FileInputStream(project.file('local.properties')))
}
if (props['abis']){
props['abis'] = props['abis']?.split(',')?.toList()
}
project.hasProperty('buildApi') && (props['buildApi'] = buildApi.toInteger())
project.hasProperty('mergeBuild') && (props['mergeBuild'] = mergeBuild)
project.hasProperty('abis') && (props['abis'] = abis.split(',').toList())
project.hasProperty('logLevel') && (props['logLevel'] = logLevel.toInteger())
props['hasSign'] = props['storeFile']?.trim() && props['storePassword']?.trim() && props['keyAlias']?.trim() && props['keyPassword']?.trim()
!project.hasProperty('targetSdk') && (targetSdk = (props['targetSdk']?:23))
targetSdk = targetSdk.toInteger()
assert (targetSdk >= 21 && targetSdk <=30)
props['buildApi'] = props['buildApi']?: 30
props['buildApi'] = props['buildApi'].toInteger()
props['logLevel'] = props['logLevel']?: 2
props['logLevel'] = props['logLevel'].toInteger()
props['appType'] = getType(rootProject.props['abis'] ?: ['armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'])
props['mergeBuild'] = props['mergeBuild']?: true
props['mergeBuild'] = props['mergeBuild'].toBoolean()
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}