-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MOD: compatible with agp7.4 * FIX: DefaultLifecycleObserver compatibility problems * ADD: Build apk check * ADD: agp test case * MOD: add generated code to srcDir logic Co-authored-by: jiangjunxiang <[email protected]>
- Loading branch information
1 parent
172972d
commit 2ae282c
Showing
11 changed files
with
111 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
kace-runtime/src/main/java/com/kanyun/kace/KaceLifecycleObserver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2022 KanYun | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.kanyun.kace | ||
|
||
import androidx.lifecycle.DefaultLifecycleObserver | ||
import androidx.lifecycle.LifecycleOwner | ||
|
||
internal open class KaceLifecycleObserver : DefaultLifecycleObserver { | ||
override fun onCreate(owner: LifecycleOwner) {} | ||
|
||
override fun onStart(owner: LifecycleOwner) {} | ||
|
||
override fun onResume(owner: LifecycleOwner) {} | ||
|
||
override fun onPause(owner: LifecycleOwner) {} | ||
|
||
override fun onStop(owner: LifecycleOwner) {} | ||
|
||
override fun onDestroy(owner: LifecycleOwner) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ vgoTargetSdkVersion = 26 | |
|
||
kotlin_version = 1.7.0 | ||
kotlin_coroutine_version = 1.6.3 | ||
|
||
testAgp=false | ||
agpVersion=4.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
pluginManagement { | ||
val testAgp: String by extra | ||
val agpVersion: String by extra | ||
|
||
repositories { | ||
if (testAgp == "true") { | ||
mavenLocal() | ||
} | ||
mavenCentral() | ||
gradlePluginPortal() | ||
google() | ||
} | ||
|
||
resolutionStrategy { | ||
eachPlugin { | ||
val requestedId = requested.id.id | ||
if (requestedId == "com.android.application" || requestedId == "com.android.library") { | ||
useVersion(agpVersion) | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
include(":sample-lib") | ||
include(":app") | ||
|
||
rootProject.name = "kace-sample" | ||
|
||
includeBuild("../../Kace") | ||
val testAgp: String by extra | ||
if (testAgp != "true") { | ||
includeBuild("../../Kace") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function setGradleVersion() { | ||
local distributionBase=https\://services.gradle.org/distributions/ | ||
|
||
local GradleVersion=$1 | ||
echo ./gradlew -PSetGradleVersion=true wrapper --gradle-distribution-url ${distributionBase}gradle-$GradleVersion-bin.zip | ||
./gradlew -PSetGradleVersion=true wrapper --gradle-distribution-url ${distributionBase}gradle-$GradleVersion-bin.zip | ||
} | ||
|
||
function testUnderAGPVersion() { | ||
local TestAGPVersion=$1 | ||
./gradlew clean | ||
|
||
echo ./gradlew :app:assembleMinApi21DemoDebug -PtestAgp=true -PagpVersion=$TestAGPVersion | ||
./gradlew :app:assembleMinApi21DemoDebug -PtestAgp=true -PagpVersion=$TestAGPVersion | ||
} | ||
|
||
cd kace-sample | ||
|
||
setGradleVersion 6.7.1 | ||
testUnderAGPVersion 4.2.0 | ||
|
||
setGradleVersion 7.3.3 | ||
testUnderAGPVersion 7.2.0 | ||
|
||
setGradleVersion 7.4 | ||
testUnderAGPVersion 7.3.0 | ||
|
||
setGradleVersion 7.5 | ||
testUnderAGPVersion 7.4.0 |