-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbuild.gradle
More file actions
137 lines (122 loc) · 4.17 KB
/
build.gradle
File metadata and controls
137 lines (122 loc) · 4.17 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
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
plugins {
id "com.android.application"
}
def KEYSTOREPASSWORD = System.getenv('KEYSTOREPASSWORD')
def secretsPropertiesFile = file('../secrets.properties')
def secretsProperties = new Properties()
def secrets = System.getenv("GOOGLE_ANALYTICS")
def analyticsEnabled = secrets != null
def useEnvForFirebase = true
if (secretsPropertiesFile.exists()) {
secretsProperties.load(new FileInputStream(secretsPropertiesFile))
}
if (analyticsEnabled) {
useEnvForFirebase = true
} else if (secretsPropertiesFile.exists()) {
if (secretsProperties.getProperty('useFirebase') != null) {
analyticsEnabled = secretsProperties.getProperty('useFirebase') == "true"
if (analyticsEnabled) {
useEnvForFirebase = false
}
}
}
if (analyticsEnabled) {
apply plugin: "com.google.gms.google-services"
}
def signingEnabled = false
def password = ""
if (KEYSTOREPASSWORD != null) {
password = KEYSTOREPASSWORD
signingEnabled = true
} else if (secretsPropertiesFile.exists()) {
if (secretsProperties.getProperty('keyStorePassword') != null) {
password = secretsProperties.getProperty('keyStorePassword')
signingEnabled = true
}
}
android {
compileSdk 32
buildToolsVersion "33.0.2"
useLibrary 'org.apache.http.legacy'
namespace "android.code.editor"
def gitCommitHash = "git rev-parse HEAD".execute().text.trim()
def getCommitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = stdout
}
return stdout.toString().trim()
}
defaultConfig {
applicationId "android.code.editor"
minSdk 24
targetSdk 34
versionCode 2
versionName "1.0-Snapshot-" + getCommitHash()
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
}
signingConfigs {
release {
if (signingEnabled) {
storeFile file("../keystore.jks")
storePassword password
keyAlias "AndroidCodeEditor"
keyPassword password
}
}
debug {
if (signingEnabled) {
storeFile file("../keystore.jks")
storePassword password
keyAlias "AndroidCodeEditor"
keyPassword password
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
debuggable true
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.coordinatorlayout:coordinatorlayout:1.2.0"
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.termux.termux-app:terminal-view:0.117'
implementation 'com.termux.termux-app:terminal-emulator:0.117'
implementation 'org.nanohttpd:nanohttpd:2.3.0'
def editorGroupId = "io.github.Rosemoe.sora-editor"
implementation platform("$editorGroupId:bom:0.23.4")
implementation "$editorGroupId:editor"
implementation "$editorGroupId:language-textmate"
implementation 'jp.co.cyberagent.android:gpuimage:2.1.0'
if (analyticsEnabled) {
if (useEnvForFirebase) {
new File("$projectDir/google-services.json").text = secrets;
}
}
implementation platform('com.google.firebase:firebase-bom:32.2.3')
implementation("com.google.firebase:firebase-analytics")
implementation project(path:':markdown-viewer')
implementation project(path:':editor')
implementation project(path:':treeview')
implementation project(path:':common')
}