build.gradle 2.95 KB
group 'com.wxwork.flutter_wxwork'
version '1.0'

buildscript {

    repositories {
        // maven {
        //     url 'file:/Users/wangdongni/Desktop/oneKey_wdn_none_safty/Flutter-ReserveApp/library/flutter_wxwork/android/libs/maven/'
        // }
        // //先查找本地仓库
        // mavenLocal()
        google()
        mavenCentral()
 
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.4.1'
    }
}

allprojects {
    repositories {

        //  maven {
        //     url 'file:/Users/wangdongni/Desktop/oneKey_wdn_none_safty/Flutter-ReserveApp/library/flutter_wxwork/android/libs/maven'
        // }
     
        // //先查找本地仓库
        // mavenLocal()
        google()
        mavenCentral()
        // google()
        // jcenter()
    }
}

apply plugin: 'com.android.library'
apply from: './aar_tools.gradle'

android {
    compileSdkVersion 33

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 30
    }
    dependencies {
        testImplementation 'junit:junit:4.13.2'
        testImplementation 'org.mockito:mockito-core:5.0.0'
        // implementation fileTree (dir:"../libs/maven/com/example/mylibrary/1.0",include:["*.jar","*.aar"])
    //    implementation 'com.example:mylibrary:1.0'
    //  implementation files('../libs/maven/com/example/mylibrary/1.0/mylibrary-1.0.aar')
    // implementation (fileTree("lib"))
    // implementation fileTree(dir: 'lib', include: ['*.aar'])
    // implementation (files ("lib/lib_wwapi-2.0.12.11.aar"))
    // implementation project(path: ':lib:wxwork')
    // implementation (fileTree("libs"))
    // api fileTree(dir: "libs", include: ["*.jar", "*.aar"])
    // compileOnly fileTree(includes: [".aar"],dir:"libs")
    //  compileOnly fileTree(includes: ["*.aar"],dir:"libs")
    // compileOnly files("$flutterRoot/bin/cache/artifacts/engine/android-arm/flutter.jar")
    // compileOnly("androidx.annotation:annotation:1.0.0")

       
    }

    testOptions {
        unitTests.all {
            testLogging {
                events "passed", "skipped", "failed", "standardOut", "standardError"
                outputs.upToDateWhen { false }
                showStandardStreams = true
            }
        }
    }
}


//读取配置
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') {
        reader-> localProperties.load(reader)
    }
}
//获取flutter sdk路径
def flutterRoot = localProperties.getProperty('flutter.sdk')
if(flutterRoot == null) {
    throw new GradleException('Flutter sdk not found.')
}
dependencies {
    compileOnly fileTree(includes: ["*.aar"],dir:"libs")
    compileOnly files("$flutterRoot/bin/cache/artifacts/engine/android-arm/flutter.jar")
    compileOnly("androidx.annotation:annotation:1.0.0")
}