build.gradle
2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
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")
}