-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
167 lines (148 loc) · 6.18 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
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.dropbox.dropshots'
id 'com.github.gmazzo.buildconfig'
id 'com.google.firebase.appdistribution'
}
if (file("$projectDir/google-services.json").exists()) {
apply plugin: 'com.google.gms.google-services'
}
String getLocalProperty(String property) {
def propertiesFile = new File(rootDir, "local.properties")
if (!propertiesFile.exists()) return null
def properties = new Properties()
properties.load(propertiesFile.newDataInputStream())
return properties.getProperty(property)
}
android {
def isAppDistributionBuild = System.getenv("UBQ_APP_DISTRIBUTION_BUILD")?.toBoolean() ?: false
def versionNameValue = isAppDistributionBuild ?
"${System.getenv("CESDK_AND_BRANCH_NAME")} - ${System.getenv("CESDK_AND_COMMIT_ID")}"
: "local"
namespace "ly.img.editor.showcase"
compileSdk libs.versions.androidCompileSdk.get().toInteger()
defaultConfig {
applicationId "ly.img.editor.showcase"
testApplicationId "ly.img.editor.showcase.test"
minSdk libs.versions.androidMinSdk.get().toInteger()
targetSdk libs.versions.androidTargetSdk.get().toInteger()
versionCode 1
versionName versionNameValue
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86_64", "x86"
}
resourceConfigurations += ['en']
}
sourceSets {
main {
def guidePatterns = ['engine-guides-', 'editor-guides-', 'camera-guides-']
file("$projectDir/..").listFiles().findAll { file ->
file.directory && guidePatterns.any { pattern ->
file.name.startsWith(pattern)
}
}.each { dir ->
java.srcDirs += dir
}
}
}
signingConfigs {
release {
storeFile rootProject.file("android-release.keystore")
storePassword System.getenv("CESDK_AND_KEYSTORE_PWD") ?: getLocalProperty("release_key_password")
keyAlias "cesdk-dev"
keyPassword System.getenv("CESDK_AND_KEYSTORE_PWD") ?: getLocalProperty("release_key_password")
}
}
buildTypes {
release {
firebaseAppDistribution {
artifactType="APK"
releaseNotes=versionNameValue
groups="internal"
}
def shrinkAndMinifyEnabled = System.getenv("CESDK_SHRINK_AND_MINIFY_ENABLED") == null
|| System.getenv("CESDK_SHRINK_AND_MINIFY_ENABLED") == "true"
signingConfig signingConfigs.release
minifyEnabled shrinkAndMinifyEnabled
shrinkResources shrinkAndMinifyEnabled
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
buildConfig false
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.kotlinCompilerExtension.get()
}
}
tasks.register('validateDropshotsRecordIsDisabled') {
doLast {
def propertiesFile = new File(rootDir, "gradle.properties")
if (!propertiesFile.exists()) {
throw new GradleException("Internal error. Please report to the android engine members!")
}
def properties = new Properties()
properties.load(propertiesFile.newDataInputStream())
if (properties.containsKey("dropshots.record")) {
throw new GradleException("dropshots.record should be commented out in apps/cesdk_android_examples/gradle.properties file!")
}
}
}
tasks.register('validateDropshotsRecordIsEnabled') {
doLast {
def propertiesFile = new File(rootDir, "gradle.properties")
if (!propertiesFile.exists()) {
throw new GradleException("Internal error. Please report to the android engine members!")
}
def properties = new Properties()
properties.load(propertiesFile.newDataInputStream())
if (!properties.containsKey("dropshots.record")) {
throw new GradleException("Screenshots need update. Enable dropshots.record in apps/cesdk_android_examples/gradle.properties.")
}
}
}
buildConfig {
className "ShowcasesBuildConfig"
packageName "ly.img.editor.showcase"
buildConfigField String, "BUILD_NAME", System.getenv("CESDK_AND_BUILD_NAME") ?: ""
buildConfigField String, "BRANCH_NAME", System.getenv("CESDK_AND_BRANCH_NAME") ?: ""
buildConfigField String, "COMMIT_ID", System.getenv("CESDK_AND_COMMIT_ID") ?: ""
buildConfigField String, "LICENSE", System.env.CESDK_APP_STORE_LICENSE ?: getLocalProperty("license") ?: ""
buildConfigField String, "UNSPLASH_HOST", System.env.CESDK_AND_UNSPLASH_HOST ?: getLocalProperty("unsplash_host") ?: ""
buildConfigField String, "REMOTE_ASSET_SOURCE_HOST", System.env.CESDK_AND_REMOTE_ASSET_SOURCE_HOST ?: getLocalProperty("remote_asset_source_host") ?: ""
buildConfigField int, "VERSION_CODE", android.defaultConfig.versionCode ?: 0
}
dependencies {
implementation project(':editor')
implementation project(':camera')
implementation libs.cesdk.engine
implementation libs.cesdk.engine.camera
implementation findProject(":editor-version-details") ?: project(":editor-version-details-dummy")
implementation libs.camera.core
implementation libs.camera.camera2
implementation libs.camera.view
implementation libs.camera.lifecycle
implementation libs.camera.video
def composeBom = platform(libs.compose.bom)
implementation composeBom
implementation libs.compose.material3
implementation libs.compose.navigation
implementation(libs.material) {
because "MaterialComponents DayNight theme"
}
androidTestImplementation composeBom
androidTestImplementation libs.test.androidx.runner
androidTestImplementation libs.compose.test.junit4
androidTestImplementation libs.espresso.core
debugImplementation libs.compose.test.manifest
}