File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed
src/main/groovy/cn/hx/plugin/junkcode/task Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ apply plugin: 'com.getkeepsafe.dexcount'
7
7
apply plugin : ' kotlin-kapt'
8
8
9
9
android {
10
- compileSdkVersion 31
10
+ compileSdkVersion 33
11
11
12
12
defaultConfig {
13
13
applicationId " cn.hx.plugin.junkcode.demo"
14
14
minSdkVersion 16
15
- targetSdkVersion 31
15
+ targetSdkVersion 33
16
16
versionCode 1
17
17
versionName " 1.0"
18
18
multiDexEnabled true
@@ -25,6 +25,7 @@ android {
25
25
buildTypes {
26
26
release {
27
27
minifyEnabled true
28
+ shrinkResources true
28
29
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
29
30
}
30
31
}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ buildscript {
11
11
classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
12
12
classpath " com.getkeepsafe.dexcount:dexcount-gradle-plugin:3.0.1"
13
13
if (PLUGIN_ENABLE . toBoolean()) {
14
- classpath " com.github.qq549631030:android-junk-code:1.2.0 "
14
+ classpath " com.github.qq549631030:android-junk-code:1.2.1 "
15
15
}
16
16
// NOTE: Do not place your application dependencies here; they belong
17
17
// in the individual module build.gradle files
Original file line number Diff line number Diff line change 1
1
# project
2
2
GROUP =com.github.qq549631030
3
- VERSION_NAME =1.2.0
3
+ VERSION_NAME =1.2.1
4
4
5
5
POM_ARTIFACT_ID =android-junk-code
6
6
POM_NAME =AndroidJunkCode
Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ class AndroidJunkCodeTask extends DefaultTask {
181
181
stringList. add(" ${ config.resPrefix.toLowerCase()}${ generateName(i)} " )
182
182
}
183
183
generateStringsFile()
184
+ generateKeep()
184
185
}
185
186
186
187
/**
@@ -235,6 +236,14 @@ class AndroidJunkCodeTask extends DefaultTask {
235
236
writeStringToFile(stringFile, sb. toString())
236
237
}
237
238
239
+ void generateKeep () {
240
+ def keepFile = new File (outDir, " res/raw/keep.xml" )
241
+ StringBuilder sb = new StringBuilder ()
242
+ sb. append(" <resources xmlns:tools=\" http://schemas.android.com/tools\"\n " +
243
+ " tools:keep=\" @layout/${ config.resPrefix} *, @drawable/${ config.resPrefix} *\" />\n " )
244
+ writeStringToFile(keepFile, sb. toString())
245
+ }
246
+
238
247
private void writeJavaFile (JavaFile javaFile ) {
239
248
def outputDirectory = new File (outDir, " java" ). toPath()
240
249
if (! javaFile. packageName. isEmpty()) {
You can’t perform that action at this time.
0 commit comments