Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve compatibility for agp 7.1.2 #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HookProguard/ProguardConfigurationResolver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apply plugin: 'java'
group "$upload_group"
version "$upload_version"
apply from: rootProject.file('gradle/publish.gradle')

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compileOnly gradleApi()
}
3 changes: 3 additions & 0 deletions HookProguard/ProguardConfigurationResolver/task/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ apply plugin: 'java'
group "$upload_group"
version "$upload_version"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compileOnly gradleApi()
compileOnly "com.android.tools.build:gradle:3.6.2"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.ss.android.ugc.bytex.proguardconfigurationresolver.task;

import com.android.build.gradle.internal.tasks.ProguardConfigurableTask;
import com.android.build.gradle.internal.tasks.ProguardTask;
import com.android.build.gradle.internal.tasks.R8Task;
import com.ss.android.ugc.bytex.proguardconfigurationresolver.ProguardConfigurationResolver;

import org.gradle.api.Project;
Expand All @@ -21,7 +19,7 @@ public ProguardConfigurableTaskResolver(Project project, String variantName) {
@Override
public Task getTask() {
for (Task task : project.getTasks()) {
if ((task instanceof ProguardTask || task instanceof R8Task) &&
if (task instanceof ProguardConfigurableTask &&
((ProguardConfigurableTask) task).getVariantName().equals(variantName)) {
return task;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ apply plugin: 'java'
group "$upload_group"
version "$upload_version"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
compileOnly gradleApi()
compileOnly "com.android.tools.build:gradle:3.5.3"
Expand Down
6 changes: 6 additions & 0 deletions HookProguard/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
apply from: rootProject.file('gradle/plugin.gradle')

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation "net.sf.proguard:proguard-gradle:6.0.3"

implementation project(':ProguardConfigurationResolver')
implementation project(':ProguardConfigurationResolver-task')
implementation project(':ProguardConfigurationResolver-transform')
Expand Down
4 changes: 4 additions & 0 deletions TransformEngine/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
apply plugin: 'java-library'
apply plugin: 'kotlin'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly gradleApi()
Expand Down
1 change: 1 addition & 0 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3' //fix r8 nullpointer
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.google.code.gson:gson:2.8.2"
Expand Down
17 changes: 9 additions & 8 deletions example/plugin-bytex.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ shrinkR {
}
}

if (enableMinify) {
apply plugin: 'bytex.getter_setter_inline'
getter_setter_inline {
enable pluginEnable
enableInDebug pluginEnableInDebug
logLevel pluginLogLevel
}
}
// org.gradle.internal.work.NoAvailableWorkerLeaseException:: No worker lease associated with the current thread
//if (enableMinify) {
// apply plugin: 'bytex.getter_setter_inline'
// getter_setter_inline {
// enable pluginEnable
// enableInDebug pluginEnableInDebug
// logLevel pluginLogLevel
// }
//}

apply plugin: 'bytex.closeable_checker'
closeable_checker {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ org.gradle.caching.debug=true
bytex.enableHtmlLog=true
android.useAndroidX=false
android.enableJetifier=false
bytex.forbidUseLenientMutationDuringGetArtifact=true
#bytex.forbidUseLenientMutationDuringGetArtifact=true
2 changes: 1 addition & 1 deletion gradle/ext.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ext {
asm_version = '9.2'
guava_version = '23.0'
ByteX_Version = upload_version
gradle_compat_version = "1.1.0.2"
gradle_compat_version = "1.1.1.3"
bintray_key = BINTRAY_KEY
}
println("upload2Maven:$upload2Maven")
Expand Down