From 4fe1630dd286fb940c491086c31191e0bc8669ff Mon Sep 17 00:00:00 2001 From: p_llinzhou Date: Thu, 3 Mar 2022 20:00:42 +0800 Subject: [PATCH] support agp7 0 --- AndResGuard-cli/build.gradle | 4 ++-- AndResGuard-core/build.gradle | 8 ++++---- AndResGuard-example/build.gradle | 2 +- AndResGuard-gradle-plugin/build.gradle | 12 ++++++------ .../groovy/com/tencent/gradle/AndResGuardTask.groovy | 8 ++++++++ SevenZip/build.gradle | 4 ++-- build.gradle | 12 +++++++----- gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 9 files changed, 32 insertions(+), 22 deletions(-) diff --git a/AndResGuard-cli/build.gradle b/AndResGuard-cli/build.gradle index a82ce0b0..0913fd9f 100644 --- a/AndResGuard-cli/build.gradle +++ b/AndResGuard-cli/build.gradle @@ -6,9 +6,9 @@ version rootProject.ext.VERSION_NAME group rootProject.ext.GROUP dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + implementation fileTree(dir: 'libs', include: ['*.jar']) //compile group: 'com.tencent.mm', name: 'AndResGuard-core', version: version - compile project(':AndResGuard-core') + implementation project(':AndResGuard-core') } sourceSets { diff --git a/AndResGuard-core/build.gradle b/AndResGuard-core/build.gradle index a036334c..6c579d97 100644 --- a/AndResGuard-core/build.gradle +++ b/AndResGuard-core/build.gradle @@ -7,9 +7,9 @@ group rootProject.ext.GROUP [compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8' dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.tools.build:gradle:4.1.2' - compile 'commons-io:commons-io:2.6' + implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation 'com.android.tools.build:gradle:7.0.3' + implementation 'commons-io:commons-io:2.6' } sourceSets { @@ -22,4 +22,4 @@ sourceSets { [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' apply from: rootProject.file('gradle/java-artifacts.gradle') -apply from: rootProject.file('gradle/gradle-mvn-push.gradle') +//apply from: rootProject.file('gradle/gradle-mvn-push.gradle') diff --git a/AndResGuard-example/build.gradle b/AndResGuard-example/build.gradle index 40dba415..e0c930f9 100644 --- a/AndResGuard-example/build.gradle +++ b/AndResGuard-example/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:7.0.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/AndResGuard-gradle-plugin/build.gradle b/AndResGuard-gradle-plugin/build.gradle index ce7b321e..d4f5bdef 100644 --- a/AndResGuard-gradle-plugin/build.gradle +++ b/AndResGuard-gradle-plugin/build.gradle @@ -4,16 +4,16 @@ version rootProject.ext.VERSION_NAME group rootProject.ext.GROUP dependencies { - compile gradleApi() - compile localGroovy() + implementation gradleApi() + implementation localGroovy() //compile group: 'com.tencent.mm', name: 'AndResGuard-core', version: version - compile 'com.google.gradle:osdetector-gradle-plugin:1.6.0' - compile project(':AndResGuard-core') + implementation 'com.google.gradle:osdetector-gradle-plugin:1.6.0' + implementation project(':AndResGuard-core') } repositories { mavenCentral() } -apply from: rootProject.file('gradle/java-artifacts.gradle') -apply from: rootProject.file('gradle/gradle-mvn-push.gradle') \ No newline at end of file +//apply from: rootProject.file('gradle/java-artifacts.gradle') +//apply from: rootProject.file('gradle/gradle-mvn-push.gradle') \ No newline at end of file diff --git a/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy b/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy index 847525aa..b18858a1 100644 --- a/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy +++ b/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy @@ -7,6 +7,7 @@ import com.tencent.mm.resourceproguard.Main import org.gradle.api.DefaultTask import org.gradle.api.GradleException import org.gradle.api.provider.Property +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction /** @@ -15,8 +16,14 @@ import org.gradle.api.tasks.TaskAction * @author Sim Sun (sunsj1231@gmail.com) */ class AndResGuardTask extends DefaultTask { + + @Internal AndResGuardExtension configuration + + @Internal def android + + @Internal def buildConfigs = [] AndResGuardTask() { @@ -92,6 +99,7 @@ class AndResGuardTask extends DefaultTask { return "${file.parent}/AndResGuard_${fileName}/" } + @Internal def getZipAlignPath() { return "${android.getSdkDirectory().getAbsolutePath()}/build-tools/${android.buildToolsVersion}/zipalign" } diff --git a/SevenZip/build.gradle b/SevenZip/build.gradle index dc93ebb5..cf1f0ccd 100644 --- a/SevenZip/build.gradle +++ b/SevenZip/build.gradle @@ -1,5 +1,5 @@ //apply plugin: 'com.google.osdetector' -apply plugin: 'maven' +//apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'java' @@ -50,4 +50,4 @@ publishing { } } -apply from: rootProject.file('gradle/gradle-mvn-push.gradle') +//apply from: rootProject.file('gradle/gradle-mvn-push.gradle') diff --git a/build.gradle b/build.gradle index 50b9b1fb..af61933b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,22 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { + mavenLocal() + maven { url "https://plugins.gradle.org/m2/" } google() - jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' - classpath 'com.ofg:uptodate-gradle-plugin:1.6.2' + classpath 'com.android.tools.build:gradle:7.0.3' +// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' +// classpath 'com.ofg:uptodate-gradle-plugin:1.6.2' } } allprojects { repositories { + mavenLocal() + maven { url "https://plugins.gradle.org/m2/" } google() - jcenter() } tasks.withType(JavaCompile) { sourceCompatibility = rootProject.ext.javaVersion diff --git a/gradle.properties b/gradle.properties index 775072b0..0777d143 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,4 +12,4 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -ANDRESGUARD_VESSION=1.2.21 +ANDRESGUARD_VESSION=1.2.22 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3ace9b4e..d3cd4734 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip