-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathbuild.gradle
118 lines (96 loc) · 3.84 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
buildscript {
ext {
gradlePluginVersion = '3.3.1'
kotlinVersion = '1.3.11'
supportLibVersion = '28.0.0'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '1.22'
espressoVersion = '3.0.1'
aztecVersion = 'v1.3.34'
}
repositories {
jcenter()
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradlePluginVersion"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
// import the `readReactNativeVersion()` function
apply from: 'https://gist.githubusercontent.com/hypest/742448b9588b3a0aa580a5e80ae95bdf/raw/8eb62d40ee7a5104d2fcaeff21ce6f29bd93b054/readReactNativeVersion.gradle'
group='com.github.wordpress-mobile.gutenberg-mobile'
// fallback flag value for when lib is compiled individually (e.g. via jitpack)
project.ext.buildGutenbergFromSource = false
// The sample build uses multiple directories to
// keep boilerplate and common code separate from
// the main sample code.
List<String> dirs = [
'main', // main sample code; look here for the interesting stuff.
'common', // components that are reused by multiple samples
'template'] // boilerplate code that is generated by the sample template process
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
dirs.each { dir ->
java.srcDirs "src/${dir}/java"
java.srcDirs += "src/${dir}/kotlin"
res.srcDirs "src/${dir}/res"
}
}
androidTest.setRoot('tests')
androidTest.java.srcDirs = ['tests/src']
}
lintOptions {
disable 'GradleCompatible'
}
}
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
if (!rootProject.ext.buildGutenbergFromSource) {
// if not building from source (where the node_modules dir is used), use a remote RN maven repo
def reactNativeRepo = 'https://dl.bintray.com/wordpress-mobile/react-native-mirror/'
println "Will use the RN maven repo at ${reactNativeRepo}"
maven { url reactNativeRepo }
}
}
dependencies {
api ("com.github.wordpress-mobile.WordPress-Aztec-Android:aztec:$aztecVersion")
api ("com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-shortcodes:$aztecVersion")
api ("com.github.wordpress-mobile.WordPress-Aztec-Android:wordpress-comments:$aztecVersion")
api ("com.github.wordpress-mobile.WordPress-Aztec-Android:glide-loader:$aztecVersion")
api "org.wordpress:utils:$wordpressUtilsVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
if (rootProject.ext.buildGutenbergFromSource) {
implementation "com.facebook.react:react-native:+" // From node_modules.
} else {
def rnVersion = readReactNativeVersion('../package.json', 'peerDependencies')
implementation "com.facebook.react:react-native:${rnVersion}" // From Maven repo
}
}