Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Gradle setup #1084

Closed
wants to merge 7 commits into from
Closed

Upgrade Gradle setup #1084

wants to merge 7 commits into from

Conversation

passy
Copy link
Member

@passy passy commented May 21, 2021

Summary:
Trying to dust off the build setup and make it work again with a modern Android Studio / JVM.

Removing all JCenter setup, too, as this is no longer supported.

Test Plan:

./gradlew :yoga-layout:assembleDebug works already.
Looking if CI here likes this.

@passy passy marked this pull request as ready for review May 21, 2021 12:52
@facebook-github-bot
Copy link
Contributor

@passy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@passy has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@passy merged this pull request in 13e079e.

cntrump added a commit to cntrump/yoga that referenced this pull request Jun 29, 2021
commit 578d197
Author: Lauren Bentley <lebentle@fb.com>
Date:   Fri Jun 18 12:19:40 2021 -0700

    remove .buckversion files from fbsource/xplat

    Summary: Buck has not relied on the .buckversion file for a while now. I am trying to clean up the number of configs at the root of the cell for buck. This diff attempts to remove .buckversion code referecnes from fbsource/xplat Instead of calling cat .buckversion to get the buckversion hash, you can call buck --fast-version which parses the buck-java11 file without downloading buck. Alternatively, you can also do something like cat .buck-java11 | grep -o -E -e "[0-9a-f]{40}" | head -1  to get the buckversion hash.

    Reviewed By: stepancheg

    Differential Revision: D28579639

    fbshipit-source-id: 6231e16df41f3e403098576e4bfd5d5a2fd38a14

commit e5acf77
Author: Amir Shalem <amirshalem@fb.com>
Date:   Thu Jun 3 07:02:49 2021 -0700

    Don't allocate large arrays on stack when copying native pointers, use heap based array

    Summary:
    Don't allocate large arrays on stack when copying native pointers, use heap based array.

    Today the code copies the native pointers on the stack, since it may be too big, lets make sure to use heap based allocating using std::vector.

    This array is afterwards converted into a reversed map from index to pointer, so it is heap based anyhow.

    Changelog: [Internal] Don't allocate large arrays on stack when copying native pointers, use heap based array

    Reviewed By: Andrey-Mishanin

    Differential Revision: D28747213

    fbshipit-source-id: da69b4b2d0960fdade9f07f44654b30d6dacc43a

