Skip to content

Commit 99b96a5

Browse files
author
huangx
committed
调整名称生成方法,使每次生成名称随机
1 parent 5e11f37 commit 99b96a5

5 files changed

Lines changed: 14 additions & 23 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
```
99
buildscript {
1010
repositories {
11-
mavenCentral()
11+
mavenCentral()
1212
}
1313
dependencies {
14-
classpath "com.github.qq549631030:android-junk-code:1.0.6"
14+
classpath "com.github.qq549631030:android-junk-code:1.0.7"
1515
}
1616
}
1717
```

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
dependencies {
1111
classpath 'com.android.tools.build:gradle:4.1.1'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13-
classpath "com.github.qq549631030:android-junk-code:1.0.6"
13+
classpath "com.github.qq549631030:android-junk-code:1.0.7"
1414
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0'
1515
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0"
1616

library/build.gradle

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,4 @@ dependencies {
77
implementation localGroovy()
88
implementation 'com.squareup:javapoet:1.13.0'
99
implementation 'com.android.tools.build:gradle:3.0.0'
10-
}
11-
12-
// load properties
13-
Properties properties = new Properties()
14-
File localPropertiesFile = project.file("$rootProject.projectDir.absolutePath/local.properties");
15-
if (localPropertiesFile.exists()) {
16-
properties.load(localPropertiesFile.newDataInputStream())
17-
}
18-
19-
def pgpKeyId = properties.getProperty("pgpKeyId")
20-
def pgpKeyPassword = properties.getProperty("pgpKeyPassword")
21-
def pgpSecretKeyRingFile = properties.getProperty("pgpSecretKeyRingFile")
22-
def sonatypeNexusUsername = properties.getProperty("sonatypeNexusUsername")
23-
def sonatypeNexusPassword = properties.getProperty("sonatypeNexusPassword")
24-
25-
ext."signing.keyId" = pgpKeyId
26-
ext."signing.password" = pgpKeyPassword
27-
ext."signing.secretKeyRingFile" = pgpSecretKeyRingFile
28-
ext."SONATYPE_NEXUS_USERNAME" = sonatypeNexusUsername
29-
ext."SONATYPE_NEXUS_PASSWORD" = sonatypeNexusPassword
10+
}

library/gradle.properties

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ POM_LICENCE_DIST=repo
2121
POM_DEVELOPER_ID=qq549631030
2222
POM_DEVELOPER_NAME=huangx
2323
POM_DEVELOPER_URL=https://github.com/qq549631030/
24+
25+
#signing.keyId=[you keyId last 8bit]
26+
#signing.password=[you key password]
27+
#signing.secretKeyRingFile=[you gpg key file location]
28+
#
29+
#SONATYPE_NEXUS_USERNAME=[you sonatype username]
30+
#SONATYPE_NEXUS_PASSWORD=[you sonatype password]

library/src/main/groovy/cn/hx/plugin/junkcode/task/AndroidJunkCodeTask.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ class AndroidJunkCodeTask extends DefaultTask {
366366
*/
367367
static String generateName(int index) {
368368
def sb = new StringBuffer()
369+
for (i in 0..4) {
370+
sb.append(abc[random.nextInt(abc.size())])
371+
}
369372
int temp = index
370373
while (temp >= 0) {
371374
sb.append(abc[temp % abc.size()])

0 commit comments

Comments
 (0)