Skip to content

Commit db28389

Browse files
authored
Merge pull request #20 from 2BAB/dev_v2
3.3.0 with AGP8.1/8.0 support
2 parents 7deac37 + 92f65f3 commit db28389

30 files changed

+555
-394
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v2
2929
- uses: gradle/wrapper-validation-action@v1
30-
- name: Set up JDK 11
30+
- name: Set up JDK 17
3131
uses: actions/setup-java@v2
3232
with:
3333
distribution: 'zulu'
34-
java-version: '11'
34+
java-version: '17'
3535
- uses: actions/cache@v2
3636
with:
3737
path: |
@@ -51,11 +51,11 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v2
5353
- uses: gradle/wrapper-validation-action@v1
54-
- name: Set up JDK 11
54+
- name: Set up JDK 17
5555
uses: actions/setup-java@v2
5656
with:
5757
distribution: 'zulu'
58-
java-version: '11'
58+
java-version: '17'
5959
- uses: actions/cache@v2
6060
with:
6161
path: |
@@ -74,11 +74,11 @@ jobs:
7474
steps:
7575
- uses: actions/checkout@v2
7676
- uses: gradle/wrapper-validation-action@v1
77-
- name: Set up JDK 11
77+
- name: Set up JDK 17
7878
uses: actions/setup-java@v2
7979
with:
8080
distribution: 'zulu'
81-
java-version: '11'
81+
java-version: '17'
8282
- uses: actions/cache@v2
8383
with:
8484
path: |

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
- name: Check out
1313
uses: actions/checkout@v2
1414

15-
- name: Set up JDK 11
15+
- name: Set up JDK 17
1616
uses: actions/setup-java@v2
1717
with:
1818
distribution: 'zulu'
19-
java-version: '11'
19+
java-version: '17'
2020

