Skip to content

Commit

Permalink
feat: upgrade gradle, android-gradle-plugin, kotlin-gradle-plugin, fi…
Browse files Browse the repository at this point in the history
…t the latest 3.6.x with new AppPlugin import path
  • Loading branch information
2BAB committed Mar 16, 2020
1 parent 6e6781e commit 17f3e83
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -50,13 +50,14 @@ apply plugin: 'me.2bab.scratchpaper'

``` gradle
scratchPaper {
textSize = 11
textSize = 10
textColor = "#FFFFFFFF"
verticalLinePadding = 4
backgroundColor = "#99000000"
extraInfo = new Date().format("MM-dd,HH:mm")
enableGenerateIconOverlay = true
enableGenerateBuildInfo = true
enableApplicationIdSuffixDisplay = true
// Experimental field
// @see IconOverlayGenerator#removeXmlIconFiles
Expand All @@ -72,10 +73,11 @@ scratchPaper {

## Compatible

ScratchPaper is only supported & tested in Latest TWO Minor versions of Android Gradle Plugin.
ScratchPaper is only supported & tested on LATEST ONE Minor versions of Android Gradle Plugin.

AGP Version|Compatible Status
-----------|-----------------
3.6.x (Aapt2) | Support (last support version - 2.5.0)
3.5.x (Aapt2) | Support (last support version - 2.4.2)
3.4.x (Aapt2) | Support (last support version - 2.4.1)
3.3.x (Aapt2) | Support (last support version - 2.4.1)
Expand All @@ -93,7 +95,7 @@ The v1.x `IconCover` forked from [icon-version@akonior](https://github.com/akoni
## License

>
> Copyright 2016-2019 2BAB
> Copyright 2016-2020 2BAB
>
>Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
8 changes: 5 additions & 3 deletions README_zh.md
Expand Up @@ -59,13 +59,14 @@ apply plugin: 'me.2bab.scratchpaper'

``` gradle
scratchPaper {
textSize = 11
textSize = 10
textColor = "#FFFFFFFF"
verticalLinePadding = 4
backgroundColor = "#99000000"
extraInfo = new Date().format("MM-dd,HH:mm")
enableGenerateIconOverlay = true
enableGenerateBuildInfo = true
enableApplicationIdSuffixDisplay = true
// Experimental field
// @see IconOverlayGenerator#removeXmlIconFiles
Expand All @@ -81,10 +82,11 @@ scratchPaper {

## 兼容性

精力有限,ScratchPaper 只会至多支持最新两个 Minor 版本的 Android Gradle Plugin(例如最新版是 3.3.x,那同时会支持 3.2.x):
精力有限,ScratchPaper 只会支持最新一个 Minor 版本的 Android Gradle Plugin(例如最新版是 3.3.3, 那一般地 3.3.x 都会支持):

AGP Version|Compatible Status
-----------|-----------------
3.6.x (Aapt2) | Support (last support version - 2.5.0)
3.5.x (Aapt2) | Support (last support version - 2.4.2)
3.4.x (Aapt2) | Support (last support version - 2.4.1)
3.3.x (Aapt2) | Support (last support version - 2.4.1)
Expand All @@ -102,7 +104,7 @@ The v1.x `IconCover` forked from [icon-version@akonior](https://github.com/akoni
## License

>
> Copyright 2016-2019 2BAB
> Copyright 2016-2020 2BAB
>
>Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
@@ -1,7 +1,7 @@
// must keep the order among `buildscript` `plugins` `repositories` blocks

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.3.70'

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Expand Down Expand Up @@ -38,7 +38,7 @@ dependencies {
implementation gradleApi()
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'com.android.tools.build:gradle:3.5.0'
implementation 'com.android.tools.build:gradle:3.6.1'
implementation 'org.jfree:jfreesvg:3.3'
}

Expand All @@ -57,6 +57,6 @@ if (project.extensions.findByName("buildScan") != null) {

// publish
group 'me.2bab'
version '2.4.2'
version '2.5.0'
apply from: 'bintray.gradle'
apply from: 'mavenlocal.gradle'
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -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-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
6 changes: 3 additions & 3 deletions sample/build.gradle
@@ -1,14 +1,14 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.3.70'
repositories {
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'me.2bab:scratch-paper:2.4.2'
classpath 'me.2bab:scratch-paper:2.4.2.2-SNAPSHOT'
}
}

Expand Down
2 changes: 1 addition & 1 deletion sample/gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -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-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
@@ -1,7 +1,7 @@
package me.xx2bab.scratchpaper.utils

import com.android.build.gradle.AppPlugin
import com.android.build.gradle.BasePlugin
import com.android.build.gradle.internal.plugins.AppPlugin
import com.android.build.gradle.internal.plugins.BasePlugin
import com.android.build.gradle.internal.scope.GlobalScope
import com.android.sdklib.BuildToolInfo
import org.gradle.api.Project
Expand All @@ -11,7 +11,7 @@ class AndroidPluginUtils(val project: Project) {

@Throws(Exception::class)
fun buildToolInfo(): BuildToolInfo {
val basePlugin = project.plugins.findPlugin(AppPlugin::class.java) as BasePlugin<*>
val basePlugin = project.plugins.findPlugin(AppPlugin::class.java) as BasePlugin
val scope = getField(BasePlugin::class.java, basePlugin,
"globalScope") as GlobalScope
return scope.sdkComponents.buildToolInfoProvider.get()
Expand Down

0 comments on commit 17f3e83

Please sign in to comment.