-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Expand file tree
/
Copy pathbuild.gradle
More file actions
146 lines (122 loc) · 4.57 KB
/
Copy pathbuild.gradle
File metadata and controls
146 lines (122 loc) · 4.57 KB
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
buildscript {
ext {
// node modules
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'
espressoVersion = '3.0.1'
// libs
aztecVersion = '1077-fac06be6604f8cb24d34878c9961fa8503fd0e33'
wordpressUtilsVersion = '3.3.0'
// main
androidxAppcompatVersion = '1.2.0'
androidxCardviewVersion = '1.0.0'
androidxGridlayoutVersion = '1.0.0'
androidxLegacyVersion = '1.0.0'
androidxRecyclerviewVersion = '1.1.0'
// test
junitAztecVersion = '4.13'
}
}
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.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 {
namespace "org.wordpress.mobile.ReactNativeAztec"
compileSdkVersion 34
defaultConfig {
minSdkVersion 24
targetSdkVersion 34
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
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']
}
lint {
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()
}
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:$androidxLegacyVersion"
implementation "androidx.gridlayout:gridlayout:$androidxGridlayoutVersion"
implementation "androidx.cardview:cardview:$androidxCardviewVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerviewVersion"
testImplementation "junit:junit:$junitAztecVersion"
def rnVersion = readReactNativeVersion('../../../package.json', 'devDependencies')
println "react-native version for react-native-aztec: $rnVersion"
implementation "com.facebook.react:react-android:$rnVersion"
}
project.afterEvaluate {
publishing {
publications {
ReactNativeAztecPublication(MavenPublication) {
artifact bundleReleaseAar
groupId 'org.wordpress.gutenberg-mobile'
artifactId 'react-native-aztec'
// 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)
}
}
}