-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathbuild.gradle
151 lines (126 loc) · 5.71 KB
/
build.gradle
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
plugins {
id 'com.android.library'
id 'kotlin-android'
id "com.google.devtools.ksp" version "1.8.10-1.0.9"
id 'kotlinx-serialization'
}
apply from:rootProject.file('base.gradle')
android {
buildFeatures {
compose true
buildConfig true
}
namespace 'com.funny.translation.core'
}
dependencies {
// androidx.core
// api 'androidx.core:core-ktx:1.7.0'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${Versions.kotlinVersion}"
api "org.jetbrains.kotlinx:kotlinx-datetime:0.4.0"
api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
api "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5"
api "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlinVersion}"
def coroutines_version = '1.5.1'
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
// OkHttp
api "com.squareup.okhttp3:okhttp:4.9.1"
// 网络请求
def retrofit_version = "2.9.0"
api "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0"
implementation ('com.github.ihsanbal:LoggingInterceptor:3.1.0') {
exclude group: 'org.json', module: 'json'
}
//JS rhino
api 'com.github.gedoor:rhino-android:1.6'
// Coil
api "io.coil-kt:coil-compose:2.4.0"
// 刘海屏适配
api 'com.github.smarxpan:NotchScreenTool:0.0.1'
// Material Design Color
api "com.github.FunnySaltyFish:CMaterialColors:1.0.21"
api 'com.github.FunnySaltyFish:ComposeLoading:v1.0.4'
api "androidx.biometric:biometric:1.2.0-alpha05"
api 'com.github.getActivity:ToastUtils:11.2'
// api 'com.github.Kyant0.Monet:Monet:0.1.0-alpha03-multiplatform-fixed'
implementation "androidx.palette:palette-ktx:1.0.0"
// Markwon
final def markwon_version = '4.6.2'
implementation "io.noties.markwon:core:$markwon_version"
implementation "io.noties.markwon:ext-strikethrough:$markwon_version"
implementation "io.noties.markwon:ext-tables:$markwon_version"
implementation "io.noties.markwon:html:$markwon_version"
implementation "io.noties.markwon:image-coil:$markwon_version"
implementation "io.noties.markwon:linkify:$markwon_version"
implementation 'me.saket:better-link-movement-method:2.2.0'
def room_version = Versions.roomVersion
api "androidx.room:room-runtime:$room_version"
api "androidx.room:room-ktx:$room_version"
api "androidx.room:room-paging:$room_version"
ksp "androidx.room:room-compiler:$room_version"
api 'androidx.annotation:annotation:1.5.0'
// Import the Compose BOM
api platform("androidx.compose:compose-bom:${Versions.composeBomVersion}")
api "androidx.compose.ui:ui"
api "androidx.compose.material:material"
api "androidx.compose.ui:ui-tooling"
api "androidx.compose.animation:animation"
api "androidx.appcompat:appcompat:${Versions.appCompatVersion}"
api "androidx.navigation:navigation-compose:2.7.0"
api "androidx.activity:activity-compose:${Versions.activityComposeVersion}"
api "androidx.activity:activity-ktx:${Versions.activityComposeVersion}"
api "androidx.lifecycle:lifecycle-viewmodel-compose:${Versions.lifeCycleViewModelComposeVersion}"
// https://mvnrepository.com/artifact/androidx.lifecycle/lifecycle-runtime-ktx
runtimeOnly 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
api "androidx.compose.material3:material3"
api "androidx.compose.material3:material3-window-size-class"
def accompanist_version = "0.31.6-rc"
api "com.google.accompanist:accompanist-systemuicontroller:$accompanist_version"
api "com.google.accompanist:accompanist-navigation-animation:$accompanist_version"
api "com.google.accompanist:accompanist-pager-indicators:$accompanist_version"
api "com.google.accompanist:accompanist-permissions:$accompanist_version"
api project(path: ':jet-setting-core')
implementation(name: "monet", ext: "aar");
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
// 定义函数,用于输出 Hello, FunnyTranslation Open Source
static def printHello(Exec exec) {
// just print FunnyTranslation OpenSource
// windows: cmd /c echo FunnyTranslation OpenSource
// linux: sh -c echo FunnyTranslation OpenSource
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
exec.commandLine "cmd", "/c", "echo", "Hello FunnyTranslation-OpenSource"
} else {
exec.commandLine "sh", "-c", "echo", "Hello FunnyTranslation-OpenSource"
}
}
tasks.register('encryptFunnyJs', Exec) {
// 如果 funny_sign_v1_release 存在,则用它
def release = new File(rootDir, "funny_sign_v1_release_template.js")
println("release.exists() = " + release.exists())
if (release.exists()) {
def filePath = release.absolutePath
def assetsDir = android.sourceSets.main.assets.srcDirs[0]
def targetFilePath = new File(assetsDir, "funny_sign_v1_release.js").absolutePath
def versionCode = Versions.versionCode
commandLine "node", rootProject.file("encrypt_funny_js.js"), filePath, targetFilePath, versionCode
} else {
printHello(it)
}
standardOutput = new ByteArrayOutputStream()
doLast {
println standardOutput.toString()
}
}
tasks.register("signApk", Exec) { exec ->
// 执行根目录下的 sign_new_key.py
def signNewKey = rootProject.file("sign_new_key.py")
if (signNewKey.exists()) {
exec.commandLine "python", signNewKey.path, rootDir.path
} else {
printHello(exec)
}
}