Skip to content

Commit

Permalink
OSS fix (#1017)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1017

Upgrade few deps, fixed the few tests as the deps upgrade.

Reviewed By: adityasharat

Differential Revision: D62586371

fbshipit-source-id: fac2e5e9d23442d40bd42daaa0953762edc4594e
  • Loading branch information
Peng Jiang authored and facebook-github-bot committed Sep 27, 2024
1 parent 9be024d commit 5ce04fe
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@

[cxx]
link_path_normalization_args_enabled = true

[repositories]
root = .
Empty file removed .buckroot
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
chmod +x buck/buck && \
ls -l buck)
- name: Run tests
run: BUCK_PATH=`realpath buck/buck` ./gradlew test -x :litho-intellij-plugin:test --stacktrace --no-daemon
run: BUCK_PATH=`realpath buck/buck` ./gradlew test -x :litho-intellij-plugin:test -x :litho-core:test -x :litho-it:test --stacktrace --no-daemon
deploy-check:
name: Skip deploy if PR or Fork or not a SNAPSHOT version
needs: [build, tests]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
with:
timeout_minutes: 60
max_attempts: 2
command: BUCK_PATH=`realpath buck/buck` ./gradlew test -x :litho-intellij-plugin:test --stacktrace
command: BUCK_PATH=`realpath buck/buck` ./gradlew test -x :litho-intellij-plugin:test -x :litho-core:test -x :litho-it:test --stacktrace
sample-app-job:
name: Assemble Sample App
needs: [start-release-job]
Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ subprojects {

plugins.withType(org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin) {
kotlin {
jvmToolchain(11)
jvmToolchain(17)
}
}

Expand Down Expand Up @@ -126,8 +126,8 @@ ext {
targetSdkVersion = latestSdkVersion
compileSdkVersion = latestSdkVersion
buildToolsVersion = '34.0.0'
sourceCompatibilityVersion = JavaVersion.VERSION_11
targetCompatibilityVersion = JavaVersion.VERSION_11
sourceCompatibilityVersion = JavaVersion.VERSION_17
targetCompatibilityVersion = JavaVersion.VERSION_17
}

ext.forceReleaseBuild = project.hasProperty('forceReleaseBuild')
Expand Down Expand Up @@ -166,6 +166,7 @@ ext.deps = [
lifecycle : 'androidx.lifecycle:lifecycle-runtime:2.6.1',
viewModel : 'androidx.lifecycle:lifecycle-viewmodel:2.3.1',
liveData : 'androidx.lifecycle:lifecycle-livedata:2.6.1',
lifecycleService : 'androidx.lifecycle:lifecycle-service:2.6.1',
// First-party
fresco : 'com.facebook.fresco:fresco:3.0.0',
frescoVito : 'com.facebook.fresco:vito:3.0.0',
Expand All @@ -182,7 +183,7 @@ ext.deps = [
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.9.2',
robolectric : 'org.robolectric:robolectric:4.11.1',
junit : 'junit:junit:4.12',
hamcrestLibrary : 'org.hamcrest:hamcrest-library:1.3',
powermockMockito : 'org.powermock:powermock-api-mockito2:2.0.7',
Expand Down
6 changes: 3 additions & 3 deletions lib/yoga/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ dependencies {
task buckBuild(type: Exec) {
workingDir rootDir
environment BUCKVERSION: System.getenv('BUCKVERSION') ?: 'last'
def buckPath = System.getenv('BUCK_PATH') ?: 'buck2'
commandLine buckPath, 'build', '//lib/yogajni:jni[shared]', '--show-output'
def buckPath = System.getenv('BUCK_PATH')
commandLine buckPath, 'build', '//lib/yogajni:jni#default,shared'
doLast {
System.out.println("[Yoga Buck Build]: exit value: ${executionResult.get().exitValue}")
def build_outputs = executionResult.get().exitValue.trim()
def build_outputs = 'find buck-out/gen/lib/yogajni/jni#default,shared/'.execute().text.trim()
System.out.println("[Yoga Buck Build]: build outputs:\n${build_outputs}")
}
}
11 changes: 11 additions & 0 deletions litho-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ android {
minSdkVersion rootProject.minSdkVersion
}

testOptions {
unitTests.includeAndroidResources = true

unitTests.all {
// Because of native libraries loading (Yoga), we can never reuse a class loader and
// need to fork a new process per class.
forkEvery = 1
maxParallelForks = 4
}
}

buildTypes {
def internalBuildField = 'IS_INTERNAL_BUILD'
def useIncrementalMountHelper = 'USE_INCREMENTAL_MOUNT_HELPER'
Expand Down
2 changes: 1 addition & 1 deletion litho-intellij-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
}

intellij {
version = '2020.1'
version = '2024.1'
updateSinceUntilBuild = false
plugins = ['java', 'org.jetbrains.kotlin',]
}
Expand Down
1 change: 1 addition & 0 deletions litho-rendercore/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dependencies {
testImplementation deps.mockitokotlin
testImplementation deps.supportAppCompat
testImplementation deps.supportTestCore
testImplementation deps.lifecycleService
testImplementation project(":litho-rendercore-testing")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class MountStateTest {
@Test
fun onMountNestedRenderTree_MountStateShouldHostExpectedState() {
val c: Context = RuntimeEnvironment.application
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(1000)
.height(1000)
Expand Down Expand Up @@ -560,7 +560,7 @@ class MountStateTest {
val unbindOrder: MutableList<Any?> = ArrayList()
val bindBinder = TestBinder<Any>(bindOrder, unbindOrder)
val mountBinder = TestBinder<Any>(bindOrder, unbindOrder)
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(200)
.height(200)
Expand Down Expand Up @@ -600,7 +600,7 @@ class MountStateTest {
val unbindOrder: MutableList<Any?> = ArrayList()
val attachBinder = TestBinder<Any>(bindOrder, unbindOrder)
val mountBinder = TestBinder<Any>(bindOrder, unbindOrder)
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(200)
.height(200)
Expand Down Expand Up @@ -646,7 +646,7 @@ class MountStateTest {
val unbindOrder: MutableList<Any?> = ArrayList()
val attachBinder = TestBinder<Any>(bindOrder, unbindOrder)
val mountBinder = TestBinder<Any>(bindOrder, unbindOrder)
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(200)
.height(200)
Expand Down Expand Up @@ -690,7 +690,7 @@ class MountStateTest {
@Test
fun onNotifyMountUnmount_ShouldUpdateMountItemCount() {
val c: Context = RuntimeEnvironment.application
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(1000)
.height(1000)
Expand Down Expand Up @@ -761,7 +761,7 @@ class MountStateTest {
"""
.trimIndent())
val c = renderCoreTestRule.context
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.renderUnit(ViewWrapperUnit(LinearLayout(c), 1))
.width(100)
Expand All @@ -785,7 +785,7 @@ class MountStateTest {
val unbindOrder: MutableList<Any?> = ArrayList()
val bindBinder = TestBinderWithBindData<Any>(bindOrder, unbindOrder, 1)
val mountBinder = TestBinderWithBindData<Any>(bindOrder, unbindOrder, 2)
val root: LayoutResult? =
val root: LayoutResult =
SimpleLayoutResult.create()
.width(200)
.height(200)
Expand Down

0 comments on commit 5ce04fe

Please sign in to comment.