Skip to content

Commit

Permalink
Merge pull request #17 from 2BAB/dev
Browse files Browse the repository at this point in the history
Upgrade Polyfill to 0.7.0 and support AGP 7.2.x
  • Loading branch information
2BAB authored Aug 27, 2022
2 parents fb6a1e1 + e8b7aff commit 8384e44
Show file tree
Hide file tree
Showing 61 changed files with 450 additions and 420 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Xmx4g

defaults:
run:
working-directory: ./sample
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
Expand All @@ -41,7 +43,7 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ github.job }}-
- run: |
./gradlew assemble
./gradlew clean assembleDebug
checks:
name: Checks (unit tests and static analysis, TODO:add detekt check after set it up)
runs-on: ubuntu-latest
Expand All @@ -65,17 +67,12 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ github.job }}-
- run: |
./gradlew :seal:plugin:test
./gradlew :seal:test
functional-tests:
name: Functional tests
runs-on: ubuntu-latest
env:
JAVA_TOOL_OPTIONS: -Xmx4g
AGP_VERSION: ${{ matrix.agp-version }}
strategy:
matrix:
agp-version: [ 7.1.2, 7.2.0-beta04 ]

steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
Expand All @@ -89,8 +86,26 @@ jobs:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ github.job }}-${{ matrix.agp-version }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-${{ matrix.agp-version }}-
${{ runner.os }}-${{ github.job }}-
- name: Prepare environment
env:
SIGNING_SECRET_KEY_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_CONTENT }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$SIGNING_SECRET_KEY_CONTENT' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
- name: Build & Release all Polyfill libraries to MavenLocal
run: chmod +x ./publish_to_local.sh | ./publish_to_local.sh
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
SIGNING_SECRET_KEY_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_CONTENT }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GH_DEV_TOKEN: ${{ secrets.GH_DEV_TOKEN }}
- run: |
./gradlew :seal:plugin:functionalTest
./gradlew clean :functional-test:functionalTest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
*.iml
.gradle
/sample/local.properties
.idea
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
.idea/
.gradle/
build/
local/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ buildscript {
google()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.2")
classpath("me.2bab:seal:3.2.0")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("me.2bab:seal:3.3.0")
}
}
```
Expand Down
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
task("clean") {
delete(rootProject.buildDir)
allprojects {
group = "me.2bab"
version = BuildConfig.Versions.sealVersion
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object BuildConfig {

object Versions {
const val sealVersion = "3.2.0"
const val sealVersion = "3.3.0"
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugins{
plugins {
`maven-publish`
signing
}
Expand Down Expand Up @@ -32,6 +32,7 @@ if (secretPropsFile.exists()) {
val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

fun getExtraString(name: String) = ext[name]?.toString()


Expand All @@ -42,6 +43,7 @@ val baseUrl = "https://github.com/2BAB/Seal"
val siteUrl = baseUrl
val gitUrl = "$baseUrl.git"
val issueUrl = "$baseUrl/issues"
val emailAddr = "xx2bab@gmail.com"

val licenseIds = "Apache-2.0"
val licenseNames = arrayOf("The Apache Software License, Version 2.0")
Expand All @@ -50,25 +52,52 @@ val inception = "2017"

val username = "2BAB"


publishing {
// Configure MavenCentral repository
repositories {
maven {
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = getExtraString("ossrh.username")
password = getExtraString("ossrh.password")
}
}
}

// Configure MavenLocal repository
repositories {
maven {
name = "myMavenlocal"
url = uri(System.getProperty("user.home") + "/.m2/repository")
}
}
}

publications {
create<MavenPublication>("SealPlugin") {
signing {
sign(publishing.publications)
}

// To add missing information for the gradle plugin coordinator
afterEvaluate {
publishing.publications.all {
val publicationName = this.name
(this as MavenPublication).apply {
if (publicationName == "pluginMaven") {
groupId = groupName
artifactId = projectName
}
version = BuildConfig.Versions.sealVersion
artifact(javadocJar.get())
from(components["java"])

pom {
// Description
name.set(projectName)
if (publicationName == "pluginMaven") {
name.set(project.name)
}

description.set(mavenDesc)
url.set(siteUrl)

// Archive
groupId = groupName
artifactId = projectName
version = BuildConfig.Versions.sealVersion

// License
inceptionYear.set(inception)
licenses {
licenseNames.forEachIndexed { ln, li ->
Expand All @@ -91,28 +120,4 @@ publishing {
}
}
}

// Configure MavenCentral repository
repositories {
maven {
name = "sonatype"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = getExtraString("ossrh.username")
password = getExtraString("ossrh.password")
}
}
}

// Configure MavenLocal repository
repositories {
maven {
name = "myMavenlocal"
url = uri(System.getProperty("user.home") + "/.m2/repository")
}
}
}

signing {
sign(publishing.publications)
}
21 changes: 11 additions & 10 deletions deps.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[versions]
kotlinVer = "1.6.10"
agpVer = "7.1.2"
polyfillVer = "0.5.0"
mockitoVer = "3.9.0"
kotlinVer = "1.6.21"
polyfillVer = "0.7.0"
agpVer = "7.2.2"
agpPatchIgnoredVer = "7.2.0" # To be used by backport version matching
agpBackportVer = "7.1.3"
agpBackportPatchIgnoredVer = "7.1.0" # To be used by backport version matching, e.g. apply backport patches when (7.1.0 <= ver < 7.2.0)


[libraries]
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "agpVer" }
kotlin-std = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlinVer" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core-jvm", version = "1.3.1" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.3.1" }
kotlin-coroutine = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version = "1.6.0" }
hamcrest = { module = "org.hamcrest:hamcrest-library", version = "2.2" }
polyfill-main = { module = "me.2bab:polyfill", version.ref = "polyfillVer" }
polyfill-manifest = { module = "me.2bab:android-manifest-parser", version.ref = "polyfillVer" }
fastJson = { module = "com.alibaba:fastjson", version = "1.2.73" }
polyfill-manifest-parser = { module = "me.2bab:android-manifest-parser", version.ref = "polyfillVer" }
zip4j = { module = "net.lingala.zip4j:zip4j", version = "2.6.2" }
junit = { module = "junit:junit", version = "4.12" }
mockito = { module = "org.mockito:mockito-core", version.ref = "mockitoVer" }
mockitoInline = { module = "org.mockito:mockito-inline", version.ref = "mockitoVer" }

[bundles]

Expand Down
File renamed without changes.
45 changes: 45 additions & 0 deletions functional-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
}

group = "me.2bab"

java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation(deps.kotlin.std)
implementation(deps.kotlin.coroutine)
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
}

testing {
suites {
val functionalTest by registering(JvmTestSuite::class) {
useJUnitJupiter()
testType.set(TestSuiteType.FUNCTIONAL_TEST)
dependencies {
implementation(deps.hamcrest)
implementation("dev.gradleplugins:gradle-test-kit:7.4.2")
implementation(deps.kotlin.coroutine)
implementation(deps.kotlin.serialization)
implementation(deps.zip4j)
implementation(deps.polyfill.manifest.parser)
}
}
}
}

tasks.named("check") {
dependsOn(testing.suites.named("functionalTest"))
}

tasks.withType<Test> {
testLogging {
this.showStandardStreams = true
}
}
Loading

0 comments on commit 8384e44

Please sign in to comment.