forked from facebook/litho
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
156 lines (142 loc) · 6.44 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
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "com.vanniktech:gradle-maven-publish-plugin:${MAVEN_PUBLISH_PLUGIN}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects {
repositories {
google()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
tasks.withType(Javadoc).all {
enabled = false
}
afterEvaluate {
tasks.withType(Test) {
it.dependsOn copyYogaLibs
systemProperty 'java.library.path', "${rootDir}/build/jniLibs"
environment 'LD_LIBRARY_PATH', "${rootDir}/build/jniLibs"
environment 'DYLD_LIBRARY_PATH', "${rootDir}/build/jniLibs"
def offlineDepsDir = System.getProperty('robolectric.dependency.dir')
if (offlineDepsDir != null) {
systemProperty 'robolectric.dependency.dir', "${rootDir}/$offlineDepsDir"
}
}
}
}
allprojects {
tasks.withType(Javadoc).all {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
ext {
minSdkVersion = 16
targetSdkVersion = 31
compileSdkVersion = 31
buildToolsVersion = '30.0.2'
sourceCompatibilityVersion = JavaVersion.VERSION_1_8
targetCompatibilityVersion = JavaVersion.VERSION_1_8
}
ext.forceReleaseBuild = project.hasProperty('forceReleaseBuild')
ext.isRelease = { forceReleaseBuild ||
['publish', 'publishToMavenLocal'].any { gradle.startParameter.taskNames.contains(it) } }
ext.isSnapshot = { VERSION_NAME.endsWith('-SNAPSHOT') }
ext.deps = [
// Android support
supportAnnotations : 'androidx.annotation:annotation:1.0.0',
supportAppCompat : 'androidx.appcompat:appcompat:1.0.0',
supportCore : 'androidx.core:core:1.0.0',
supportFragment : 'androidx.fragment:fragment:1.3.5',
supportCustomView : 'androidx.customview:customview:1.0.0',
supportRecyclerView: 'androidx.recyclerview:recyclerview:1.2.0-beta01',
supportEspresso : 'androidx.test.espresso:espresso-core:3.1.1',
supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.1.1',
supportTestCore : 'androidx.test:core:1.4.0',
supportTestRunner : 'androidx.test:runner:1.1.1',
supportTestRules : 'androidx.test:rules:1.1.1',
supportTestJunit : 'androidx.test.ext:junit:1.1.2',
supportMultidex : 'androidx.multidex:multidex:2.0.0',
supportViewPager : 'androidx.viewpager:viewpager:1.0.0',
supportMaterial : 'com.google.android.material:material:1.2.0',
supportTransition : 'androidx.transition:transition:1.0.0',
supportSwipeRefresh: 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0',
supportDynamicAnimations : 'androidx.dynamicanimation:dynamicanimation-ktx:1.0.0-alpha03',
// Arch
archLifecycle : 'androidx.lifecycle:lifecycle-viewmodel:2.3.1',
liveData : 'androidx.lifecycle:lifecycle-livedata:2.3.1',
// First-party
fresco : 'com.facebook.fresco:fresco:1.13.0',
soloader : 'com.facebook.soloader:soloader:0.10.4',
textlayoutbuilder : 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.5.0',
screenshot : 'com.facebook.testing.screenshot:core:0.5.0',
flipper : 'com.facebook.flipper:flipper:0.169.0',
flipperLithoPlugin : 'com.facebook.flipper:flipper-litho-plugin:0.169.0',
// Annotations
jsr305 : 'com.google.code.findbugs:jsr305:3.0.1',
inferAnnotations : 'com.facebook.infer.annotation:infer-annotation:0.18.0',
// Debugging and testing
guava : 'com.google.guava:guava:27.0.1-android',
robolectric : 'org.robolectric:robolectric:4.4',
junit : 'junit:junit:4.12',
hamcrestLibrary : 'org.hamcrest:hamcrest-library:1.3',
powermockMockito : 'org.powermock:powermock-api-mockito2:2.0.7',
powermockJunit : 'org.powermock:powermock-module-junit4-rule:2.0.7',
powermockXstream : 'org.powermock:powermock-classloading-xstream:2.0.7',
mockitoCore : 'org.mockito:mockito-core:2.26.0',
assertjCore : 'org.assertj:assertj-core:2.9.0',
compileTesting : 'com.google.testing.compile:compile-testing:0.14',
mockitokotlin : 'org.mockito.kotlin:mockito-kotlin:2.2.11',
// Proguard annotations (published through Yoga)
proguardAnnotations: 'com.facebook.yoga:proguard-annotations:1.14.1',
// Processor
javapoet : 'com.squareup:javapoet:1.9.0',
// Misc
khronos : 'org.khronos:opengl-api:gl1.1-android-2.1_r1',
// Kotlin
kotlinStandardLib : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${KOTLIN_VERSION}"
]
// For releases, we want to depend on a stable version of Yoga.
ext.deps.yoga =
isSnapshot()
? 'com.facebook.yoga:yoga:1.19.0' // can be a '-SNAPSHOT' release
: 'com.facebook.yoga:yoga:1.19.0'
// This should hopefully only serve as a temporary measure until
// we have a proper Gradle setup for Yoga and JNI.
task copyYogaLibs(type: Copy, dependsOn: ':yoga:buckBuild') {
from 'buck-out/gen/lib/yogajni/jni#default,shared/'
include '*.so'
include '*.dylib'
include '*.dll'
into "$buildDir/jniLibs"
doLast {
def yoga_deps = "find ${rootDir}/build/jniLibs".execute().text.trim()
System.out.println("[Yoga Buck Build]: copied files:\n${yoga_deps}")
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}