2121
- name: Prepare environment
2222
env:

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pluginManagement {
4747
}
4848
plugins {
4949
...
50-
id("me.2bab.scratchpaper") version "3.2.1" apply false
50+
id("me.2bab.scratchpaper") version "3.3.0" apply false
5151
}
5252
}
5353
@@ -61,7 +61,7 @@ buildscript {
6161
}
6262
dependencies {
6363
...
64-
classpath("me.2bab:scratchpaper:3.2.1")
64+
classpath("me.2bab:scratchpaper:3.3.0")
6565
}
6666
}
6767
```
@@ -126,8 +126,10 @@ ScratchPaper is only supported & tested on LATEST ONE Minor versions of Android
126126

127127
AGP Version|Latest Support Version
128128
-----------|-----------------
129-
7.2.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
130-
7.1.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
129+
8.1.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
130+
8.0.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
131+
7.2.x | 3.2.1
132+
7.1.x | 3.2.1
131133
7.0.x | 3.0.0
132134
4.2.x | 2.6.0
133135
4.1.x | 2.5.4
@@ -162,7 +164,7 @@ The v1.x `IconCover` forked from [icon-version@akonior](https://github.com/akoni
162164
## License
163165

164166
>
165-
> Copyright 2016-2022 2BAB
167+
> Copyright Since 2016 2BAB
166168
>
167169
>Licensed under the Apache License, Version 2.0 (the "License");
168170
you may not use this file except in compliance with the License.

README_zh.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pluginManagement {
4242
}
4343
plugins {
4444
...
45-
id("me.2bab.scratchpaper") version "3.2.1" apply false
45+
id("me.2bab.scratchpaper") version "3.3.0" apply false
4646
}
4747
}
4848

@@ -56,7 +56,7 @@ buildscript {
5656
}
5757
dependencies {
5858
...
59-
classpath("me.2bab:scratchpaper:3.2.1")
59+
classpath("me.2bab:scratchpaper:3.3.0")
6060
}
6161
}
6262
```
@@ -119,8 +119,10 @@ scratchPaper {
119119

120120
AGP Version|Latest Support Version
121121
-----------|-----------------
122-
7.2.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
123-
7.1.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
122+
8.1.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
123+
8.0.x | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/me.2bab/scratchpaper/badge.svg)](https://search.maven.org/artifact/me.2bab/scratchpaper)
124+
7.2.x | 3.2.1
125+
7.1.x | 3.2.1
124126
7.0.x | 3.0.0
125127
4.1.x | 2.5.4
126128
4.0.x | 2.5.3
@@ -152,7 +154,7 @@ The v1.x `IconCover` forked from [icon-version@akonior](https://github.com/akoni
152154
## License
153155

154156
>
155-
> Copyright 2016-2022 2BAB
157+
> Copyright Since 2016 2BAB
156158
>
157159
>Licensed under the Apache License, Version 2.0 (the "License");
158160
you may not use this file except in compliance with the License.

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
dependencies {
66
// Github Release
7-
implementation("com.github.breadmoirai:github-release:2.2.12")
7+
implementation("com.github.breadmoirai:github-release:2.5.2")
88
}
99

1010
repositories {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
object BuildConfig {
22

33
object Versions {
4-
const val scratchPaperVersion = "3.2.1"
4+
const val scratchPaperVersion = "3.3.0"
55
}
66

77
}
Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
11
import com.github.breadmoirai.githubreleaseplugin.GithubReleaseTask
22
import java.util.*
33

4-
val libs = File(project.buildDir.absoluteFile, "libs")
54
val taskName = "releaseArtifactsToGithub"
6-
val artifacts: DirectoryProperty = project.objects.directoryProperty()
7-
artifacts.set(libs)
8-
9-
// Temporary workaround for directory is not recognized by ReleaseAssets
10-
gradle.taskGraph.whenReady {
11-
beforeTask {
12-
if (this is GithubReleaseTask) {
13-
this.setReleaseAssets(libs.listFiles())
14-
}
15-
}
16-
}
175

186
val tokenFromEnv: String? = System.getenv("GH_DEV_TOKEN")
197
val token: String = if (!tokenFromEnv.isNullOrBlank()) {
@@ -31,31 +19,36 @@ val repo = "ScratchPaper"
3119
val tagBranch = "master"
3220
val version = BuildConfig.Versions.scratchPaperVersion
3321
val releaseNotes = ""
34-
createGithubReleaseTaskInternal(artifacts, token, repo, tagBranch, version, releaseNotes)
35-
36-
37-
fun createGithubReleaseTaskInternal(artifacts: DirectoryProperty,
38-
token: String,
39-
repo: String,
40-
tagBranch: String,
41-
version: String,
42-
releaseNotes: String): TaskProvider<GithubReleaseTask> {
43-
// val id = version.replace(".", "")
44-
return project.tasks.register<GithubReleaseTask>("releaseArtifactsToGithub") {
45-
setAuthorization("Token $token")
46-
setOwner("2bab")
47-
setRepo(repo)
48-
setTagName(version)
49-
setTargetCommitish(tagBranch)
50-
setReleaseName(version)
51-
setBody(releaseNotes)
52-
setDraft(false)
53-
setPrerelease(false)
54-
setReleaseAssets(artifacts)
55-
setOverwrite(true)
56-
setAllowUploadToExisting(true)
57-
setApiEndpoint("https://api.github.com")
58-
setDryRun(false)
22+
val task = createGithubReleaseTaskInternal(token, repo, tagBranch, version, releaseNotes)
23+
24+
25+
fun createGithubReleaseTaskInternal(
26+
token: String,
27+
repo: String,
28+
tagBranch: String,
29+
version: String,
30+
releaseNotes: String
31+
): TaskProvider<GithubReleaseTask> {
32+
return project.tasks.register<GithubReleaseTask>(taskName) {
33+
authorization.set("Token $token")
34+
owner.set("2bab")
35+
this.repo.set(repo)
36+
tagName.set(version)
37+
targetCommitish.set(tagBranch)
38+
releaseName.set("v${version}")
39+
body.set(releaseNotes)
40+
draft.set(false)
41+
prerelease.set(false)
42+
overwrite.set(true)
43+
allowUploadToExisting.set(true)
44+
apiEndpoint.set("https://api.github.com")
45+
dryRun.set(false)
46+
generateReleaseNotes.set(false)
47+
releaseAssets.from(
48+
tasks.getByName<Jar>("jar").archiveFile, // seal-${version}.jar
49+
tasks.getByName<Jar>("sourcesJar").archiveFile, // seal-${version}-sources.jar
50+
tasks.getByName<Jar>("javadocJar").archiveFile, // seal-${version}-javadoc.jar
51+
//tasks.getByName<Sign>("signPluginMavenPublication").outputs, // seal-${version}-asc.jar, seal-${version}-sources-asc.jar, seal-${version}-sources-asc.jar,
52+
)
5953
}
60-
}
61-
54+
}

buildSrc/src/main/kotlin/maven-central-publish.gradle.kts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ if (secretPropsFile.exists()) {
2929
ext["ossrh.username"] = System.getenv("OSSRH_USERNAME")
3030
ext["ossrh.password"] = System.getenv("OSSRH_PASSWORD")
3131
}
32-
val javadocJar by tasks.registering(Jar::class) {
33-
archiveClassifier.set("javadoc")
34-
}
35-
3632
fun getExtraString(name: String) = ext[name]?.toString()
3733

3834

@@ -74,20 +70,16 @@ publishing {
7470
}
7571
}
7672

77-
signing {
78-
sign(publishing.publications)
79-
}
80-
8173
afterEvaluate {
8274
publishing.publications.all {
75+
signing.sign(this)
8376
val publicationName = this.name
8477
(this as MavenPublication).apply {
8578
if (publicationName == "pluginMaven") {
8679
groupId = groupName
8780
artifactId = projectName
8881
}
8982
version = BuildConfig.Versions.scratchPaperVersion
90-
artifact(javadocJar.get())
9183

9284
pom {
9385
if (publicationName == "pluginMaven") {

deps.versions.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[versions]
2-
kotlinVer = "1.6.21"
3-
androidToolVer = "30.1.0"
4-
polyfillVer = "0.7.0"
2+
kotlinVer = "1.9.22"
3+
androidToolVer = "31.2.0"
4+
polyfillVer = "0.9.1"
55
mockitoVer = "3.9.0"
66

7-
agpVer = "7.2.2"
8-
agpPatchIgnoredVer = "7.2.0" # To be used by backport version matching
9-
agpBackportVer = "7.1.3"
10-
agpBackportPatchIgnoredVer = "7.1.0" # To be used by backport version matching, e.g. apply backport patches when (7.1.0 <= ver < 7.2.0)
7+
agpVer = "8.1.2"
8+
agpPatchIgnoredVer = "8.1.0" # To be used by backport version matching
9+
agpBackportVer = "8.0.1"
10+
agpBackportPatchIgnoredVer = "8.0.0" # To be used by backport version matching, e.g. apply backport patches when (7.1.0 <= ver < 7.2.0)
1111

1212
[libraries]
1313
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agpVer" }

functional-test/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ group = "me.2bab"
77

88
java {
99
withSourcesJar()
10-
sourceCompatibility = JavaVersion.VERSION_1_8
11-
targetCompatibility = JavaVersion.VERSION_1_8
10+
withJavadocJar()
11+
sourceCompatibility = JavaVersion.VERSION_11
12+
targetCompatibility = JavaVersion.VERSION_17
1213
}
1314

1415
dependencies {

0 commit comments

Comments
 (0)