@@ -12,6 +12,7 @@ buildscript {
12
12
}
13
13
ext {
14
14
plugin_version = upload_version
15
+ enableMinify = true
15
16
}
16
17
dependencies {
17
18
classpath " com.bytedance.android.byteX:base-plugin:${ plugin_version} "
@@ -35,6 +36,15 @@ android {
35
36
compileSdkVersion 28
36
37
buildToolsVersion " 29.0.0"
37
38
39
+ signingConfigs {
40
+ release {
41
+ keyAlias ' bytex'
42
+ keyPassword ' bytex-example'
43
+ storeFile project. file(" bytex.keystore" )
44
+ storePassword ' bytex-example'
45
+ }
46
+ }
47
+
38
48
flavorDimensions " app" , " mode"
39
49
productFlavors {
40
50
douyin {
@@ -62,15 +72,17 @@ android {
62
72
63
73
buildTypes {
64
74
release {
65
- minifyEnabled true
75
+ minifyEnabled enableMinify
66
76
multiDexEnabled true
67
77
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
78
+ signingConfig signingConfigs. release
68
79
}
69
80
70
81
debug {
71
- minifyEnabled true
82
+ minifyEnabled enableMinify
72
83
multiDexEnabled true
73
84
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
85
+ signingConfig signingConfigs. release
74
86
75
87
}
76
88
}
@@ -85,3 +97,29 @@ dependencies {
85
97
implementation " com.bytedance.android.byteX:coverage-lib:${ plugin_version} "
86
98
}
87
99
apply from : project. file(' plugin-bytex.gradle' )
100
+
101
+ Set<String > assembles = new HashSet<> ()
102
+ assembles. add(" assembleDouyinCnDebug" )
103
+ assembles. add(" assembleDouyinCnRelease" )
104
+ assembles. add(" assembleDouyinI18nDebug" )
105
+ assembles. add(" assembleDouyinI18nRelease" )
106
+ assembles. add(" assembleBytexCnDebug" )
107
+ assembles. add(" assembleBytexCnRelease" )
108
+ assembles. add(" assembleBytexI18nDebug" )
109
+ assembles. add(" assembleBytexI18nRelease" )
110
+ project. gradle
111
+ .startParameter
112
+ .taskRequests
113
+ .stream()
114
+ .flatMap() { it. args. stream() }
115
+ .filter { it. contains(" assemble" ) }
116
+ .map { it. toLowerCase() }
117
+ .forEach {
118
+ if (! (
119
+ (it. contains(" douyin" ) || it. contains(" bytex" )) &&
120
+ (it. contains(" cn" ) || it. contains(" i18n" )) &&
121
+ (it. contains(" release" ) || it. contains(" debug" ))
122
+ )) {
123
+ throw new IllegalArgumentException (assembles. join(" ," ) + " supportted only" )
124
+ }
125
+ }
0 commit comments