commit f031297
Author: Pascal Hartig <realpassy@fb.com>
Date:   Sun May 23 11:37:42 2021 -0700

    Disable snapshot publishing (facebook#1089)

    Summary:
    Currently broken. Will reenable this separately.

    Pull Request resolved: facebook#1089

    Reviewed By: mweststrate

    Differential Revision: D28609885

    Pulled By: passy

    fbshipit-source-id: 380359d09ee96d321d49c6440bde358c3e791c1a

commit 8a65d8b
Author: Pascal Hartig <phartig@rdrei.net>
Date:   Fri May 21 11:40:17 2021 -0700

    Release GitHub actions workflow (facebook#1088)

    Summary: Pull Request resolved: facebook#1088

    Reviewed By: mweststrate

    Differential Revision: D28604872

    Pulled By: passy

    fbshipit-source-id: e77578d44557420be9b782dc90f047af697b7cb9

commit 0fcef77
Author: Pascal Hartig <phartig@rdrei.net>
Date:   Fri May 21 11:40:17 2021 -0700

    Maven release docs (facebook#1087)

    Summary:
    *Context: The Yoga OSS build has not been given a lot of attention over the past couple of years and is in serious disrepair. I'll try to get the release pipeline going again to publish to Maven Central as JCenter is shutting down. A bunch of intermediate commits may still have broken builds but will be inching closer to a working one.*

    Adds some docs on how to use the release workflow.

    Pull Request resolved: facebook#1087

    Reviewed By: priteshrnandgaonkar

    Differential Revision: D28604686

    Pulled By: passy

    fbshipit-source-id: 44cac2cd0593a4f71d80df1ec5324c3c27fbe888

commit e3a59aa
Author: Pascal Hartig <phartig@rdrei.net>
Date:   Fri May 21 11:40:17 2021 -0700

    Maven central publish (facebook#1086)

    Summary:
    Sets up the plugins necessary to publish to Maven Central.

    Pull Request resolved: facebook#1086

    Test Plan: ./gradlew publishToMavenLocal -PRELEASE_SIGNING_ENABLED=false

    Reviewed By: mweststrate

    Differential Revision: D28604529

    Pulled By: passy

    fbshipit-source-id: 2c35b94ce0e254bc7a8bc80e449ac5dadb5def38

commit 13e079e
Author: Pascal Hartig <phartig@rdrei.net>
Date:   Fri May 21 11:14:07 2021 -0700

    Upgrade Gradle setup (facebook#1084)

    Summary:
    Trying to dust off the build setup and make it work again with a modern Android Studio / JVM.

    Removing all JCenter setup, too, as this is no longer supported.

    Pull Request resolved: facebook#1084

    Test Plan:
    `./gradlew :yoga-layout:assembleDebug` works already.
    Looking if CI here likes this.

    Reviewed By: mweststrate

    Differential Revision: D28602272

    Pulled By: passy

    fbshipit-source-id: 0cb86f548cc6366ccefcc92c185d6e7772e75547

commit 508f4ea
Author: Pascal Hartig <phartig@rdrei.net>
Date:   Fri May 21 10:10:34 2021 -0700

    Fix env setting and Android setup (facebook#1085)

    Summary:
    *Context: The Yoga OSS build has not been given a lot of attention over the past couple of years and is in serious disrepair. I'll try to get the release pipeline going again to publish to Maven Central as JCenter is shutting down. A bunch of intermediate commits may still have broken builds but will be inching closer to a working one.*

    The current way env variables are set is no longer supported for security reasons: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/. The manual Android setup is also quite tricky to maintain and can mostly be done through GitHub Actions itself.

    Please note that the actual build is still failing but that's because we're so far behind with the setup here that the Gradle version no longer works on a modern JVM. I'll fix that in subsequent diffs.

    Pull Request resolved: facebook#1085

    Test Plan: CI

    Reviewed By: mweststrate

    Differential Revision: D28602084

    Pulled By: passy

    fbshipit-source-id: e334ed92d16a9baa185a84b23bb62801399e5650

commit a999150
Author: Andres Suarez <asuarez@fb.com>
Date:   Thu May 20 21:22:47 2021 -0700

    Apply clang-format

    Reviewed By: igorsugak

    Differential Revision: D28477074

    fbshipit-source-id: f15dfc45b9fb30c661ebe2899cd882676d0fdf2a

commit cbf6495
Author: Aditya Sharat <adityasharat@fb.com>
Date:   Tue Mar 30 05:41:22 2021 -0700

    Refactor YogaNode.Inputs freeze API

    Summary:
    `InternalNode` will eventually not have a pointer to its parent. This diff removes one of the usages of the `InternalNode#getParent()` API. `InternalNode` will also not host the `YogaNode` eventually; so this diff also removes one of the usages of the `InternalNode#getYogaNode()` api.

    Now the `Inputs#freeze` api will pass the parent's `YogaNode` and the `YogaNode` of the node (this) being measured.

    Changelog: [Internal] Passes The YogaNode and parent YogaNode in the Inputs.freeze API

    Reviewed By: SidharthGuglani

    Differential Revision: D27240229

    fbshipit-source-id: efc4ec3249a963c3181111f9b989d8ed9e17feb4

commit 07eaeea
Author: Aditya Sharat <adityasharat@fb.com>
Date:   Fri Mar 26 10:04:04 2021 -0700

    Create YogaProps Interface

    Summary:
    Create YogaProps Interface; this interface represents the inputs to YogaNode for layout calculation.

    Changelog: [Internal] Create YogaProps Interface; this interface represents the inputs to YogaNode for layout calculation.

    Reviewed By: mihaelao

    Differential Revision: D27229274

    fbshipit-source-id: 5205caf2384661369d7a2d7e7f3e49ff831a1c92

commit 6386902
Author: Altaibayar Tseveenbayar <altaibayar@fb.com>
Date:   Mon Mar 22 07:41:16 2021 -0700

    Yoga set as a static library also for debug+release builds in x64

    Summary: Yoga set as a static library also for debug+release builds in x64

    Reviewed By: SidharthGuglani

    Differential Revision: D27230019

    fbshipit-source-id: d77e2c4130cd8303d1585723bfad927b9ddba23e

commit 6c2ba94
Author: Altaibayar Tseveenbayar <altaibayar@fb.com>
Date:   Mon Mar 22 04:31:18 2021 -0700

    Making yoga by default a static library

    Summary: We are linking yoga as a static library in most of the places

    Reviewed By: SidharthGuglani

    Differential Revision: D27228933

    fbshipit-source-id: 725d6551198c96925ae80b3a62ef9737ee7e3052

commit db6be52
Author: Altaibayar Tseveenbayar <altaibayar@fb.com>
Date:   Fri Mar 19 19:22:49 2021 -0700

    C4244 possible precision loss warning fix

    Summary:
    Fixing `warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data`

    Changelog: [Internal]

    Reviewed By: SidharthGuglani

    Differential Revision: D27132355

    fbshipit-source-id: 55ff35be368ef4f6093865eb88c17e753250d179

commit 67b6c24
Author: Altaibayar Tseveenbayar <altaibayar@fb.com>
Date:   Thu Mar 18 03:42:31 2021 -0700

    Yoga Visual Studio project file fix

    Summary: Yoga Visual Studio project file was outdated. Made it back working/compilable

    Reviewed By: Andrey-Mishanin

    Differential Revision: D27138942

    fbshipit-source-id: 5d57e61dbb415db54e255e148739c2e670f3bd23

commit b209580
Author: Pieter De Baets <pieterdb@fb.com>
Date:   Mon Mar 15 16:53:05 2021 -0700

    Simplify YGNodeEmptyContainer / YGNodeWithMeasureFunc / YGNodeFixedSize

    Summary:
    These methods are only ever called just after setting the various YGStyle props. Therefore we can read any padding / margin / border state from there rather than recalculating it.

    Changelog: [Internal]

    Reviewed By: SidharthGuglani

    Differential Revision: D27010098

    fbshipit-source-id: a33f879b25c54cfdb0ffc724b6aa325858e97df5

commit e87f429
Author: Pieter De Baets <pieterdb@fb.com>
Date:   Mon Mar 15 16:53:05 2021 -0700

    Simplify YGNodeCalculateAvailableInnerDim

    Summary:
    Avoid recalculating margin and padding by pre-subtracting the margin from `availableWidth` and inlining the calculation of `paddingAndBorderAxisCross`.

    Changelog: [Internal]

    Reviewed By: SidharthGuglani

    Differential Revision: D27010094

    fbshipit-source-id: afc3cf251a0306b9e5d7f0dc6856feee8d1dca6e

commit 41384fa
Author: Pieter De Baets <pieterdb@fb.com>
Date:   Mon Mar 15 16:53:05 2021 -0700

    Optimize edge value resolution

    Summary:
    Noticed in simpleperf this was a very hot method, showing 8ms spent in these methods in our sample application. By splitting the method out in a horizontal and vertical variant we can simplify cases enormously and check for begin/end in one go.

    Changelog: [Internal]

    Reviewed By: SidharthGuglani

    Differential Revision: D27010008

    fbshipit-source-id: 22fed58c7476e1d716b0191b55997c7a06e63223

commit 342aebe
Author: Eric Rozell <ericroz@fb.com>
Date:   Wed Mar 10 13:08:48 2021 -0800

    Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute (facebook#1068)

    Summary:
    Pull Request resolved: facebook#1068

    There is an issue in react-native when the Yoga node position type is set to absolute and display: none is set where the node layout calculation gives the absolute dimensions, rather than the expected 0 x 0.

    Here are some OSS issues tracking this:
    facebook/react-native#18415
    microsoft/react-native-windows#7289

    ## Changelog

    [General] [Fix] - Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute

    Reviewed By: Andrey-Mishanin

    Differential Revision: D26849307

    fbshipit-source-id: 197618aa3c4e1b3b7efeba7ea4efd30b2d1c982d

commit 1745c23
Author: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
Date:   Wed Mar 10 12:36:47 2021 -0800

    Fix various C++ warnings (#31002)

    Summary:
    Fix warnings about implicit type truncation.

    ## Changelog

    [Internal] [Fixed] - Fix various C++ warnings

    Pull Request resolved: facebook/react-native#31002

    Test Plan:
    Almost all the changes here are simply making explicit conversions which are already occurring.  With the exception of a couple of constants being changed from doubles to floats.

    With these changes I am able to remove a bunch of warning suppressions in react-native-windows.

    Reviewed By: shergin

    Differential Revision: D26900502

    Pulled By: rozele

    fbshipit-source-id: d5e415282815c2212a840a863713287bbf118c10

commit ccdea0f
Author: Stiopa Koltsov <nga@fb.com>
Date:   Mon Mar 1 13:13:44 2021 -0800

    xplat: switch random files to Starlark

    Summary:
    We need to get rid of all `# BUILD FILE SYNTAX: PYTHON_DSL` to disable hybrid parser after we make Starlark default everywhere.

    This is first bunch of changes.

    Reviewed By: mzlee

    Differential Revision: D26727784

    fbshipit-source-id: 05c5f4d039feb4ce06169ac6d2fc5c49711125cd

commit c1a28f3
Author: Sidharth Guglani <sidharthguglani@fb.com>
Date:   Thu Feb 25 06:34:24 2021 -0800

    Add back snapshot in version for next release

    Summary: Changelog: [Internal][Yoga] version bump

    Reviewed By: pasqualeanatriello

    Differential Revision: D26664063

    fbshipit-source-id: ceb8d31a99f85db7d1fde20bd77584a537d356c6

commit 0429704
Author: Sidharth Guglani <sidharthguglani@fb.com>
Date:   Thu Feb 25 06:34:24 2021 -0800

    version bump

    Reviewed By: pasqualeanatriello

    Differential Revision: D26664041

    fbshipit-source-id: 5a4d0d176074c8831dd18681993463fe25e2642f

commit 36e70c9
Author: Sidharth Guglani <sidharthguglani@fb.com>
Date:   Thu Feb 25 06:34:24 2021 -0800

    Fix Yoga test

    Summary: Changelog: [Internal][Yoga] Fixed unit test for default yoga style property

    Reviewed By: pasqualeanatriello

    Differential Revision: D26664040

    fbshipit-source-id: 9c0af4e846ead3d90c75753e836570ccac760178

commit de36e85
Author: Aditya Sharat <adityasharat@fb.com>
Date:   Tue Feb 16 10:17:36 2021 -0800

    Adds InternalNode#freeze() API

    Summary:
    Litho needs a new API which is called immediately before yoga begins layout calculations so that the InternalNode gets the opportunity to finalise itself; i.e. perform the last mutations and in effect avoid any more mutations to the hierarchy.

    See D26373731 where the mutations from `Layout#collectResults` is moved back into the InternalNode.

    Changelog: [Internal]  Adds new API to YogaNodeJNIBase

    Reviewed By: SidharthGuglani

    Differential Revision: D26373730

    fbshipit-source-id: 471346d3444986ada91e86c95f5f9fb98bcd2fa6

commit 651c527
Author: Ruslan Serebriakov <rsrbk@fb.com>
Date:   Thu Feb 11 10:37:41 2021 -0800

    CKDimension

    Summary:
    [rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all CKRelativeDimension RCRelativeDimension
    [rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all CKRelativeSize RCRelativeSize
    [rsrbk@devvm3461.lla0 /data/users/rsrbk/fbsource/fbobjc] fastmod --accept-all ComponentKit/RCDimension.h RenderCore/RCDimension.h

    Reviewed By: kfirapps

    Differential Revision: D26228615

    fbshipit-source-id: 9c06128b324e1c6ece6fc21fbab1c041e5f5825a

commit 2cb46cf
Author: Sidharth Guglani <sidharthguglani@fb.com>
Date:   Fri Feb 5 03:39:55 2021 -0800

    instance of checks for YogaNodeJniBase

    Summary:
    Changelog:
    [Internal][Yoga] - Added instance of checks in `YogaNodeJNIBase` class to prevent `ClassCastException`s. This was happening for some NT android tests - Mocked Yoga Node object was being passed in the `addChildAt` api

    Stack Trace of exception
        java.lang.ClassCastException: com.facebook.yoga.YogaNode$MockitoMock$1408896622 cannot be cast to com.facebook.yoga.YogaNodeJNIBase
    	at com.facebook.yoga.YogaNodeJNIBase.addChildAt(YogaNodeJNIBase.java:86)
    	at com.facebook.litho.DefaultInternalNode.addChildAt(DefaultInternalNode.java:220)
    	at com.facebook.litho.DefaultInternalNode.child(DefaultInternalNode.java:377)
    	at com.facebook.litho.DefaultInternalNode.child(DefaultInternalNode.java:360)
    	at com.facebook.litho.Column.resolve(Column.java:118)
    	at com.facebook.litho.Layout.create(Layout.java:172)

    Reviewed By: Andrey-Mishanin

    Differential Revision: D26114992

    fbshipit-source-id: 774a689609e67f9244b81c6788b62cd61cd96d14

commit 584dfe9
Author: Andres Suarez <asuarez@fb.com>
Date:   Sun Jan 10 10:03:53 2021 -0800

    Apply clang-format update fixes

    Reviewed By: igorsugak

    Differential Revision: D25861849

    fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0

commit a38ec3d
Author: Panagiotis Vekris <pvekris@fb.com>
Date:   Mon Jan 4 21:05:07 2021 -0800

    pin "classic" roots to v0.140

    Summary:
    In Flow v0.143 types-first will become the only supported mode in Flow.
    As such the `types_first` configuration option will become invalid. To
    prevent breaking roots that have `types_first=false` set and are **unversioned**,
    this diff pins their version to v0.140, which is the last released version in fbsource.

    ## Repro

    First compute the list of all `.flowconfig`s:
    ```
    zbgf '.flowconfig$' | grep -v '^fbsource/fbcode/flow' | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > all-flowconfigs.txt
    ```
    Compute `.flowconfig`s that don’t have a version:
    ```
    zbgs -f '\.flowconfig' '[version]' |  grep -v '^fbsource/fbcode/flow'  | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > versioned-flowconfigs.txt
    comm -23 all-flowconfigs.txt versioned-flowconfigs.txt > unversioned-flowconfigs.txt
    ```
    Compute `.flowconfig`s that have `types_first=false`:
    ```
    zbgr -f '\.flowconfig' '^types_first=false$' |  grep -v '^fbsource/fbcode/flow'  | grep -v 'Binary file' | awk -F':' '{ print $1 }' | sort -u > types_first-false-flowconfigs.txt
    ```
    **and** no pinned version:
    ```
    comm -12 unversioned-flowconfigs.txt types_first-false-flowconfigs.txt | grep 'fbsource' > pin-version-flowconfigs.txt
    ```
    Update the `.flowconfig`s:
    ```
    cat ~/scratch/flowconfigs/pin-version-flowconfigs-fbsource.txt | xargs -I{} bash -c 'printf "\n[version]\n^0.140.0\n" >> {}'
    ```

    Reviewed By: mroch

    Differential Revision: D25771452

    fbshipit-source-id: 876d6310e4e1aafb81d3ef3051f4e9e9e838a633

commit b043669
Author: Ron Edelstein <rone@fb.com>
Date:   Thu Dec 17 19:33:39 2020 -0800

    Explicitly set autoglob (long tail)

    Reviewed By: fbanurag, strulovich

    Differential Revision: D25620908

    fbshipit-source-id: 1dd737d451ddfd07baa427902bdf1c96d7e67e64

commit e65b1ef
Author: Kris Georges <krisg@fb.com>
Date:   Tue Nov 10 08:21:19 2020 -0800

    Fix Yoga Playground website Litho codegen bugs

    Summary:
    Yoga Playground website

    changing direction results in no change to Litho code because of this typo

    Reviewed By: SidharthGuglani

    Differential Revision: D24818769

    fbshipit-source-id: 1633513d4a25aead2008b59d52f669293214c598

commit 07eac0c
Author: Pasquale Anatriello <pasqualea@fb.com>
Date:   Thu Oct 29 09:23:02 2020 -0700

    Fix clone issue in YogaNodeJNIBase

    Summary:
    Changelog:
    Fix the cloneWithChildren implementation that was not copying the list of children on the java object.

    We were missing on copying the list of children when cloning. This is pretty bad as it means that the clone operation was mutating the old node as well as the new. When multiple threads were involved this could cause crashes.

    Reviewed By: SidharthGuglani

    Differential Revision: D24565307

    fbshipit-source-id: 4e2e111db389e25c315ce7603b4018ac695bb0f1

commit 64e2459
Author: simek <gosimek@gmail.com>
Date:   Mon Sep 28 21:24:45 2020 -0700

    remove most of tvOS remnants from the code (#29407)

    Summary:
    Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), facebook/react-native#28706, facebook/react-native#28743, facebook/react-native#29018

    This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

    In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

    ## Changelog

    <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
    https://github.com/facebook/react-native/wiki/Changelog
    -->

    * **[Internal] [Removed]** - remove most of tvOS remnants from the code:
      * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
    * **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
    * **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
    * **[iOS] [Removed]** - remove deprecated and TV related props from View:
      * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
    * **[iOS] [Removed]** - remove `BackHandler` utility implementation

    Pull Request resolved: facebook/react-native#29407

    Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

    Reviewed By: PeteTheHeat

    Differential Revision: D22619441

    Pulled By: shergin

    fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
@NickGerleman NickGerleman deleted the gradle-upgrade branch January 8, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants