昨天看了一段android配置aspectj實(shí)現(xiàn)AOP的直播視頻,就試著自己配置了一下,可能是因?yàn)槲易约旱腁ndroidStudio環(huán)境的問題,碰到了不少的坑(其實(shí)還是因?yàn)閷?duì)gradle理解的不多),但總歸是配置好了,就分享一下。
試了兩種方式,不過項(xiàng)目下的build.gradle,沒什么變化,直接看一下代碼吧:
build.gradle(項(xiàng)目下)
buildscript { ext { //android appcompat支持庫版本 androidSupportVersion = '26.1.0' //編譯的 SDK 版本,如API20 compileSdkVersion = 26 //構(gòu)建工具的版本,其中包括了打包工具aapt、dx等,如API20對(duì)應(yīng)的build-tool的版本就是20.0.0 buildToolsVersion = "26.0.2" //兼容的最低 SDK 版本 minSdkVersion = 15 //向前兼容,保存新舊兩種邏輯,并通過 if-else 方法來判斷執(zhí)行哪種邏輯 targetSdkVersion = 26 //kotlin版本號(hào) kotlin_version = '1.2.10' kotlinVersion = "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" appcompatV7 = "com.android.support:appcompat-v7:$androidSupportVersion" appcompatDesign = "com.android.support:design:$androidSupportVersion" constraintLayout = 'com.android.support.constraint:constraint-layout:1.0.2' } repositories { google() jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files classpath 'org.aspectj:aspectjtools:1.8.13' classpath 'org.aspectj:aspectjweaver:1.8.13' } } allprojects { repositories { google() jcenter() mavenCentral() } } task clean(type: Delete) { delete rootProject.buildDir }
網(wǎng)頁標(biāo)題:AndroidStudio配置AspectJ環(huán)境實(shí)現(xiàn)AOP的方法-創(chuàng)新互聯(lián)
本文URL:http://www.rwnh.cn/article22/ceiojc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、關(guān)鍵詞優(yōu)化、微信公眾號(hào)、軟件開發(fā)、網(wǎng)頁設(shè)計(jì)公司、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容