From 5e11f37ae72e2fccd87d04ac7ae635b6149a8a78 Mon Sep 17 00:00:00 2001 From: huangx Date: Fri, 5 Feb 2021 17:22:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=88=B0=E4=B8=AD=E5=A4=AE?= =?UTF-8?q?=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++-- app/build.gradle | 4 +++ build.gradle | 9 +++--- library/build.gradle | 63 +++++++------------------------------- library/gradle.properties | 23 ++++++++++++++ library/project.properties | 8 ----- 6 files changed, 50 insertions(+), 68 deletions(-) create mode 100644 library/gradle.properties delete mode 100644 library/project.properties diff --git a/README.md b/README.md index ec5dfcd3..3a4c2557 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Android垃圾代码生成插件 -[![Download](https://api.bintray.com/packages/qq549631030/maven/AndroidJunkCode/images/download.svg) ](https://bintray.com/qq549631030/maven/AndroidJunkCode/_latestVersion) - 此插件用于做马甲包时,减小马甲包与主包的代码相似度,避免被OPPO、VIVO等应用市场识别为马甲包。 ### 使用方法 @@ -9,11 +7,18 @@ 根目录的build.gradle中: ``` buildscript { + repositories { + mavenCentral() + } dependencies { - classpath "cn.hx.plugin:android-junk-code:1.0.5" + classpath "com.github.qq549631030:android-junk-code:1.0.6" } } ``` +**由于jcenter即将关闭后续版本将不再发布到jcenter,转为发布到mavenCentral,groupId从原来的"cn.hx.plugin"改为"com.github.qq549631030"** + + + app目录的build.gradle模块中: ``` apply plugin: 'com.android.application' diff --git a/app/build.gradle b/app/build.gradle index 954eafee..81dc347d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -26,6 +26,10 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + lintOptions { + checkReleaseBuilds false + abortOnError false + } } android.applicationVariants.all { variant -> diff --git a/build.gradle b/build.gradle index 097f213b..f3fe04ab 100644 --- a/build.gradle +++ b/build.gradle @@ -4,15 +4,14 @@ buildscript { repositories { google() jcenter() - maven { - url './repo' - } + mavenCentral() + mavenLocal() } dependencies { classpath 'com.android.tools.build:gradle:4.1.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.novoda:bintray-release:0.9.2' - classpath "cn.hx.plugin:android-junk-code:1.0.6" + classpath "com.github.qq549631030:android-junk-code:1.0.6" + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0' classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:2.0.0" // NOTE: Do not place your application dependencies here; they belong diff --git a/library/build.gradle b/library/build.gradle index 25326cf5..ce6bd9d5 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'groovy' -apply plugin: 'maven' +apply plugin: "com.vanniktech.maven.publish" dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -9,62 +9,21 @@ dependencies { implementation 'com.android.tools.build:gradle:3.0.0' } -apply from: rootProject.projectDir.absolutePath + "/bintray-release.gradle" - // load properties Properties properties = new Properties() File localPropertiesFile = project.file("$rootProject.projectDir.absolutePath/local.properties"); if (localPropertiesFile.exists()) { properties.load(localPropertiesFile.newDataInputStream()) } -File projectPropertiesFile = project.file("project.properties"); -if (projectPropertiesFile.exists()) { - properties.load(projectPropertiesFile.newDataInputStream()) -} - -def projectName = properties.getProperty("project.name") -def projectGroupId = properties.getProperty("project.groupId") -def projectArtifactId = properties.getProperty("project.artifactId") -def projectArtifactVersion = properties.getProperty("project.artifactVersion") -def projectSiteUrl = properties.getProperty("project.siteUrl") -def projectGitUrl = properties.getProperty("project.gitUrl") -def projectDesc = properties.getProperty("project.desc") -def bintray_Org = properties.getProperty("bintray.org") -def bintray_User = properties.getProperty("bintray.user") -def bintrayApikey = properties.getProperty("bintray.apikey") -def mavenUserName = properties.getProperty("mavenUserName") -def mavenUserPassword = properties.getProperty("mavenUserPassword") +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") -publish { - groupId = projectGroupId - artifactId = projectArtifactId - uploadName = projectName - website = projectSiteUrl - repository = projectGitUrl - desc = projectDesc - publishVersion = projectArtifactVersion - userOrg = bintray_Org - bintrayUser = bintray_User - bintrayKey = bintrayApikey - dryRun = false -} - -uploadArchives { - repositories { - mavenDeployer { -// repository(url: 'your repositories') { -// authentication(userName: mavenUserName, password: mavenUserPassword) -// } - repository(url: uri("../repo")) - pom.version = projectArtifactVersion - pom.artifactId = 'android-junk-code' - pom.groupId = 'cn.hx.plugin' - pom.project { - name = project.name - packaging = 'jar' - description = 'description' - } - } - } -} +ext."signing.keyId" = pgpKeyId +ext."signing.password" = pgpKeyPassword +ext."signing.secretKeyRingFile" = pgpSecretKeyRingFile +ext."SONATYPE_NEXUS_USERNAME" = sonatypeNexusUsername +ext."SONATYPE_NEXUS_PASSWORD" = sonatypeNexusPassword \ No newline at end of file diff --git a/library/gradle.properties b/library/gradle.properties new file mode 100644 index 00000000..20350625 --- /dev/null +++ b/library/gradle.properties @@ -0,0 +1,23 @@ +#project +GROUP=com.github.qq549631030 +VERSION_NAME=1.0.7 + +POM_ARTIFACT_ID=android-junk-code +POM_NAME=AndroidJunkCode +POM_PACKAGING=jar + +POM_DESCRIPTION=generate junk code for android +POM_INCEPTION_YEAR=2020 + +POM_URL=https://github.com/qq549631030/AndroidJunkCode/ +POM_SCM_URL=https://github.com/qq549631030/AndroidJunkCode/ +POM_SCM_CONNECTION=scm:git:git://github.com/qq549631030/AndroidJunkCode.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/qq549631030/AndroidJunkCode.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=qq549631030 +POM_DEVELOPER_NAME=huangx +POM_DEVELOPER_URL=https://github.com/qq549631030/ diff --git a/library/project.properties b/library/project.properties deleted file mode 100644 index 4fadc2b7..00000000 --- a/library/project.properties +++ /dev/null @@ -1,8 +0,0 @@ -#project -project.name=AndroidJunkCode -project.groupId=cn.hx.plugin -project.artifactId=android-junk-code -project.artifactVersion=1.0.6 -project.siteUrl=https://github.com/qq549631030/AndroidJunkCode -project.gitUrl=https://github.com/qq549631030/AndroidJunkCode.git -project.desc=generate junk code for android \ No newline at end of file