Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

兼容AGP7.0+ #162

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: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ext {
compileSdkVersion = 27
buildToolsVersion = "27.0.3"
buildToolsVersion = "28.0.3"
minSdkVersion = 14
targetSdkVersion = 26
}
Expand All @@ -12,7 +12,7 @@ buildscript {
google()
}
dependencies {
classpath "com.android.tools.build:gradle:3.0.1"
classpath "com.android.tools.build:gradle:3.2.1"
}
}

Expand Down
4 changes: 2 additions & 2 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
compile project(":common")
compile 'com.android.tools.build:apksig:2.3.3'
implementation project(":common")
implementation 'com.android.tools.build:apksig:2.3.3'
}

//mainClassName = 'com.mcxiaoke.packer.cli.Main'
Expand Down
10 changes: 5 additions & 5 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ targetCompatibility = 1.7

dependencies {
// JUnit and Mockito
testCompile "junit:junit:4.12"
testCompile "org.mockito:mockito-core:1.10.19"
testCompile "commons-io:commons-io:2.5"
testCompile 'com.android.tools.build:apksig:2.3.3'
testCompile "com.mcxiaoke.next:core:1.5.0"
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:1.10.19"
testImplementation "commons-io:commons-io:2.5"
testImplementation 'com.android.tools.build:apksig:2.3.3'
testImplementation "com.mcxiaoke.next:core:1.5.0"
}

test {
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Tue Dec 16 11:37:35 CST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
12 changes: 6 additions & 6 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ repositories {
}

dependencies {
compile localGroovy()
compile gradleApi()
compile project(':common')
compile project(':cli')
compile 'com.android.tools.build:gradle:2.3.3'
compile 'com.android.tools.build:apksig:2.3.3'
implementation localGroovy()
implementation gradleApi()
implementation project(':common')
implementation project(':cli')
implementation 'com.android.tools.build:gradle:2.3.3'
implementation 'com.android.tools.build:apksig:2.3.3'
}

apply from: '../gradle-mvn-push.gradle'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class GradlePlugin implements Plugin<Project> {
throw new PluginException(
"'com.android.application' plugin must be applied", null)
}
project.configurations.create(PLUGIN_NAME).extendsFrom(project.configurations.compile)
project.configurations.create(PLUGIN_NAME).extendsFrom(project.configurations.implementation)
project.extensions.create(PLUGIN_NAME, GradleExtension)
project.afterEvaluate {
project.android.applicationVariants.all { BaseVariant variant ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import groovy.text.SimpleTemplateEngine
import groovy.text.Template
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction

import java.text.SimpleDateFormat
Expand All @@ -28,6 +29,7 @@ class GradleTask extends DefaultTask {
description = 'generate APK with channel info'
}

@Internal
Template getNameTemplate() {
String format
String propValue = project.findProperty(Const.PROP_FORMAT)
Expand All @@ -43,6 +45,7 @@ class GradleTask extends DefaultTask {
return engine.createTemplate(format)
}

@Internal
File getOriginalApk() {
variant.outputs.each { ot ->
logger.info("Output APK: ${ot.name},${ot.outputFile}")
Expand All @@ -54,6 +57,7 @@ class GradleTask extends DefaultTask {
return file
}

@Internal
File getOutputRoot() {
File outputDir
String propValue = project.findProperty(Const.PROP_OUTPUT)
Expand All @@ -72,6 +76,7 @@ class GradleTask extends DefaultTask {
return outputDir
}

@Internal
File getVariantOutput() {
File outputDir = getOutputRoot()
String flavorName = variant.flavorName
Expand All @@ -87,6 +92,7 @@ class GradleTask extends DefaultTask {
return outputDir
}

@Internal
Set<String> getChannels() {
// -P channels=ch1,ch2,ch3
// -P [email protected]
Expand Down