Skip to content

Commit 42a8df8

Browse files
committed
fix
1 parent 45b28a4 commit 42a8df8

2 files changed

Lines changed: 41 additions & 12 deletions

File tree

android/build.gradle

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ buildscript {
1010
// jcenter()
1111
// JitPack 远程仓库:https://jitpack.io
1212
maven { url 'https://dl.bintray.com/jetbrains/anko'}
13-
maven { url 'https://jitpack.io' }
1413
maven { url 'https://download.flutter.io'}
1514
maven { url 'https://maven.aliyun.com/repository/public' }
1615
maven { url 'https://maven.aliyun.com/repository/google' }
@@ -21,23 +20,37 @@ buildscript {
2120
}
2221
}
2322

23+
// 定义一个方法, 用于获取当前moudle的dir
24+
def getCurrentProjectDir() {
25+
String result = ""
26+
rootProject.allprojects { project ->
27+
if (project.properties.get("identityPath").toString() == ":ali_auth") { // 这里是flutter的约定, 插件的module名是插件名, :是gradle的约定. project前加:
28+
result = project.properties.get("projectDir").toString()
29+
}
30+
}
31+
return result
32+
}
33+
2434
rootProject.allprojects {
35+
def dir = getCurrentProjectDir()
2536
repositories {
2637
mavenLocal()
2738
mavenCentral()
39+
maven {
40+
url "$dir/libs"
41+
}
2842
// google()
2943
// jcenter()
3044
// JitPack 远程仓库:https://jitpack.io
3145
maven { url 'https://dl.bintray.com/jetbrains/anko'}
32-
maven { url 'https://jitpack.io' }
3346
maven { url 'https://download.flutter.io'}
3447
maven { url 'https://maven.aliyun.com/repository/public' }
3548
maven { url 'https://maven.aliyun.com/repository/google' }
3649

3750
// 一键登录本地依赖
38-
// flatDir {
39-
// dirs project(':ali_auth').file('libs')
40-
// }
51+
flatDir {
52+
dirs project(':ali_auth').file('libs')
53+
}
4154
}
4255
}
4356

@@ -46,11 +59,11 @@ android {
4659
namespace = "com.sean.rao.ali_auth"
4760
}
4861

49-
sourceSets {
50-
main {
51-
jniLibs.srcDirs = ['libs']
52-
}
53-
}
62+
// sourceSets {
63+
// main {
64+
// jniLibs.srcDirs = ['libs']
65+
// }
66+
// }
5467

5568
compileSdkVersion 35
5669

@@ -87,11 +100,24 @@ android {
87100
implementation "androidx.appcompat:appcompat:1.3.0"
88101

89102
// 兼容安卓版本的fastjson库
90-
implementation 'com.alibaba.fastjson2:fastjson2:2.0.51.android5'
103+
implementation "com.alibaba.fastjson2:fastjson2:2.0.51.android5"
91104
// implementation 'com.google.code.gson:gson:2.10.1'
92105
// implementation 'com.alibaba:fastjson:1.2.83'
106+
// implementation "com.pgyer:sdk:3.0.9"
107+
108+
109+
implementation(name: "auth_number_product-${authLibVersion}-release", ext:'aar')
110+
implementation(name: "logger-${loggerVersion}-release", ext:'aar')
111+
implementation(name: "main-${mainVersion}-release", ext:'aar')
112+
113+
// implementation "com.mobile.auth:auth-number-product:2.14.14"
114+
// implementation project(':libs:main-release')
115+
// implementation project(':libs:logger-release')
116+
// implementation(version: "${authLibVersion}", name: "auth-number-release", ext:'aar', group: "libs")
117+
// implementation(version: "${loggerVersion}", name: "logger-release", ext:'aar', group: "libs")
118+
// implementation(version: "${mainVersion}", name: "main-release", ext:'aar', group: "libs")
93119

94-
implementation fileTree(dir: 'libs', include: ['*.aar'])
120+
// implementation fileTree(dir: 'libs', include: ['*.aar'])
95121
// implementation files("libs/auth_number_product-${authLibVersion}-release.aar")
96122
// implementation files("libs/logger-${loggerVersion}-release.aar")
97123
// implementation files("libs/main-${mainVersion}-release.aar")

android/libs/deploy.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mvn deploy:deploy-file -Dfile=sdk.aar -Durl="file://." -DgroupId="com.pgyer" -DartifactId="sdk" -Dversion="3.0.9"
2+
3+
mvn deploy:deploy-file -Dfile=sdk.aar -Durl="file://." -DgroupId="com.mobile.auth" -DartifactId="auth-number-product" -Dversion="2.14.14"

0 commit comments

Comments
 (0)