Skip to content

Commit

Permalink
调整名称生成方法,使每次生成名称随机
Browse files Browse the repository at this point in the history
  • Loading branch information
huangx committed Feb 21, 2021
1 parent 5e11f37 commit 99b96a5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
```
buildscript {
repositories {
mavenCentral()
mavenCentral()
}
dependencies {
classpath "com.github.qq549631030:android-junk-code:1.0.6"
classpath "com.github.qq549631030:android-junk-code:1.0.7"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.qq549631030:android-junk-code:1.0.6"
classpath "com.github.qq549631030:android-junk-code:1.0.7"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0'
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0"

Expand Down
21 changes: 1 addition & 20 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,4 @@ dependencies {
implementation localGroovy()
implementation 'com.squareup:javapoet:1.13.0'
implementation 'com.android.tools.build:gradle:3.0.0'
}

// load properties
Properties properties = new Properties()
File localPropertiesFile = project.file("$rootProject.projectDir.absolutePath/local.properties");
if (localPropertiesFile.exists()) {
properties.load(localPropertiesFile.newDataInputStream())
}

def pgpKeyId = properties.getProperty("pgpKeyId")
def pgpKeyPassword = properties.getProperty("pgpKeyPassword")
def pgpSecretKeyRingFile = properties.getProperty("pgpSecretKeyRingFile")
def sonatypeNexusUsername = properties.getProperty("sonatypeNexusUsername")
def sonatypeNexusPassword = properties.getProperty("sonatypeNexusPassword")

ext."signing.keyId" = pgpKeyId
ext."signing.password" = pgpKeyPassword
ext."signing.secretKeyRingFile" = pgpSecretKeyRingFile
ext."SONATYPE_NEXUS_USERNAME" = sonatypeNexusUsername
ext."SONATYPE_NEXUS_PASSWORD" = sonatypeNexusPassword
}
7 changes: 7 additions & 0 deletions library/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,10 @@ POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=qq549631030
POM_DEVELOPER_NAME=huangx
POM_DEVELOPER_URL=https://github.com/qq549631030/

#signing.keyId=[you keyId last 8bit]
#signing.password=[you key password]
#signing.secretKeyRingFile=[you gpg key file location]
#
#SONATYPE_NEXUS_USERNAME=[you sonatype username]
#SONATYPE_NEXUS_PASSWORD=[you sonatype password]
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ class AndroidJunkCodeTask extends DefaultTask {
*/
static String generateName(int index) {
def sb = new StringBuffer()
for (i in 0..4) {
sb.append(abc[random.nextInt(abc.size())])
}
int temp = index
while (temp >= 0) {
sb.append(abc[temp % abc.size()])
Expand Down

0 comments on commit 99b96a5

Please sign in to comment.