Skip to content

Commit

Permalink
build:降低agp到4.1.0,kt到1.3.72
Browse files Browse the repository at this point in the history
  • Loading branch information
Petterpx committed Jun 22, 2022
1 parent c7bffe7 commit 2652b6e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
8 changes: 3 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ android {
}

dependencies {

implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
testImplementation 'junit:junit:4.13.2'
implementation project(path: ':childModel')
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -9,10 +9,6 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:text="Hello World!" />

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
8 changes: 7 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
}
}

//plugins {
// // 这个 id 就是在 lc_versio/≥n 文件夹下 build.gradle 文件内定义的id
// id 'com.xiachufang.manifest.exported' apply false
//}

allprojects {
repositories {
google()
Expand All @@ -20,6 +25,7 @@ allprojects {
}



task clean(type: Delete) {
delete rootProject.buildDir
}
6 changes: 3 additions & 3 deletions childModel/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
8 changes: 4 additions & 4 deletions exported-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
}
}

Expand Down Expand Up @@ -53,9 +53,9 @@ publishing {


dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31"
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
implementation 'com.android.tools.build:gradle:4.2.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72"
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
implementation 'com.android.tools.build:gradle:4.1.0'
}


Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ open class AddExportMainManifestTask : DefaultTask() {
nodes.forEach { it ->
val isExported = it.nodeList().any { node ->
node.nodeList().any {
it.name() == "action" && it.anyTag(qNameKey, values = extArg.actionRules)
it.name() == "action" &&
it.anyTag(qNameKey, extArg.actionRules)
}
}
it.attributes()["android:exported"] = "$isExported"
Expand All @@ -96,7 +97,7 @@ open class AddExportMainManifestTask : DefaultTask() {

private fun Node.nodeList() = (this.value() as NodeList).map { it as Node }

private fun Node.anyTag(key: QName, vararg values: String) =
private fun Node.anyTag(key: QName, values: Array<String>) =
attributes()[key]?.let { value ->
values.any {
it == value.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.android.build.api.variant.VariantFilter
import com.android.build.gradle.AppExtension
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.tasks.ProcessApplicationManifest
import org.gradle.api.Action
import java.util.* // ktlint-disable no-wildcard-imports
import kotlin.collections.ArrayList
import org.gradle.api.Plugin
Expand All @@ -28,11 +29,11 @@ class ExportedPlugin : Plugin<Project> {

private fun readAppModelVariant(p: Project) {
val appExtension = p.extensions.getByType(AppExtension::class.java)
appExtension.variantFilter { variantFilter: VariantFilter ->
appExtension.variantFilter(Action {
variantNames.add(
variantFilter.name
it.name
)
}
})
}

/**
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 20 23:11:39 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 2652b6e

Please sign in to comment.