本文主要是介绍王学岗切面编程(AOP)最新配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
不懂啥是切面编程的看我这篇文章
本文主要讲解最新的切面编程配置
首先看下app的build.gradle界面,有两处配置
plugins {id("com.android.application")id("org.jetbrains.kotlin.android")
// 配置1id("com.ibotta.gradle.aop")
}android {namespace = "com.example.myaspecttest1"compileSdk = 34defaultConfig {applicationId = "com.example.myaspecttest1"minSdk = 24targetSdk = 34versionCode = 1versionName = "1.0"testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"}buildTypes {release {isMinifyEnabled = falseproguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"),"proguard-rules.pro")}}compileOptions {sourceCompatibility = JavaVersion.VERSION_1_8targetCompatibility = JavaVersion.VERSION_1_8}kotlinOptions {jvmTarget = "1.8"}
}dependencies {implementation("androidx.core:core-ktx:1.9.0")implementation("androidx.appcompat:appcompat:1.6.1")implementation("com.google.android.material:material:1.10.0")implementation("androidx.constraintlayout:constraintlayout:2.1.4")// 配置2implementation("org.aspectj:aspectjrt:1.9.7")testImplementation("junit:junit:4.13.2")androidTestImplementation("androidx.test.ext:junit:1.1.5")androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}
项目的build.gradle里,有一处配置
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {id("com.android.application") version "8.1.1" apply falseid("org.jetbrains.kotlin.android") version "1.9.0" apply false
// 配置1id("com.ibotta.plugin") version "1.4.1" apply false
}
setting.gradle里有一处配置
pluginManagement {repositories {google()mavenCentral()gradlePluginPortal()}
// 配置1resolutionStrategy {eachPlugin {if (requested.id.id == "com.ibotta.plugin") {useModule("com.ibotta:plugin:1.4.1")}}}
}
dependencyResolutionManagement {repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)repositories {google()mavenCentral()}
}rootProject.name = "MyAspectTest1"
include(":app")
怎么样,是不是比以前简洁多啦
这篇关于王学岗切面编程(AOP)最新配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!