forked from obbimi/Squore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
267 lines (236 loc) · 13.6 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// export ANDROID_HOME=/osshare/software/google/android-sdk-linux
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // for firebase, comment out for custom branded version of the app that are not in google-services.json
buildscript {
// required for using gradle i.s.o. gradlew
repositories {
google()
mavenCentral()
}
dependencies {
//classpath 'com.android.tools.build:gradle:4.1.3'
//classpath "com.android.tools.build:gradle:7.0.4"
//classpath "com.android.tools.build:gradle:7.2.0"
classpath "com.android.tools.build:gradle:7.3.1"
// gradle-wrapper.properties may contain 8.2
//classpath "com.android.tools.build:gradle:7.4.2" // almost succeeds
//classpath "com.android.tools.build:gradle:8.5.1" // requires gradle 8.7 in wrapper
// NOTE: Resource IDs will be non-final by default in Android Gradle Plugin version 8.0, avoid using them in switch case statements
// added for firebase to parse google-services.json
classpath 'com.google.gms:google-services:4.3.5'
//classpath 'com.google.gms:google-services:4.4.2' // 4.3.5 ok, 4.3.10 breaks, 4.4.2 asks for additional initialization but that seems not to work either
}
}
repositories {
mavenCentral() // for protobuf
google()
// required to work with aar file in libs dir
flatDir {
dirs 'libs'
}
}
// Run ./gradlew -q :dependencies
android {
namespace 'com.doubleyellow.scoreboard'
compileOptions {
// added when going from 1.1.9 to androidx.wear:wear:1.2.0
sourceCompatibility JavaVersion.VERSION_11 // @Deprecated in stead of LC @deprecated
targetCompatibility JavaVersion.VERSION_11
}
// compileSdkVersion seems required when running from command line?!
//compileSdkVersion 33
compileSdk 34 // makes NfcAdapter no longer compatible
// buildToolsVersion not required for gradle 3.0.0 and higher (e.g. when using wrapper)
//buildToolsVersion '28.0.3'
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false // to get rid of com.android.tools.lint.client.api.Vendor error
// Or, if you prefer, you can continue to check for errors in release builds, but continue the build even when errors are found:
abortOnError false
//deprecation true
// Normally lint will analyze all dependencies along with each module; this ensures
// that lint can correctly (for example) determine if a resource declared in a library
// is unused; checking only the library in isolation would not be able to identify this
// problem. However, this leads to quite a bit of extra computation; a library is
// analyzed repeatedly, for each module that it is used in.
//checkDependencies false
}
defaultConfig {
// must match (or be larger than) minSdkVersion of AndroidBase
// https://www.androidpolice.com/2018/10/28/android-platform-distribution-numbers-updated-october-pie-still-missing/
// https://en.wikipedia.org/wiki/Android_version_history
//minSdkVersion 19 // 4.4 android.os.Build.VERSION_CODES.KITKAT, for wear at least 23 is required
//minSdkVersion 23 // 6.0 android.os.Build.VERSION_CODES.M, for wear at least 23 is required, wear2.0 needs 25
}
sourceSets {
main {
manifest {
// one valid entry must be here in main.manifest
srcFile 'AndroidManifestSquore.xml'
}
java {
srcDir 'src'
// exclude '**/cast/**'
exclude '**/firebase/OneSignal**'
}
res {
srcDir 'res'
// exclude '**/layout-watch/**' // e.g. for non-wear does not work for resources
}
}
phoneTabletPre22 { manifest { srcFile 'AndroidManifestALLPhoneTabletPre22.xml' } }
phoneTabletPost23 { manifest { srcFile 'AndroidManifestALLPhoneTablet.xml' } }
wearOs { manifest { srcFile 'AndroidManifestALLWearOS.xml' } }
}
signingConfigs {
release {
try {
storeFile file(KEYSTORE_PATH)
storePassword KEYSTORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
} catch (ex) {
throw new InvalidUserDataException("Please do one of the following:\n 1) define KEYSTORE_PATH, KEYSTORE_PASSWORD, KEY_ALIAS and KEY_PASSWORD in \$HOME/.gradle/gradle.properties for creating signed apk's. Or, \n 2) Comment out the line 'signingConfig signingConfigs.release' in the file build.gradle to continue with unsigned apk's")
}
}
}
flavorDimensions "devicetype" // actual flavors use camelCase with first letter lowercase
def versionCodeXXX = 537
productFlavors {
// versionCodePrefix specifies [min_api_level][bitwise_supported_screensizes s=1,m=2,l=4,xl=8]
phoneTabletPre22 {
dimension "devicetype"
minSdkVersion 21 // increased to 21 for WearOS splashscreen dependency
targetSdkVersion 34
multiDexEnabled true // required since using firebase
versionCode 1915 * 10000 + versionCodeXXX
versionName "4.55"
}
phoneTabletPost23 {
dimension "devicetype"
minSdkVersion 23
targetSdkVersion 34
versionCode 2315 * 10000 + versionCodeXXX
versionName "4.55"
}
wearOs {
dimension "devicetype"
minSdkVersion 25 // 25 for Wear2.0 (23 would suffice for Wear1.0)
targetSdkVersion 34
versionCode 2501 * 10000 + versionCodeXXX
versionName "4.55"
}
}
buildTypes {
release {
signingConfig signingConfigs.release // comment out this line if you are just trying a simple build that does need to be signed
//embedMicroApp true
//minifyEnabled true // somehow this makes the app crash
//shrinkResources true // can not be done without minifyEnabled
// proguardFiles 'proguard-android-optimize.txt',
// 'proguard-rules.pro'
//proguardFiles 'proguard-rules.pro'
//proguardFiles 'proguard-android.txt'
//proguardFiles 'proguard-android-optimize.txt'
}
/*
debug {
initWith release
manifestPlaceholders = [hostName:"internal.example.com"]
applicationIdSuffix ".debug"
debuggable true
}
minified {
//debuggable true
minifyEnabled true // somehow this makes my app crash
// 'shrinkResources=true' currently only helps for 2%
shrinkResources true
//proguardFile 'proguard-project.txt'
signingConfig signingConfigs.release
}
*/
}
aaptOptions {
ignoreAssetsPattern '_gh_pages'
}
}
dependencies {
//implementation project(':AndroidBase')
implementation 'com.doubleyellow:AndroidBase@aar'
// uncommenting this while in Android Studio creates a subdir AndroidBase with an .iml file in it
implementation 'androidx.wear:wear:1.3.0' // minSdk=23 for 1.[0-2].0
implementation 'androidx.wear:wear-input:1.1.0' // minSdk=25
//phoneTabletPre22Implementation 'androidx.wear:wear-input:1.1.0'// comment out this line temporarily what code will lead to errors when invocation is not prevented using Build.VERSION.SDK_INT > Build.VERSION_CODES.?
//phoneTabletPost23Implementation 'androidx.wear:wear-input:1.1.0'// minSdk=25
//wearOsImplementation 'androidx.wear:wear-input:1.1.0'
//wearOsImplementation 'androidx.wear:wear:1.0.0' // needs minSdkVersion=23
//implementation 'com.android.support:wear:28.0.0' // needs minSdkVersion=23
//implementation 'com.google.protobuf:protobuf-java:3.5.1'
implementation fileTree(dir: 'libs', include: ['*.jar']) // AndroidBase and Graph
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // 2.2.0 fails ... this one is not actually required, but removing it makes com.doubleyellow.scoreboard.history.MatchGameScoresView in portrait spacing incorrect?!
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.6.1'
// moving from 1.3.1 to 1.4.0 makes e.g. Wear OS in emulator fail, 1.7.0 made build fail it seems (20250105)
//implementation 'androidx.legacy:legacy-support-v13:1.0.0'
// Wear OS requires a splash screen: https://developer.android.com/design/ui/wear/guides/behaviors-and-patterns/launch#branded
//implementation 'androidx.core:core-splashscreen:1.1.0-alpha02'
implementation 'androidx.core:core-splashscreen:1.0.1'
// ChromeCast (new with Custom Receiver)
phoneTabletPre22Implementation 'com.google.android.gms:play-services-cast-framework:22.0.0'
phoneTabletPost23Implementation 'com.google.android.gms:play-services-cast-framework:22.0.0'
wearOsImplementation 'com.google.android.gms:play-services-cast-framework:22.0.0'
// wearOs can not cast but to run it still needs 'Implementation' to not have 'ClassNotFound' exceptions
// allow communication between handheld device and wearable
phoneTabletPre22CompileOnly 'com.google.android.gms:play-services-wearable:19.0.0'
// compileOnly is good enough for API < 23
phoneTabletPost23Implementation 'com.google.android.gms:play-services-wearable:19.0.0'
wearOsImplementation 'com.google.android.gms:play-services-wearable:19.0.0'
phoneTabletPre22CompileOnly 'com.google.android.support:wearable:2.9.0'
phoneTabletPost23Implementation 'com.google.android.support:wearable:2.9.0'
wearOsImplementation 'com.google.android.support:wearable:2.9.0'
// Required when using 'com.google.android.support:wearable:2.9.0' for e.g. com/google/android/gms/wearable/CapabilityClient$OnCapabilityChangedListener
compileOnly 'com.google.android.wearable:wearable:2.9.0' // compileOnly sufficient for devices with API < 23
//phoneTabletPre22CompileOnly 'com.google.android.wearable:wearable:2.9.0'
//phoneTabletPost23CompileOnly 'com.google.android.wearable:wearable:2.9.0'
//wearOsCompileOnly 'com.google.android.wearable:wearable:2.9.0'
//wearApp project(':wear:base') // applies to all other variants
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
//implementation platform('com.google.firebase:firebase-bom:30.4.1')
//implementation 'com.google.firebase:firebase-messaging'
//implementation 'com.google.firebase:firebase-core'
//implementation 'com.google.firebase:firebase-iid'
// For an optimal experience using FCM, add the Firebase SDK for Google Analytics. This is recommended, but not required.
//implementation 'com.google.firebase:firebase-analytics'
implementation platform('com.google.firebase:firebase-bom:33.7.0') // 2022-12-17: compiles OK but PushNotifications.start in PusherHandler.init fails with java.lang.ClassNotFoundException: com.google.firebase.iid.FirebaseInstanceId if firebase-iid is not added specifically
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-analytics' // replaces firebase-core
implementation 'com.google.firebase:firebase-installations' // replaces firebase-iid
// https://github.com/pusher/push-notifications-android/issues/117
implementation 'com.google.firebase:firebase-iid:21.1.0' // add explicitly since no longer in the BOM, but required by com.pusher:push-notifications-android:1.9.0
// mqtt
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.5'
//implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1' // does not support android 12
//implementation 'com.github.hannesa2:paho.mqtt.android:4.3' // new mqtt library that supports android 12 (https://github.com/hannesa2/paho.mqtt.android/releases/download/4.3/serviceLibrary-release.aar)
//implementation 'paho.mqtt.android:Hannesa2PahoMQTT4.3@aar' // new mqtt library that supports android 12 (https://github.com/hannesa2/paho.mqtt.android/releases/download/4.3/serviceLibrary-release.aar)
implementation 'paho.mqtt.android:Hannesa2PahoMQTT@aar' // new mqtt library that supports android 12 (https://github.com/hannesa2/paho.mqtt.android/releases/download/3.5.1/serviceLibrary-release.aar)
implementation 'com.jakewharton.timber:timber:5.0.1' // required by 'new' paho
//implementation 'androidx.legacy:legacy-support-v4:1.0.0' // required by 'new' paho
// open source library for in-app-purchasing implementation
implementation 'com.anjlab.android.iab.v3:library:2.2.0'
//implementation 'com.anjlab.android.iab.v3:library:2.2.0' // somehow gives error/conflict complaining about 6.1.0 in manifest
//implementation 'com.android.billingclient:billing:6.1.0'
// firebase in combination with pusher
// https://github.com/pusher/push-notifications-android
implementation 'com.pusher:push-notifications-android:1.9.2'
// added to avoid compile issues due to multiple kotlin libraries included by dependencies
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0'
}
/*
dependencies {
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation 'com.android.support.test:rules:1.0.2'
}
*/