-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
68 lines (56 loc) · 2.46 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
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
// Apply the PESDKPlugin.
// [!] This assumes you made the correct changes to your projects build.gradle file!
// See https://docs.photoeditorsdk.com/guides/android/v7/introduction/getting_started for details.
apply plugin: 'ly.img.android.sdk'
apply plugin: 'kotlin-android'
// Configure the PESDKPlugin
IMGLY.predefine {
pesdk {
enabled true
}
useInheritanceDependencies true
modules {
include 'ui:core'
include 'backend:config-loader'
}
}
def MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION = "10.1.1"
task checkVersion {
if (imglyConfig.convertToVersionNumber(imglyConfig.getVersion()) < imglyConfig.convertToVersionNumber(MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION)) {
String WRONG_VERSION = "" +
"┌───────────────────────────────────────────────────────────────────────┐\n"+
"│ PhotoEditor SDK update required! │\n"+
"│ Please update the plugin version in your 'android/build.gradle' file. │\n"+
"│ Minimum required dependency: 'ly.img.android.sdk:plugin:${MIN_LY_IMG_ANDROID_SDK_PLUGIN_VERSION}' │\n"+
"│ Your are currently using: 'ly.img.android.sdk:plugin:${imglyConfig.getVersion()}' │\n"+
"└───────────────────────────────────────────────────────────────────────┘\n"
throw new GradleScriptException(WRONG_VERSION, new IllegalArgumentException(WRONG_VERSION))
}
}
preBuild.dependsOn checkVersion
android {
compileSdkVersion safeExtGet('compileSdkVersion', 31)
buildToolsVersion safeExtGet('buildToolsVersion', '31.0.0')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 29)
}
lintOptions {
abortOnError false
}
buildTypes {
all {
}
}
}
repositories {
mavenCentral()
}
dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.32'
compileOnly "ly.img.android.sdk:serializer:$imglyConfig.version"
implementation 'com.google.code.gson:gson:2.8.5'
}