-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
build.gradle
137 lines (118 loc) · 4.32 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
buildscript {
ext {
supportLibVersion = '29.0.2'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '2.3.0'
espressoVersion = '3.0.1'
aztecVersion = 'v1.6.3'
}
}
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "maven-publish"
id "com.automattic.android.publish-to-s3"
}
// import the `readReactNativeVersion()` function
apply from: 'https://gist.githubusercontent.com/hypest/742448b9588b3a0aa580a5e80ae95bdf/raw/8eb62d40ee7a5104d2fcaeff21ce6f29bd93b054/readReactNativeVersion.gradle'
group = 'org.wordpress-mobile.gutenberg-mobile'
// 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 31
defaultConfig {
minSdkVersion 24
targetSdkVersion 31
}
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'
abortOnError false
}
}
repositories {
maven {
url "https://a8c-libs.s3.amazonaws.com/android"
content {
includeGroup "org.wordpress"
includeGroup "org.wordpress.aztec"
}
}
maven { url "https://a8c-libs.s3.amazonaws.com/android/react-native-mirror" }
google()
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
}
dependencies {
api "org.wordpress:aztec:$aztecVersion"
api "org.wordpress.aztec:wordpress-shortcodes:$aztecVersion"
api "org.wordpress.aztec:wordpress-comments:$aztecVersion"
api "org.wordpress.aztec:glide-loader:$aztecVersion"
implementation "org.wordpress:utils:$wordpressUtilsVersion"
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.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13'
def rnVersion = readReactNativeVersion('../../../package.json', 'devDependencies')
println "react-native version for react-native-aztec: $rnVersion"
implementation "com.facebook.react:react-native:$rnVersion"
}
project.afterEvaluate {
publishing {
publications {
ReactNativeAztecPublication(MavenPublication) {
artifact bundleReleaseAar
groupId 'org.wordpress-mobile.gutenberg-mobile'
artifactId 'react-native-aztec'
artifact tasks.named("androidSourcesJar")
// version is set by 'publish-to-s3' plugin
addDependenciesToPom(pom)
}
}
}
}
def addDependenciesToPom(pom) {
pom.withXml {
def dependenciesNode = asNode().getAt('dependencies')[0] ?: asNode().appendNode('dependencies')
// Iterate over the implementation dependencies, adding a <dependency> node for each
configurations.implementation.allDependencies
.findAll { it instanceof ExternalDependency && it.name != 'unspecified' }
.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}