docs: update url #981

Closed
Naturalclar wants to merge 2 commits from docs/updateDocs into main
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 2d28c6811a - Show all commits

58
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
name: CI
on: [push, pull_request]
jobs:
website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
working-directory: website
- name: Build
run: yarn build
working-directory: website
- name: Deploy
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: website/public
cname: yogalayout.com
keep_files: true
user_name: 'Yoga-bot'
user_email: 'yogabot@fb.com'
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install NDK 21
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" "ndk;20.0.5594570" --sdk_root=${ANDROID_SDK_ROOT}
- name: Install dependencies
run: |
if [[ -n "${{ secrets.encrypted_d27e803291ff_iv }}" ]]; then
openssl aes-256-cbc -K ${{ secrets.encrypted_d27e803291ff_key }} -iv {{ secrets.encrypted_d27e803291ff_iv }} -in scripts/setup-keys.enc -d >> gradle.properties;
fi
sudo apt-get update
sudo apt-get install -y ninja-build
pushd $HOME
git clone --depth 1 https://github.com/facebook/buck.git
cd buck
ant
popd
echo "$HOME/buck/bin" >> $GITHUB_PATH
export PATH=$PATH:$HOME/buck/bin/
buck --version
- name: Build
# TODO: Run the tests here again. They're currently crashing the JVM in GitHub Actions for some reason.
run: ./gradlew :yoga-layout:assembleDebug

32
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Publish
on:
release:
types:
- created
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install dependencies
run: source scripts/android-setup.sh && installAndroidSDK
- name: Write GPG Sec Ring
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
- name: Update gradle.properties
run: echo -e "signing.secretKeyRingFile=/tmp/secring.gpg\nsigning.keyId=${{ secrets.SIGNING_KEY_ID }}\nsigning.password=${{ secrets.SIGNING_PASSWORD }}\nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}\nmavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties
- name: Upload Android Archives
run: ./gradlew :yoga:assembleRelease publish --info
- name: Release and close
run: ./gradlew closeAndReleaseRepository
- name: Clean secrets
if: always()
run: rm /tmp/secring.gpg

2
.gitignore vendored
View File

@@ -5,7 +5,7 @@
/.buckconfig.local /.buckconfig.local
/.buckd /.buckd
/gentest/test.html /gentest/test.html
.buckversion .buck-java11
# Jekyll # Jekyll
/.sass-cache/ /.sass-cache/

View File

@@ -1,77 +0,0 @@
language: java
os: linux
dist: trusty
addons:
apt:
sources:
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
env:
- TARGET: website
- TARGET: android
install:
- cd website
- yarn --ignore-scripts
- cd ..
cache:
directories:
- $HOME/buck
- $HOME/.gradle
before_install:
- |
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
fi
# Android
- |
if [[ $TARGET = "android" ]]; then
pushd $HOME
git clone --depth 1 https://github.com/facebook/buck.git
cd buck
ant
popd
export PATH=$PATH:$HOME/buck/bin/
buck --version
export TERMINAL=dumb
source scripts/android-setup.sh && installAndroidSDK
export ANDROID_SDK=$ANDROID_HOME
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
fi
# Website
- |
if [[ $TARGET = "website" ]]; then
nvm install 8
nvm use 8
fi
script:
- |
if [[ $TARGET = "android" ]]; then
./gradlew testDebugUnit && scripts/publish-snapshot.sh
fi
- |
if [[ $TARGET = "website" ]]; then
pushd website
yarn build
popd
fi
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
fqdn: yogalayout.com
local-dir: website/public
email: yogabot@fb.com
name: Yoga-bot
keep-history: true
on:
branch: master
condition: $TARGET = website

14
BUCK
View File

@@ -40,6 +40,20 @@ yoga_cxx_library(
], ],
) )
yoga_cxx_library(
name = "yoga-static",
srcs = glob(["yoga/**/*.cpp"]),
compiler_flags = LIBRARY_COMPILER_FLAGS,
preferred_linkage = "static",
public_include_directories = ["."],
raw_headers = glob(["yoga/**/*.h"]),
tests = [":YogaTests"],
visibility = ["PUBLIC"],
deps = [
":ndklog",
],
)
yoga_cxx_library( yoga_cxx_library(
name = "yogaForDebug", name = "yogaForDebug",
srcs = glob(["yoga/**/*.cpp"]), srcs = glob(["yoga/**/*.cpp"]),

View File

@@ -8,7 +8,7 @@ Facebook has adopted a Code of Conduct that we expect project participants to ad
## Pull Requests ## Pull Requests
We actively welcome your pull requests. We actively welcome your pull requests.
1. Fork the repo and create your branch from `master`. 1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests 2. If you've added code that should be tested, add tests
3. If you've changed APIs, update the documentation. 3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes. 4. Ensure the test suite passes.

View File

@@ -1,8 +1,22 @@
# Yoga [![CocoaPods](https://img.shields.io/cocoapods/v/YogaKit.svg)](http://cocoapods.org/pods/YogaKit) [![npm](https://img.shields.io/npm/v/yoga-layout.svg)](https://www.npmjs.com/package/yoga-layout) [![bintray](https://img.shields.io/bintray/v/facebook/maven/com.facebook.yoga:yoga.svg)](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [![NuGet](https://img.shields.io/nuget/v/Facebook.Yoga.svg)](https://www.nuget.org/packages/Facebook.Yoga) # Yoga [![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine) [![CocoaPods](https://img.shields.io/cocoapods/v/YogaKit.svg)](http://cocoapods.org/pods/YogaKit) [![npm](https://img.shields.io/npm/v/yoga-layout.svg)](https://www.npmjs.com/package/yoga-layout) [![bintray](https://img.shields.io/bintray/v/facebook/maven/com.facebook.yoga:yoga.svg)](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [![NuGet](https://img.shields.io/nuget/v/Facebook.Yoga.svg)](https://www.nuget.org/packages/Facebook.Yoga)
## Building ## Building
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable. Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C++, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
Alternatively, you can build and install Yoga using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
```sh
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install yoga
```
The Yoga port in vcpkg is kept up to date by Microsoft team members and community contributors.
If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
## Testing ## Testing
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`. For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
@@ -18,7 +32,7 @@ Instead of manually writing a test which ensures parity with web implementations
Run `gentest/gentest.rb` to generate test code and re-run `buck test //:yoga` to validate the behavior. One test case will be generated for every root `div` in the input html. Run `gentest/gentest.rb` to generate test code and re-run `buck test //:yoga` to validate the behavior. One test case will be generated for every root `div` in the input html.
You may need to install the latest watir-webdriver gem (`gem install watir-webdriver`) and [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) to run `gentest/gentest.rb` Ruby script. You should run `bundle install` in the `gentest` directory to install dependencies for the `gentest/gentest.rb` Ruby script.
### .NET ### .NET
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`. .NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
@@ -46,3 +60,29 @@ This will now only run the standalone webpack build upon install.
| node | Builds node js version. | | node | Builds node js version. |
| standalone | Runs webpack. | | standalone | Runs webpack. |
| none | Does nothing. You can use the prepackaged libs. | | none | Does nothing. You can use the prepackaged libs. |
## Maintainer Release Guide
To publish a new release, follow these steps:
1. Ensure you have your GPG key set up and your [OSS Sonatype](https://oss.sonatype.org/) credentials handy.
2. Add the follow entries to either your local `gradle.properties` (don't forget to revert) or your global `~/.gradle/gradle.properties`:
```
# You get these from https://oss.sonatype.org/#profile;User%20Token
mavenCentralRepositoryUsername=<username>
mavenCentralRepositoryPassword=<password>
# You can get the keyId (in GPG 1.4 format) by running `gpg1 --list-keys`.
signing.secretKeyRingFile=</path/to/secring.gpg>
signing.keyId=<key_id>
signing.password=<key_password>
```
3. Change the `VERSION_NAME` in `gradle.properties` to a non-SNAPSHOT release.
4. Commit and land the version change.
5. Run `./gradlew publishToMaven`.
6. Run `./gradlew closeAndReleaseRepository`.
7. Change the `VERSION_NAME` in `gradle.properties` back to a new SNAPSHOT release.
8. Commit and land the version change.
9. Celebrate! You've made a release!

View File

@@ -191,7 +191,6 @@
27595AD71E575C7800CCE2B1 /* SampleCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; }; 27595AD71E575C7800CCE2B1 /* SampleCxxModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D41E03699D0018521A /* SampleCxxModule.h */; };
27595AD81E575C7800CCE2B1 /* SystraceSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; }; 27595AD81E575C7800CCE2B1 /* SystraceSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D92B0D51E03699D0018521A /* SystraceSection.h */; };
2D0EB9F32021067800CAF88A /* RCTUIUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F1EFDA4E201F660F00EE6E4C /* RCTUIUtils.m */; }; 2D0EB9F32021067800CAF88A /* RCTUIUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = F1EFDA4E201F660F00EE6E4C /* RCTUIUtils.m */; };
2D16E68E1FA4FD3900B85C8A /* RCTTVNavigationEventEmitter.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */; };
2D1D83CE1F74E2DA00615550 /* libdouble-conversion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D383D621EBD27B9005632C8 /* libdouble-conversion.a */; }; 2D1D83CE1F74E2DA00615550 /* libdouble-conversion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D383D621EBD27B9005632C8 /* libdouble-conversion.a */; };
2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; }; 2D3B5E931D9B087300451313 /* RCTErrorInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDCA8A41D3591E700450C31 /* RCTErrorInfo.m */; };
2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; }; 2D3B5E941D9B087900451313 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };
@@ -269,8 +268,6 @@
3D0B842A1EC0B49400B2BD8E /* RCTTVRemoteHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */; }; 3D0B842A1EC0B49400B2BD8E /* RCTTVRemoteHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */; };
3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */; }; 3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */; };
3D0B842C1EC0B4EA00B2BD8E /* RCTTVView.m in Sources */ = {isa = PBXBuildFile; fileRef = 130443D71E401AD800D93A67 /* RCTTVView.m */; }; 3D0B842C1EC0B4EA00B2BD8E /* RCTTVView.m in Sources */ = {isa = PBXBuildFile; fileRef = 130443D71E401AD800D93A67 /* RCTTVView.m */; };
3D0B842F1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */; };
3D0B84301EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */; };
3D0E378A1F1CC40000DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; }; 3D0E378A1F1CC40000DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };
3D0E378E1F1CC59100DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; }; 3D0E378E1F1CC59100DCAC9F /* RCTWebSocketModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };
3D0E378F1F1CC5CF00DCAC9F /* RCTWebSocketModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; }; 3D0E378F1F1CC5CF00DCAC9F /* RCTWebSocketModule.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */; };
@@ -951,14 +948,6 @@
657734931EE8356100A0E9EA /* RCTInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6577348B1EE8354A00A0E9EA /* RCTInspector.mm */; }; 657734931EE8356100A0E9EA /* RCTInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6577348B1EE8354A00A0E9EA /* RCTInspector.mm */; };
657734941EE8356100A0E9EA /* RCTInspectorPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */; }; 657734941EE8356100A0E9EA /* RCTInspectorPackagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */; };
657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */; }; 657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */; };
66CD94B11F1045E700CB3C7C /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */; };
66CD94B21F1045E700CB3C7C /* RCTMaskedView.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */; };
66CD94B31F1045E700CB3C7C /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */; };
66CD94B41F1045E700CB3C7C /* RCTMaskedView.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */; };
66CD94B51F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */; };
66CD94B61F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */; };
66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */; };
66CD94B81F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */; };
68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; }; 68EFE4EE1CF6EB3900A1DE13 /* RCTBundleURLProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */; };
6D4C7F86224946B900CBB1EC /* libYogaDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D4C7F85224946B900CBB1EC /* libYogaDev.a */; }; 6D4C7F86224946B900CBB1EC /* libYogaDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D4C7F85224946B900CBB1EC /* libYogaDev.a */; };
6D4C7FB02249479200CBB1EC /* libYogaDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D4C7FAF2249479200CBB1EC /* libYogaDev.a */; }; 6D4C7FB02249479200CBB1EC /* libYogaDev.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6D4C7FAF2249479200CBB1EC /* libYogaDev.a */; };
@@ -1275,7 +1264,6 @@
594F0A471FD233BD007FBE96 /* RCTSurfaceView.h in Copy Headers */, 594F0A471FD233BD007FBE96 /* RCTSurfaceView.h in Copy Headers */,
594F0A481FD233BD007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */, 594F0A481FD233BD007FBE96 /* RCTSurfaceHostingView.h in Copy Headers */,
594F0A491FD233BD007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */, 594F0A491FD233BD007FBE96 /* RCTSurfaceSizeMeasureMode.h in Copy Headers */,
2D16E68E1FA4FD3900B85C8A /* RCTTVNavigationEventEmitter.h in Copy Headers */,
59500D481F71C67600B122B7 /* RCTUIManagerUtils.h in Copy Headers */, 59500D481F71C67600B122B7 /* RCTUIManagerUtils.h in Copy Headers */,
3D0E37901F1CC5E100DCAC9F /* RCTWebSocketModule.h in Copy Headers */, 3D0E37901F1CC5E100DCAC9F /* RCTWebSocketModule.h in Copy Headers */,
5960C1BF1F0804F50066FD5B /* RCTLayoutAnimation.h in Copy Headers */, 5960C1BF1F0804F50066FD5B /* RCTLayoutAnimation.h in Copy Headers */,
@@ -1876,8 +1864,6 @@
39C50FFA2046EE3500CEE534 /* RCTVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVersion.m; sourceTree = "<group>"; }; 39C50FFA2046EE3500CEE534 /* RCTVersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTVersion.m; sourceTree = "<group>"; };
3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVRemoteHandler.h; sourceTree = "<group>"; }; 3D0B84281EC0B49400B2BD8E /* RCTTVRemoteHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVRemoteHandler.h; sourceTree = "<group>"; };
3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVRemoteHandler.m; sourceTree = "<group>"; }; 3D0B84291EC0B49400B2BD8E /* RCTTVRemoteHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVRemoteHandler.m; sourceTree = "<group>"; };
3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTVNavigationEventEmitter.h; sourceTree = "<group>"; };
3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTVNavigationEventEmitter.m; sourceTree = "<group>"; };
3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTWebSocketModule.h; path = WebSocket/RCTWebSocketModule.h; sourceTree = "<group>"; }; 3D0E37891F1CC40000DCAC9F /* RCTWebSocketModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTWebSocketModule.h; path = WebSocket/RCTWebSocketModule.h; sourceTree = "<group>"; };
3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = "<group>"; }; 3D1E68D81CABD13900DD7465 /* RCTDisplayLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDisplayLink.h; sourceTree = "<group>"; };
3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDisplayLink.m; sourceTree = "<group>"; }; 3D1E68D91CABD13900DD7465 /* RCTDisplayLink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDisplayLink.m; sourceTree = "<group>"; };
@@ -2006,10 +1992,6 @@
6577348B1EE8354A00A0E9EA /* RCTInspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RCTInspector.mm; path = Inspector/RCTInspector.mm; sourceTree = "<group>"; }; 6577348B1EE8354A00A0E9EA /* RCTInspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RCTInspector.mm; path = Inspector/RCTInspector.mm; sourceTree = "<group>"; };
6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTInspectorPackagerConnection.h; path = Inspector/RCTInspectorPackagerConnection.h; sourceTree = "<group>"; }; 6577348C1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RCTInspectorPackagerConnection.h; path = Inspector/RCTInspectorPackagerConnection.h; sourceTree = "<group>"; };
6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTInspectorPackagerConnection.m; path = Inspector/RCTInspectorPackagerConnection.m; sourceTree = "<group>"; }; 6577348D1EE8354A00A0E9EA /* RCTInspectorPackagerConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTInspectorPackagerConnection.m; path = Inspector/RCTInspectorPackagerConnection.m; sourceTree = "<group>"; };
66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedView.h; sourceTree = "<group>"; };
66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedView.m; sourceTree = "<group>"; };
66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTMaskedViewManager.h; sourceTree = "<group>"; };
66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMaskedViewManager.m; sourceTree = "<group>"; };
68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBundleURLProvider.h; sourceTree = "<group>"; }; 68EFE4EC1CF6EB3000A1DE13 /* RCTBundleURLProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBundleURLProvider.h; sourceTree = "<group>"; };
68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProvider.m; sourceTree = "<group>"; }; 68EFE4ED1CF6EB3900A1DE13 /* RCTBundleURLProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProvider.m; sourceTree = "<group>"; };
6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewInternal.h; sourceTree = "<group>"; }; 6A15FB0C1BDF663500531DFB /* RCTRootViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRootViewInternal.h; sourceTree = "<group>"; };
@@ -2346,8 +2328,6 @@
0EEEA8DE2239002200A8C82D /* RCTSurfacePresenterStub.m */, 0EEEA8DE2239002200A8C82D /* RCTSurfacePresenterStub.m */,
13B07FED1A69327A00A75B9A /* RCTTiming.h */, 13B07FED1A69327A00A75B9A /* RCTTiming.h */,
13B07FEE1A69327A00A75B9A /* RCTTiming.m */, 13B07FEE1A69327A00A75B9A /* RCTTiming.m */,
3D0B842D1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h */,
3D0B842E1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m */,
13E067481A70F434002CDEE1 /* RCTUIManager.h */, 13E067481A70F434002CDEE1 /* RCTUIManager.h */,
13E067491A70F434002CDEE1 /* RCTUIManager.m */, 13E067491A70F434002CDEE1 /* RCTUIManager.m */,
59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */, 59EB6DB91EBD6FC90072A5E7 /* RCTUIManagerObserverCoordinator.h */,
@@ -2389,10 +2369,6 @@
3D37B5811D522B190042D5B5 /* RCTFont.mm */, 3D37B5811D522B190042D5B5 /* RCTFont.mm */,
591F78D9202ADB22004A668C /* RCTLayout.h */, 591F78D9202ADB22004A668C /* RCTLayout.h */,
591F78D8202ADB21004A668C /* RCTLayout.m */, 591F78D8202ADB21004A668C /* RCTLayout.m */,
66CD94AD1F1045E700CB3C7C /* RCTMaskedView.h */,
66CD94AE1F1045E700CB3C7C /* RCTMaskedView.m */,
66CD94AF1F1045E700CB3C7C /* RCTMaskedViewManager.h */,
66CD94B01F1045E700CB3C7C /* RCTMaskedViewManager.m */,
83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */, 83A1FE8A1B62640A00BE0E65 /* RCTModalHostView.h */,
83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */, 83A1FE8B1B62640A00BE0E65 /* RCTModalHostView.m */,
83392EB11B6634E10013B15F /* RCTModalHostViewController.h */, 83392EB11B6634E10013B15F /* RCTModalHostViewController.h */,
@@ -2920,7 +2896,6 @@
13134C951E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */, 13134C951E296B2A00B9F3CB /* RCTObjcExecutor.h in Headers */,
590D7BFE1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */, 590D7BFE1EBD458B00D8A370 /* RCTShadowView+Layout.h in Headers */,
13134C9D1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */, 13134C9D1E296B2A00B9F3CB /* RCTCxxModule.h in Headers */,
66CD94B61F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */,
130443A31E3FEAAE00D93A67 /* RCTFollyConvert.h in Headers */, 130443A31E3FEAAE00D93A67 /* RCTFollyConvert.h in Headers */,
3D7BFD1E1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */, 3D7BFD1E1EA8E351008DFB7A /* RCTPackagerConnection.h in Headers */,
3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */, 3D302F241DF828F800D6DDAE /* RCTImageLoader.h in Headers */,
@@ -2945,7 +2920,6 @@
3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */, 3D302F311DF828F800D6DDAE /* RCTBundleURLProvider.h in Headers */,
3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */, 3D302F321DF828F800D6DDAE /* RCTConvert.h in Headers */,
3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */, 3D302F331DF828F800D6DDAE /* RCTDefines.h in Headers */,
3D0B842F1EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.h in Headers */,
3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */, 3D302F341DF828F800D6DDAE /* RCTDisplayLink.h in Headers */,
3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */, 3D302F351DF828F800D6DDAE /* RCTErrorCustomizer.h in Headers */,
3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */, 3D302F361DF828F800D6DDAE /* RCTErrorInfo.h in Headers */,
@@ -3048,7 +3022,6 @@
CF2731C21E7B8DEF0044CA4F /* RCTDeviceInfo.h in Headers */, CF2731C21E7B8DEF0044CA4F /* RCTDeviceInfo.h in Headers */,
599FAA371FB274980058CCF6 /* RCTSurface.h in Headers */, 599FAA371FB274980058CCF6 /* RCTSurface.h in Headers */,
3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */, 3D302F8C1DF828F800D6DDAE /* RCTSegmentedControl.h in Headers */,
66CD94B21F1045E700CB3C7C /* RCTMaskedView.h in Headers */,
3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */, 3D302F8D1DF828F800D6DDAE /* RCTSegmentedControlManager.h in Headers */,
3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */, 3D302F8E1DF828F800D6DDAE /* RCTShadowView.h in Headers */,
59E604A11FE9CCE300BD90C5 /* RCTScrollContentShadowView.h in Headers */, 59E604A11FE9CCE300BD90C5 /* RCTScrollContentShadowView.h in Headers */,
@@ -3262,7 +3235,6 @@
3DA9819E1E5B0DBB004F2374 /* NSDataBigString.h in Headers */, 3DA9819E1E5B0DBB004F2374 /* NSDataBigString.h in Headers */,
59D031F11F8353D3008361F0 /* RCTSafeAreaView.h in Headers */, 59D031F11F8353D3008361F0 /* RCTSafeAreaView.h in Headers */,
3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */, 3D80DA671DF820620028D040 /* RCTConvert+CoreLocation.h in Headers */,
66CD94B11F1045E700CB3C7C /* RCTMaskedView.h in Headers */,
3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */, 3D80DA6B1DF820620028D040 /* RCTFont.h in Headers */,
3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */, 3D80DA701DF820620028D040 /* RCTModalHostView.h in Headers */,
3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */, 3D80DA711DF820620028D040 /* RCTModalHostViewController.h in Headers */,
@@ -3289,7 +3261,6 @@
3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */, 3D80DA851DF820620028D040 /* RCTSliderManager.h in Headers */,
3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */, 3D80DA861DF820620028D040 /* RCTSwitch.h in Headers */,
3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */, 3D80DA871DF820620028D040 /* RCTSwitchManager.h in Headers */,
66CD94B51F1045E700CB3C7C /* RCTMaskedViewManager.h in Headers */,
3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */, 3D80DA8C1DF820620028D040 /* RCTTextDecorationLineType.h in Headers */,
6577348E1EE8354A00A0E9EA /* RCTInspector.h in Headers */, 6577348E1EE8354A00A0E9EA /* RCTInspector.h in Headers */,
3D80DA8D1DF820620028D040 /* RCTView.h in Headers */, 3D80DA8D1DF820620028D040 /* RCTView.h in Headers */,
@@ -3910,7 +3881,6 @@
2D0EB9F32021067800CAF88A /* RCTUIUtils.m in Sources */, 2D0EB9F32021067800CAF88A /* RCTUIUtils.m in Sources */,
2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */, 2DD0EFE11DA84F2800B0C975 /* RCTStatusBarManager.m in Sources */,
2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */, 2D3B5EC91D9B095C00451313 /* RCTBorderDrawing.m in Sources */,
66CD94B81F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,
2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */, 2D3B5E991D9B089A00451313 /* RCTDisplayLink.m in Sources */,
2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */, 2D3B5EA11D9B08B600451313 /* RCTModuleData.mm in Sources */,
3DCE52F41FEAB10D00613583 /* RCTRedBoxExtraDataViewController.m in Sources */, 3DCE52F41FEAB10D00613583 /* RCTRedBoxExtraDataViewController.m in Sources */,
@@ -3994,7 +3964,6 @@
2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */, 2D3B5EC81D9B095800451313 /* RCTActivityIndicatorViewManager.m in Sources */,
3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */, 3DCD185D1DF978E7007FE5A1 /* RCTReloadCommand.m in Sources */,
130443DB1E401ADD00D93A67 /* RCTConvert+Transform.m in Sources */, 130443DB1E401ADD00D93A67 /* RCTConvert+Transform.m in Sources */,
3D0B84301EC0B51200B2BD8E /* RCTTVNavigationEventEmitter.m in Sources */,
2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */, 2D3B5EC61D9B095000451313 /* RCTProfileTrampoline-x86_64.S in Sources */,
2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */, 2D3B5EA61D9B08CA00451313 /* RCTTouchEvent.m in Sources */,
2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */, 2D8C2E331DA40441000EE098 /* RCTMultipartStreamReader.m in Sources */,
@@ -4007,7 +3976,6 @@
2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */, 2D3B5EC31D9B094800451313 /* RCTProfileTrampoline-arm.S in Sources */,
3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */, 3D0B842B1EC0B49400B2BD8E /* RCTTVRemoteHandler.m in Sources */,
657734861EE834D900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */, 657734861EE834D900A0E9EA /* RCTInspectorDevServerHelper.mm in Sources */,
66CD94B41F1045E700CB3C7C /* RCTMaskedView.m in Sources */,
2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */, 2D74EAFA1DAE9590003B751B /* RCTMultipartDataTask.m in Sources */,
2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */, 2D3B5EC51D9B094D00451313 /* RCTProfileTrampoline-i386.S in Sources */,
657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */, 657734951EE8356100A0E9EA /* RCTInspectorPackagerConnection.m in Sources */,
@@ -4124,7 +4092,6 @@
13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */, 13B07FEF1A69327A00A75B9A /* RCTAlertManager.m in Sources */,
599FAA4C1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */, 599FAA4C1FB274980058CCF6 /* RCTSurfaceView.mm in Sources */,
352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */, 352DCFF01D19F4C20056D623 /* RCTI18nUtil.m in Sources */,
66CD94B71F1045E700CB3C7C /* RCTMaskedViewManager.m in Sources */,
008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */, 008341F61D1DB34400876D9A /* RCTJSStackFrame.m in Sources */,
13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */, 13134C961E296B2A00B9F3CB /* RCTObjcExecutor.mm in Sources */,
59D031FB1F8353D3008361F0 /* RCTSafeAreaViewManager.m in Sources */, 59D031FB1F8353D3008361F0 /* RCTSafeAreaViewManager.m in Sources */,
@@ -4220,7 +4187,6 @@
50E98FEC21460B0D00CD9289 /* RCTWKWebView.m in Sources */, 50E98FEC21460B0D00CD9289 /* RCTWKWebView.m in Sources */,
590D7BFF1EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */, 590D7BFF1EBD458B00D8A370 /* RCTShadowView+Layout.m in Sources */,
5335D5411FE81A4700883D58 /* RCTShadowView.m in Sources */, 5335D5411FE81A4700883D58 /* RCTShadowView.m in Sources */,
66CD94B31F1045E700CB3C7C /* RCTMaskedView.m in Sources */,
13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */, 13C156061AB1A2840079392D /* RCTWebViewManager.m in Sources */,
58114A161AAE854800E7D092 /* RCTPicker.m in Sources */, 58114A161AAE854800E7D092 /* RCTPicker.m in Sources */,
83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */, 83A1FE8C1B62640A00BE0E65 /* RCTModalHostView.m in Sources */,

View File

@@ -1,8 +1,9 @@
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# #
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
Pod::Spec.new do |spec| Pod::Spec.new do |spec|
spec.name = 'Yoga' spec.name = 'Yoga'
spec.version = '1.14.0' spec.version = '1.14.0'
@@ -33,6 +34,6 @@ Pod::Spec.new do |spec|
'-fPIC' '-fPIC'
] ]
spec.source_files = 'yoga/**/*.{c,h,cpp}' spec.source_files = 'yoga/**/*.{c,h,cpp}'
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h' spec.public_header_files = 'yoga/*.h'
end end

View File

@@ -42,9 +42,16 @@ yoga_apple_library(
"$SDKROOT/System/Library/Frameworks/UIKit.framework", "$SDKROOT/System/Library/Frameworks/UIKit.framework",
], ],
header_path_prefix = "", header_path_prefix = "",
labels = ["skip_module_validation"],
link_whole = True, link_whole = True,
modular = True, modular = True,
module_name = "YogaKit", module_name = "YogaKit",
sdk_modules = [
"CoreGraphics",
"Foundation",
"UIKit",
],
use_submodules = False,
visibility = ["PUBLIC"], visibility = ["PUBLIC"],
deps = [ deps = [
yoga_dep(":yoga"), yoga_dep(":yoga"),

View File

@@ -14,9 +14,9 @@ pod 'YogaKit', '~> 1.7'
## Getting Started ## Getting Started
Checkout the docs [here](https://facebook.github.io/yoga/docs/api/yogakit/). Checkout the docs [here](https://facebook.github.io/yoga/docs/api/yogakit/).
We also have a sample project. To try it out, clone this repo and open `YogaKitSample.xcodeproj` in the [YogaKitSample](https://github.com/facebook/yoga/tree/master/YogaKit/YogaKitSample) directory. We also have a sample project. To try it out, clone this repo and open `YogaKitSample.xcodeproj` in the [YogaKitSample](https://github.com/facebook/yoga/tree/main/YogaKit/YogaKitSample) directory.
## Contributing ## Contributing
We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes. We welcome all pull-requests! At Facebook we sync the open source version of `YogaKit` daily, so we're always testing the latest changes.
See the [CONTRIBUTING.md](https://github.com/facebook/yoga/blob/master/CONTRIBUTING.md) file for how to help out. See the [CONTRIBUTING.md](https://github.com/facebook/yoga/blob/main/CONTRIBUTING.md) file for how to help out.

View File

@@ -28,17 +28,19 @@
UIView* child2 = [UIView new]; UIView* child2 = [UIView new];
child2.backgroundColor = [UIColor greenColor]; child2.backgroundColor = [UIColor greenColor];
child2.frame = (CGRect){.size = { child2.frame = (CGRect){
.width = 200, .size = {
.height = 100, .width = 200,
}}; .height = 100,
}};
UIView* child3 = [UIView new]; UIView* child3 = [UIView new];
child3.backgroundColor = [UIColor yellowColor]; child3.backgroundColor = [UIColor yellowColor];
child3.frame = (CGRect){.size = { child3.frame = (CGRect){
.width = 100, .size = {
.height = 100, .width = 100,
}}; .height = 100,
}};
[child2 addSubview:child3]; [child2 addSubview:child3];
[root addSubview:child1]; [root addSubview:child1];

View File

@@ -3,10 +3,11 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource") load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "JAVA_TARGET", "PROGUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
yoga_android_aar( yoga_android_aar(
name = "android", name = "android",
enable_relinker = True,
manifest_skeleton = "src/main/AndroidManifest.xml", manifest_skeleton = "src/main/AndroidManifest.xml",
visibility = [ visibility = [
"PUBLIC", "PUBLIC",
@@ -15,7 +16,7 @@ yoga_android_aar(
ANDROID_JAVA_TARGET, ANDROID_JAVA_TARGET,
ANDROID_RES_TARGET, ANDROID_RES_TARGET,
JAVA_TARGET, JAVA_TARGET,
PROGRUARD_ANNOTATIONS_TARGET, PROGUARD_ANNOTATIONS_TARGET,
], ],
) )

View File

@@ -4,11 +4,11 @@
YogaLayout is available via jcenter: YogaLayout is available via jcenter:
compile 'com.facebook.yoga.android:yoga-layout:1.2.0' implementation 'com.facebook.yoga.android:yoga-layout:1.16.0'
## Getting Started ## Getting Started
Check out the docs [here](https://facebook.github.io/yoga/docs/api/android/). Check out the docs [here](https://yogalayout.com/getting-started/standalone/).
We also have a sample project. To try it, clone the repo and run (with a device attached) We also have a sample project. To try it, clone the repo and run (with a device attached)

View File

@@ -5,17 +5,12 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'
version = VERSION_NAME
group = GROUP
android { android {
compileSdkVersion rootProject.compileSdkVersion compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion buildToolsVersion rootProject.buildToolsVersion
ndkVersion rootProject.ndkVersion
defaultConfig { defaultConfig {
minSdkVersion rootProject.minSdkVersion minSdkVersion rootProject.minSdkVersion
@@ -32,21 +27,10 @@ dependencies {
api project(':yoga') api project(':yoga')
} }
task sourcesJar(type: Jar) { // We don't build Javadoc at this time as we can't disable "BUCK" files
classifier = 'source' // from mistakenly getting parsed as Java.
from android.sourceSets.main.java.srcDirs tasks.withType(Javadoc).all {
enabled = false
} }
task javadoc(type: Javadoc) { apply plugin: 'com.vanniktech.maven.publish'
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
apply from: rootProject.file('gradle/release.gradle')

View File

@@ -8,6 +8,8 @@ load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAM
yoga_android_library( yoga_android_library(
name = "yoga", name = "yoga",
srcs = glob(["**/*.java"]), srcs = glob(["**/*.java"]),
autoglob = False,
language = "JAVA",
visibility = [ visibility = [
"PUBLIC", "PUBLIC",
], ],

View File

@@ -8,6 +8,8 @@ load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTA
yoga_android_library( yoga_android_library(
name = "android", name = "android",
srcs = glob(["**/*.java"]), srcs = glob(["**/*.java"]),
autoglob = False,
language = "JAVA",
visibility = [ visibility = [
"PUBLIC", "PUBLIC",
], ],

View File

@@ -10,14 +10,11 @@
buildscript { buildscript {
repositories { repositories {
google() google()
jcenter() mavenCentral()
maven { url 'https://maven.google.com/' }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.0' classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.15.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
@@ -26,15 +23,16 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
} }
ext { ext {
minSdkVersion = 14 minSdkVersion = 14
targetSdkVersion = 25 targetSdkVersion = 29
compileSdkVersion = 26 compileSdkVersion = 29
buildToolsVersion = '28.0.3' buildToolsVersion = '30.0.2'
ndkVersion = '21.3.6528147'
sourceCompatibilityVersion = JavaVersion.VERSION_1_7 sourceCompatibilityVersion = JavaVersion.VERSION_1_7
targetCompatibilityVersion = JavaVersion.VERSION_1_7 targetCompatibilityVersion = JavaVersion.VERSION_1_7
} }

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaAlign public enum YogaAlign

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaDimension public enum YogaDimension

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaDirection public enum YogaDirection

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaDisplay public enum YogaDisplay

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaEdge public enum YogaEdge

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaExperimentalFeature public enum YogaExperimentalFeature

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaFlexDirection public enum YogaFlexDirection

View File

@@ -0,0 +1,18 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @generated by enums.py
namespace Facebook.Yoga
{
public enum YogaGutter
{
Column,
Row,
All,
}
}

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaJustify public enum YogaJustify

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaLogLevel public enum YogaLogLevel

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaMeasureMode public enum YogaMeasureMode

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaNodeType public enum YogaNodeType

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaOverflow public enum YogaOverflow

View File

@@ -1,14 +1,17 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaPositionType public enum YogaPositionType
{ {
Static,
Relative, Relative,
Absolute, Absolute,
} }

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
[System.Flags] [System.Flags]

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaUnit public enum YogaUnit

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
namespace Facebook.Yoga namespace Facebook.Yoga
{ {
public enum YogaWrap public enum YogaWrap

View File

@@ -24,7 +24,7 @@ static int unmanagedLogger(
return result; return result;
} }
void YGInteropSetLogger(YGInteropLogger managedLogger) { YOGA_EXPORT void YGInteropSetLogger(YGInteropLogger managedLogger) {
gManagedLogger = managedLogger; gManagedLogger = managedLogger;
YGConfigSetLogger(YGConfigGetDefault(), &unmanagedLogger); YGConfigSetLogger(YGConfigGetDefault(), &unmanagedLogger);
} }

View File

@@ -36,7 +36,7 @@
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
@@ -48,7 +48,7 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
@@ -62,13 +62,13 @@
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
@@ -227,6 +227,8 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\yoga\event\event.h" />
<ClInclude Include="..\..\yoga\log.h" />
<ClInclude Include="..\..\yoga\Utils.h" /> <ClInclude Include="..\..\yoga\Utils.h" />
<ClInclude Include="..\..\yoga\YGConfig.h" /> <ClInclude Include="..\..\yoga\YGConfig.h" />
<ClInclude Include="..\..\yoga\YGEnums.h" /> <ClInclude Include="..\..\yoga\YGEnums.h" />
@@ -236,6 +238,7 @@
<ClInclude Include="..\..\yoga\YGNode.h" /> <ClInclude Include="..\..\yoga\YGNode.h" />
<ClInclude Include="..\..\yoga\YGNodePrint.h" /> <ClInclude Include="..\..\yoga\YGNodePrint.h" />
<ClInclude Include="..\..\yoga\YGStyle.h" /> <ClInclude Include="..\..\yoga\YGStyle.h" />
<ClInclude Include="..\..\yoga\YGValue.h" />
<ClInclude Include="..\..\yoga\Yoga-internal.h" /> <ClInclude Include="..\..\yoga\Yoga-internal.h" />
<ClInclude Include="..\..\yoga\Yoga.h" /> <ClInclude Include="..\..\yoga\Yoga.h" />
<ClInclude Include="resource.h" /> <ClInclude Include="resource.h" />
@@ -243,14 +246,16 @@
<ClInclude Include="targetver.h" /> <ClInclude Include="targetver.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\yoga\event\event.cpp" />
<ClCompile Include="..\..\yoga\log.cpp" />
<ClCompile Include="..\..\yoga\Utils.cpp" /> <ClCompile Include="..\..\yoga\Utils.cpp" />
<ClCompile Include="..\..\yoga\YGConfig.cpp" /> <ClCompile Include="..\..\yoga\YGConfig.cpp" />
<ClCompile Include="..\..\yoga\YGEnums.cpp" /> <ClCompile Include="..\..\yoga\YGEnums.cpp" />
<ClCompile Include="..\..\yoga\YGFloatOptional.cpp" />
<ClCompile Include="..\..\yoga\YGLayout.cpp" /> <ClCompile Include="..\..\yoga\YGLayout.cpp" />
<ClCompile Include="..\..\yoga\YGNode.cpp" /> <ClCompile Include="..\..\yoga\YGNode.cpp" />
<ClCompile Include="..\..\yoga\YGNodePrint.cpp" /> <ClCompile Include="..\..\yoga\YGNodePrint.cpp" />
<ClCompile Include="..\..\yoga\YGStyle.cpp" /> <ClCompile Include="..\..\yoga\YGStyle.cpp" />
<ClCompile Include="..\..\yoga\YGValue.cpp" />
<ClCompile Include="..\..\yoga\Yoga.cpp" /> <ClCompile Include="..\..\yoga\Yoga.cpp" />
<ClCompile Include="YGInterop.cpp" /> <ClCompile Include="YGInterop.cpp" />
<ClCompile Include="dllmain.cpp"> <ClCompile Include="dllmain.cpp">

View File

@@ -57,6 +57,15 @@
<ClInclude Include="..\..\yoga\YGConfig.h"> <ClInclude Include="..\..\yoga\YGConfig.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\yoga\YGValue.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\log.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\event\event.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="stdafx.cpp"> <ClCompile Include="stdafx.cpp">
@@ -74,9 +83,6 @@
<ClCompile Include="..\..\yoga\YGEnums.cpp"> <ClCompile Include="..\..\yoga\YGEnums.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\yoga\YGFloatOptional.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\yoga\YGLayout.cpp"> <ClCompile Include="..\..\yoga\YGLayout.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@@ -95,6 +101,15 @@
<ClCompile Include="..\..\yoga\YGConfig.cpp"> <ClCompile Include="..\..\yoga\YGConfig.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\yoga\YGValue.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\yoga\event\event.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\yoga\log.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="Yoga.rc"> <ResourceCompile Include="Yoga.rc">

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
using System; using System;
@@ -333,5 +334,47 @@ namespace Facebook.Yoga
Assert.AreEqual(0f, root_child1.LayoutHeight); Assert.AreEqual(0f, root_child1.LayoutHeight);
} }
[Test]
public void Test_display_none_with_position_absolute()
{
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode(config);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.Width = 100;
root_child0.Height = 100;
root_child0.Display = YogaDisplay.None;
root.Insert(0, root_child0);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(0f, root_child0.LayoutWidth);
Assert.AreEqual(0f, root_child0.LayoutHeight);
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(0f, root_child0.LayoutWidth);
Assert.AreEqual(0f, root_child0.LayoutHeight);
}
} }
} }

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
using System; using System;
@@ -95,115 +96,6 @@ namespace Facebook.Yoga
Assert.AreEqual(50f, root_child0.LayoutHeight); Assert.AreEqual(50f, root_child0.LayoutHeight);
} }
[Test]
public void Test_min_height()
{
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode(config);
root_child0.FlexGrow = 1;
root_child0.MinHeight = 60;
root.Insert(0, root_child0);
YogaNode root_child1 = new YogaNode(config);
root_child1.FlexGrow = 1;
root.Insert(1, root_child1);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(80f, root_child0.LayoutHeight);
Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(80f, root_child1.LayoutY);
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(20f, root_child1.LayoutHeight);
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(80f, root_child0.LayoutHeight);
Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(80f, root_child1.LayoutY);
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(20f, root_child1.LayoutHeight);
}
[Test]
public void Test_min_width()
{
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode(config);
root_child0.FlexGrow = 1;
root_child0.MinWidth = 60;
root.Insert(0, root_child0);
YogaNode root_child1 = new YogaNode(config);
root_child1.FlexGrow = 1;
root.Insert(1, root_child1);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(80f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
Assert.AreEqual(80f, root_child1.LayoutX);
Assert.AreEqual(0f, root_child1.LayoutY);
Assert.AreEqual(20f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(100f, root.LayoutWidth);
Assert.AreEqual(100f, root.LayoutHeight);
Assert.AreEqual(20f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(80f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(0f, root_child1.LayoutY);
Assert.AreEqual(20f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
}
[Test] [Test]
public void Test_justify_content_min_max() public void Test_justify_content_min_max()
{ {

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
using System; using System;
@@ -252,61 +253,6 @@ namespace Facebook.Yoga
Assert.AreEqual(75f, root_child1.LayoutHeight); Assert.AreEqual(75f, root_child1.LayoutHeight);
} }
[Test]
public void Test_percentage_flex_basis_cross_min_height()
{
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.Width = 200;
root.Height = 200;
YogaNode root_child0 = new YogaNode(config);
root_child0.FlexGrow = 1;
root_child0.MinHeight = 60.Percent();
root.Insert(0, root_child0);
YogaNode root_child1 = new YogaNode(config);
root_child1.FlexGrow = 2;
root_child1.MinHeight = 10.Percent();
root.Insert(1, root_child1);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(200f, root.LayoutWidth);
Assert.AreEqual(200f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(200f, root_child0.LayoutWidth);
Assert.AreEqual(140f, root_child0.LayoutHeight);
Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(140f, root_child1.LayoutY);
Assert.AreEqual(200f, root_child1.LayoutWidth);
Assert.AreEqual(60f, root_child1.LayoutHeight);
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
Assert.AreEqual(0f, root.LayoutY);
Assert.AreEqual(200f, root.LayoutWidth);
Assert.AreEqual(200f, root.LayoutHeight);
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(200f, root_child0.LayoutWidth);
Assert.AreEqual(140f, root_child0.LayoutHeight);
Assert.AreEqual(0f, root_child1.LayoutX);
Assert.AreEqual(140f, root_child1.LayoutY);
Assert.AreEqual(200f, root_child1.LayoutWidth);
Assert.AreEqual(60f, root_child1.LayoutHeight);
}
[Test] [Test]
public void Test_percentage_flex_basis_main_max_height() public void Test_percentage_flex_basis_main_max_height()
{ {

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
using System; using System;

View File

@@ -1,9 +1,10 @@
/** /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the LICENSE * This source code is licensed under the MIT license found in the
* file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @Generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html // @Generated by gentest/gentest.rb from gentest/fixtures/YGSizeOverflowTest.html
using System; using System;

110
enums.py
View File

@@ -1,4 +1,4 @@
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# #
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
@@ -31,7 +31,7 @@ ENUMS = {
"SpaceBetween", "SpaceBetween",
"SpaceAround", "SpaceAround",
], ],
"PositionType": ["Relative", "Absolute"], "PositionType": ["Static", "Relative", "Absolute"],
"Display": ["Flex", "None"], "Display": ["Flex", "None"],
"Wrap": ["NoWrap", "Wrap", "WrapReverse"], "Wrap": ["NoWrap", "Wrap", "WrapReverse"],
"MeasureMode": ["Undefined", "Exactly", "AtMost"], "MeasureMode": ["Undefined", "Exactly", "AtMost"],
@@ -54,16 +54,29 @@ ENUMS = {
"WebFlexBasis" "WebFlexBasis"
], ],
"PrintOptions": [("Layout", 1), ("Style", 2), ("Children", 4)], "PrintOptions": [("Layout", 1), ("Style", 2), ("Children", 4)],
"Gutter": ["Column", "Row", "All"],
} }
LICENSE = """/** # Generated Java enums used to emit @DoNotStrip, but D17519844 removed them
* Copyright (c) Facebook, Inc. and its affiliates. # manually from all but YogaLogLevel. TODO: Is it safe to remove from it as
# well?
DO_NOT_STRIP = ["LogLevel"]
def get_license(ext):
prologue = "/**" if ext == "js" else "/*"
return """{}
* Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
""" // @generated by enums.py
""".format(
prologue
)
def to_java_upper(symbol): def to_java_upper(symbol):
@@ -92,32 +105,40 @@ root = os.path.dirname(os.path.abspath(__file__))
# write out C & Objective-C headers # write out C & Objective-C headers
with open(root + "/yoga/YGEnums.h", "w") as f: with open(root + "/yoga/YGEnums.h", "w") as f:
f.write(LICENSE) f.write(get_license("cpp"))
f.write("#pragma once\n\n") f.write("#pragma once\n")
f.write("// clang-format: off\n\n")
f.write('#include "YGMacros.h"\n\n') f.write('#include "YGMacros.h"\n\n')
f.write("YG_EXTERN_C_BEGIN\n\n")
for name, values in sorted(ENUMS.items()): f.write('YG_EXTERN_C_BEGIN\n\n')
f.write("#define YG%sCount %s\n" % (name, len(values))) items = sorted(ENUMS.items())
f.write("typedef YG_ENUM_BEGIN(YG%s) {\n" % name) for name, values in items:
if (isinstance(values[0], tuple)):
f.write("YG_ENUM_DECL(\n")
else:
f.write("YG_ENUM_SEQ_DECL(\n")
f.write(" YG%s,\n" % name)
for value in values: for value in values:
if isinstance(value, tuple): if isinstance(value, tuple):
f.write(" YG%s%s = %d,\n" % (name, value[0], value[1])) f.write(" YG%s%s = %d" % (name, value[0], value[1]))
else: else:
f.write(" YG%s%s,\n" % (name, value)) f.write(" YG%s%s" % (name, value))
f.write("} YG_ENUM_END(YG%s);\n" % name) if value == values[-1]:
f.write( f.write(")\n")
"WIN_EXPORT const char *YG%sToString(const YG%s value);\n" % (name, name) else:
) f.write(",\n")
f.write("\n") f.write("\n")
f.write("YG_EXTERN_C_END\n") f.write("YG_EXTERN_C_END\n")
# write out C body for printing # write out C body for printing
with open(root + "/yoga/YGEnums.cpp", "w") as f: with open(root + "/yoga/YGEnums.cpp", "w") as f:
f.write(LICENSE) f.write(get_license("cpp"))
f.write('#include "YGEnums.h"\n\n') f.write('#include "YGEnums.h"\n\n')
for name, values in sorted(ENUMS.items()): items = sorted(ENUMS.items())
f.write("const char *YG%sToString(const YG%s value){\n" % (name, name)) for name, values in items:
f.write(" switch(value){\n") f.write("const char* YG%sToString(const YG%s value) {\n" % (name, name))
f.write(" switch (value) {\n")
for value in values: for value in values:
if isinstance(value, tuple): if isinstance(value, tuple):
f.write(" case YG%s%s:\n" % (name, value[0])) f.write(" case YG%s%s:\n" % (name, value[0]))
@@ -127,15 +148,18 @@ with open(root + "/yoga/YGEnums.cpp", "w") as f:
f.write(' return "%s";\n' % to_log_lower(value)) f.write(' return "%s";\n' % to_log_lower(value))
f.write(" }\n") f.write(" }\n")
f.write(' return "unknown";\n') f.write(' return "unknown";\n')
f.write("}\n\n") f.write("}\n")
if name != items[-1][0]:
f.write("\n")
# write out java files # write out java files
for name, values in sorted(ENUMS.items()): for name, values in sorted(ENUMS.items()):
with open(root + "/java/com/facebook/yoga/Yoga%s.java" % name, "w") as f: with open(root + "/java/com/facebook/yoga/Yoga%s.java" % name, "w") as f:
f.write(LICENSE.replace("/**", "/*", 1)) f.write(get_license("java"))
f.write("package com.facebook.yoga;\n\n") f.write("package com.facebook.yoga;\n\n")
f.write("import com.facebook.proguard.annotations.DoNotStrip;\n\n") if name in DO_NOT_STRIP:
f.write("@DoNotStrip\n") f.write("import com.facebook.proguard.annotations.DoNotStrip;\n\n")
f.write("@DoNotStrip\n")
f.write("public enum Yoga%s {\n" % name) f.write("public enum Yoga%s {\n" % name)
if len(values) > 0: if len(values) > 0:
for value in values: for value in values:
@@ -150,7 +174,7 @@ for name, values in sorted(ENUMS.items()):
else: else:
f.write("__EMPTY(-1);") f.write("__EMPTY(-1);")
f.write("\n") f.write("\n")
f.write(" private int mIntValue;\n") f.write(" private final int mIntValue;\n")
f.write("\n") f.write("\n")
f.write(" Yoga%s(int intValue) {\n" % name) f.write(" Yoga%s(int intValue) {\n" % name)
f.write(" mIntValue = intValue;\n") f.write(" mIntValue = intValue;\n")
@@ -160,6 +184,8 @@ for name, values in sorted(ENUMS.items()):
f.write(" return mIntValue;\n") f.write(" return mIntValue;\n")
f.write(" }\n") f.write(" }\n")
f.write("\n") f.write("\n")
if name in DO_NOT_STRIP:
f.write(" @DoNotStrip\n")
f.write(" public static Yoga%s fromInt(int value) {\n" % name) f.write(" public static Yoga%s fromInt(int value) {\n" % name)
f.write(" switch (value) {\n") f.write(" switch (value) {\n")
for value in values: for value in values:
@@ -182,7 +208,7 @@ for name, values in sorted(ENUMS.items()):
# write out csharp files # write out csharp files
for name, values in sorted(ENUMS.items()): for name, values in sorted(ENUMS.items()):
with open(root + "/csharp/Facebook.Yoga/Yoga%s.cs" % name, "w") as f: with open(root + "/csharp/Facebook.Yoga/Yoga%s.cs" % name, "w") as f:
f.write(LICENSE) f.write(get_license("cs"))
f.write("namespace Facebook.Yoga\n{\n") f.write("namespace Facebook.Yoga\n{\n")
if isinstance(next(iter(values or []), None), tuple): if isinstance(next(iter(values or []), None), tuple):
f.write(" [System.Flags]\n") f.write(" [System.Flags]\n")
@@ -197,9 +223,12 @@ for name, values in sorted(ENUMS.items()):
# write out javascript file # write out javascript file
with open(root + "/javascript/sources/YGEnums.js", "w") as f: with open(root + "/javascript/sources/YGEnums.js", "w") as f:
f.write(LICENSE) f.write(get_license("js"))
f.write("module.exports = {\n\n") f.write("// @flow\n")
for name, values in sorted(ENUMS.items()): f.write("// @format\n")
f.write("const CONSTANTS = {\n")
items = sorted(ENUMS.items())
for name, values in items:
f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values))) f.write(" %s_COUNT: %s,\n" % (to_java_upper(name), len(values)))
base = 0 base = 0
for value in values: for value in values:
@@ -214,5 +243,24 @@ with open(root + "/javascript/sources/YGEnums.js", "w") as f:
" %s_%s: %d,\n" % (to_java_upper(name), to_java_upper(value), base) " %s_%s: %d,\n" % (to_java_upper(name), to_java_upper(value), base)
) )
base += 1 base += 1
f.write("\n")
if name != items[-1][0]:
f.write("\n")
f.write("};\n") f.write("};\n")
for name, values in sorted(ENUMS.items()):
f.write("export type Yoga${} =\n".format(name))
for value in values:
unpackedValue = value[0] if isinstance(value, tuple) else value
f.write(
" | typeof CONSTANTS.{}_{}".format(
to_java_upper(name), to_java_upper(unpackedValue)
)
)
if values[-1] == value:
f.write(";\n")
else:
f.write("\n")
f.write("\n")
f.write("module.exports = CONSTANTS;\n")

4
gentest/Gemfile Normal file
View File

@@ -0,0 +1,4 @@
source "https://rubygems.org"
gem 'watir', '~>6.19.0'
gem 'webdrivers', '~> 5.1.0'

35
gentest/Gemfile.lock Normal file
View File

@@ -0,0 +1,35 @@
GEM
remote: https://rubygems.org/
specs:
childprocess (4.1.0)
mini_portile2 (2.8.0)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
racc (1.6.0)
regexp_parser (2.6.0)
rexml (3.2.5)
rubyzip (2.3.2)
selenium-webdriver (4.5.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
watir (6.19.1)
regexp_parser (>= 1.2, < 3)
selenium-webdriver (>= 3.142.7)
webdrivers (5.1.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
websocket (1.2.9)
PLATFORMS
ruby
DEPENDENCIES
watir (~> 6.19.0)
webdrivers (~> 5.1.0)
BUNDLED WITH
2.1.4

View File

@@ -25,3 +25,7 @@
<div style="flex-grow: 1;"></div> <div style="flex-grow: 1;"></div>
<div style="flex-grow: 1; display:none; top: 10px;"></div> <div style="flex-grow: 1; display:none; top: 10px;"></div>
</div> </div>
<div id="display_none_with_position_absolute" style="width: 100px; height: 100px;">
<div style="display:none; position: absolute; width: 100px; height: 100px"></div>
</div>

View File

@@ -6,15 +6,21 @@
<div style="width: 10px; max-height: 50px;"></div> <div style="width: 10px; max-height: 50px;"></div>
</div> </div>
<!-- Chrome and Yoga disagree on the correct output -->
<!--
<div id="min_height" style="width: 100px; height: 100px;"> <div id="min_height" style="width: 100px; height: 100px;">
<div style="flex-grow: 1; min-height: 60px;"></div> <div style="flex-grow: 1; min-height: 60px;"></div>
<div style="flex-grow: 1;"></div> <div style="flex-grow: 1;"></div>
</div> </div>
-->
<!-- Chrome and Yoga disagree on the correct output -->
<!--
<div id="min_width" style="width: 100px; height: 100px; flex-direction: row"> <div id="min_width" style="width: 100px; height: 100px; flex-direction: row">
<div style="flex-grow: 1; min-width: 60px;"></div> <div style="flex-grow: 1; min-width: 60px;"></div>
<div style="flex-grow: 1;"></div> <div style="flex-grow: 1;"></div>
</div> </div>
-->
<div id="justify_content_min_max" style="max-height: 200px; min-height: 100px; width: 100px; justify-content: center;"> <div id="justify_content_min_max" style="max-height: 200px; min-height: 100px; width: 100px; justify-content: center;">
<div style="width: 60px; height: 60px;"></div> <div style="width: 60px; height: 60px;"></div>

View File

@@ -20,10 +20,14 @@
<div style="flex-grow: 1; flex-basis: 25%;"></div> <div style="flex-grow: 1; flex-basis: 25%;"></div>
</div> </div>
<!-- Chrome and Yoga disagree on the correct output -->
<!--
<div id="percentage_flex_basis_cross_min_height" style="width: 200px; height: 200px; flex-direction: column;"> <div id="percentage_flex_basis_cross_min_height" style="width: 200px; height: 200px; flex-direction: column;">
<div style="flex-grow: 1; min-height: 60%;"></div> <div style="flex-grow: 1; min-height: 60%;"></div>
<div style="flex-grow: 2; min-height: 10%;"></div> <div style="flex-grow: 2; min-height: 10%;"></div>
</div> </div>
-->
<div id="percentage_flex_basis_main_max_height" style="width: 200px; height: 200px; flex-direction: row;"> <div id="percentage_flex_basis_main_max_height" style="width: 200px; height: 200px; flex-direction: row;">
<div style="flex-grow: 1; flex-basis: 10%; max-height: 60%;"></div> <div style="flex-grow: 1; flex-basis: 10%; max-height: 60%;"></div>

View File

@@ -120,8 +120,9 @@ CSEmitter.prototype = Object.create(Emitter.prototype, {
YGOverflowHidden:{value:'YogaOverflow.Hidden'}, YGOverflowHidden:{value:'YogaOverflow.Hidden'},
YGOverflowVisible:{value:'YogaOverflow.Visible'}, YGOverflowVisible:{value:'YogaOverflow.Visible'},
YGPositionTypeAbsolute:{value:'YogaPositionType.Absolute'}, YGPositionTypeAbsolute:{value:'YogaPositionType.Static'},
YGPositionTypeRelative:{value:'YogaPositionType.Relative'}, YGPositionTypeRelative:{value:'YogaPositionType.Relative'},
YGPositionTypeAbsolute:{value:'YogaPositionType.Absolute'},
YGUndefined:{value:'YogaConstants.Undefined'}, YGUndefined:{value:'YogaConstants.Undefined'},

View File

@@ -1,5 +1,5 @@
/** /**
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
@@ -10,24 +10,28 @@ window.onload = function() {
printTest( printTest(
new CPPEmitter(), new CPPEmitter(),
'cpp',
document.body.children[0], document.body.children[0],
document.body.children[1], document.body.children[1],
document.body.children[2]); document.body.children[2]);
printTest( printTest(
new JavaEmitter(), new JavaEmitter(),
'java',
document.body.children[0], document.body.children[0],
document.body.children[1], document.body.children[1],
document.body.children[2]); document.body.children[2]);
printTest( printTest(
new CSEmitter(), new CSEmitter(),
'cs',
document.body.children[0], document.body.children[0],
document.body.children[1], document.body.children[1],
document.body.children[2]); document.body.children[2]);
printTest( printTest(
new JavascriptEmitter(), new JavascriptEmitter(),
'js',
document.body.children[0], document.body.children[0],
document.body.children[1], document.body.children[1],
document.body.children[2]); document.body.children[2]);
@@ -39,14 +43,15 @@ function assert(condition, message) {
} }
} }
function printTest(e, LTRContainer, RTLContainer, genericContainer) { function printTest(e, ext, LTRContainer, RTLContainer, genericContainer) {
e.push([ e.push([
'/**', ext === 'js' ? '/**' : '/*',
' * Copyright (c) Facebook, Inc. and its affiliates.', ' * Copyright (c) Meta Platforms, Inc. and affiliates.',
' *', ' *',
' * This source code is licensed under the MIT license found in the LICENSE', ' * This source code is licensed under the MIT license found in the',
' * file in the root directory of this source tree.', ' * LICENSE file in the root directory of this source tree.',
' */', ' */',
ext === 'cpp' ? '\n// clang-format off' : '',
'// @Generated by gentest/gentest.rb from gentest/fixtures/' + document.title + '.html', '// @Generated by gentest/gentest.rb from gentest/fixtures/' + document.title + '.html',
'', '',
]); ]);

View File

@@ -1,19 +1,20 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) Meta Platforms, Inc. and affiliates.
# #
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
require 'watir' require 'watir'
require 'webdrivers'
require 'fileutils' require 'fileutils'
caps = Selenium::WebDriver::Remote::Capabilities.chrome( browser = Watir::Browser.new(:chrome, options: {
"loggingPrefs"=>{ "goog:loggingPrefs" => {
"browser"=>"ALL", "browser" => "ALL",
"performance"=>"ALL" "performance" => "ALL"
} },
) args: ['--force-device-scale-factor=1', '--window-position=0,0']
browser = Watir::Browser.new(:chrome, :desired_capabilities => caps, :switches => ['--force-device-scale-factor=1', '--window-position=0,0']) })
Dir.chdir(File.dirname($0)) Dir.chdir(File.dirname($0))
@@ -39,7 +40,7 @@ Dir['fixtures/*.html'].each do |file|
FileUtils.copy('test.html', "#{name}.html") if $DEBUG FileUtils.copy('test.html', "#{name}.html") if $DEBUG
browser.goto('file://' + Dir.pwd + '/test.html') browser.goto('file://' + Dir.pwd + '/test.html')
logs = browser.driver.manage.logs.get(:browser) logs = browser.driver.logs.get(:browser)
f = File.open("../tests/#{name}.cpp", 'w') f = File.open("../tests/#{name}.cpp", 'w')
f.write eval(logs[0].message.sub(/^[^"]*/, '')) f.write eval(logs[0].message.sub(/^[^"]*/, ''))

View File

@@ -9,13 +9,16 @@
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
VERSION_NAME=1.16.0-SNAPSHOT VERSION_NAME=1.19.0
POM_URL=https://github.com/facebook/yoga POM_URL=https://github.com/facebook/yoga
POM_SCM_URL=https://github.com/facebook/yoga.git POM_SCM_URL=https://github.com/facebook/yoga.git
POM_SCM_CONNECTION=scm:git:https://github.com/facebook/yoga.git POM_SCM_CONNECTION=scm:git:https://github.com/facebook/yoga.git
POM_SCM_DEV_CONNECTION=scm:git:git@github.com:facebook/yoga.git POM_SCM_DEV_CONNECTION=scm:git:git@github.com:facebook/yoga.git
POM_LICENSE_NAME=MIT License POM_LICENSE_NAME=MIT License
POM_LICENSE_URL=https://github.com/facebook/yoga/blob/master/LICENSE POM_LICENSE_URL=https://github.com/facebook/yoga/blob/main/LICENSE
POM_LICENSE_DIST=repo POM_LICENSE_DIST=repo
POM_LICENCE_NAME=MIT License
POM_LICENCE_URL=https://github.com/facebook/yoga/blob/main/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=facebook POM_DEVELOPER_NAME=facebook

View File

@@ -1,44 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Configure the Android maven publication
apply plugin: 'com.github.dcendents.android-maven'
version = VERSION_NAME
group = GROUP
// Set the .aar / .jar base file name to match the artifact ID
// in case the module has a different name
project.archivesBaseName = POM_ARTIFACT_ID
install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom.project {
name POM_NAME
artifactId POM_ARTIFACT_ID
packaging POM_PACKAGING
description POM_DESCRIPTION
url projectUrl
scm {
url scmUrl
connection scmConnection
developerConnection scmDeveloperConnection
}
licenses projectLicenses
developers {
developer {
id developerId
name developerName
}
}
}
}
}

View File

@@ -1,54 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Android tasks for Javadoc and sources.jar generation
afterEvaluate { project ->
if (POM_PACKAGING == 'aar') {
task androidJavadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
exclude '**/pom.xml'
exclude '**/proguard_annotations.pro'
classpath += files(android.bootClasspath)
}
task androidJavadocJar(type: Jar) {
classifier = 'javadoc'
from androidJavadoc.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
from variant.javaCompile.destinationDir
}
}
artifacts.add('archives', androidJavadocJar)
artifacts.add('archives', androidSourcesJar)
}
if (POM_PACKAGING == 'jar') {
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts.add('archives', javadocJar)
artifacts.add('archives', sourcesJar)
}
}

View File

@@ -1,70 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Upload to Bintray
apply plugin: 'com.jfrog.bintray'
def getBintrayUsername() {
return project.hasProperty('bintrayUsername') ? property('bintrayUsername') : System.getenv('BINTRAY_USERNAME')
}
def getBintrayApiKey() {
return project.hasProperty('bintrayApiKey') ? property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
}
def getBintrayGpgPassword() {
return project.hasProperty('bintrayGpgPassword') ? property('bintrayGpgPassword') : System.getenv('BINTRAY_GPG_PASSWORD')
}
def getMavenCentralUsername() {
return project.hasProperty('mavenCentralUsername') ? property('mavenCentralUsername') : System.getenv('MAVEN_CENTRAL_USERNAME')
}
def getMavenCentralPassword() {
return project.hasProperty('mavenCentralPassword') ? property('mavenCentralPassword') : System.getenv('MAVEN_CENTRAL_PASSWORD')
}
def shouldSyncWithMavenCentral() {
return project.hasProperty('syncWithMavenCentral') ? property('syncWithMavenCentral').toBoolean() : false
}
def dryRunOnly() {
return project.hasProperty('dryRun') ? property('dryRun').toBoolean() : false
}
bintray {
user = getBintrayUsername()
key = getBintrayApiKey()
configurations = ['archives']
pkg {
repo = bintrayRepo
userOrg = bintrayUserOrg
name = bintrayName
desc = bintrayDescription
websiteUrl = projectUrl
issueTrackerUrl = issuesUrl
vcsUrl = scmUrl
licenses = projectLicenses
dryRun = dryRunOnly()
override = true
publish = true
publicDownloadNumbers = true
version {
desc = bintrayDescription
gpg {
sign = true
passphrase = getBintrayGpgPassword()
}
mavenCentralSync {
sync = shouldSyncWithMavenCentral()
user = getMavenCentralUsername()
password = getMavenCentralPassword()
close = '1' // If set to 0, you have to manually click release
}
}
}
}

View File

@@ -1,96 +0,0 @@
/*
* Copyright 2013 Chris Banes
*
* 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.
*/
apply plugin: 'signing'
version = VERSION_NAME
group = GROUP
def isReleaseBuild() {
return VERSION_NAME.contains('SNAPSHOT') == false
}
def getReleaseRepositoryUrl() {
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
}
def getSnapshotRepositoryUrl() {
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
: "https://oss.sonatype.org/content/repositories/snapshots/"
}
def getRepositoryUsername() {
return hasProperty('SONATYPE_NEXUS_USERNAME') ? SONATYPE_NEXUS_USERNAME : ""
}
def getRepositoryPassword() {
return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : ""
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.groupId = GROUP
pom.artifactId = POM_ARTIFACT_ID
pom.version = VERSION_NAME
repository(url: getReleaseRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
snapshotRepository(url: getSnapshotRepositoryUrl()) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
pom.project {
name POM_NAME
packaging POM_PACKAGING
description POM_DESCRIPTION
url POM_URL
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEV_CONNECTION
}
licenses {
license {
name POM_LICENSE_NAME
url POM_LICENSE_URL
distribution POM_LICENSE_DIST
}
}
developers {
developer {
id POM_DEVELOPER_ID
name POM_DEVELOPER_NAME
}
}
}
}
}
}
signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') }
sign configurations.archives
}
}

View File

@@ -1,40 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Set up everything required for releasing on Bintray
ext {
bintrayRepo = 'maven'
bintrayUserOrg = 'facebook'
bintrayName = "${GROUP}:${POM_ARTIFACT_ID}"
bintrayDescription = POM_DESCRIPTION
projectUrl = POM_URL
issuesUrl = 'https://github.com/facebook/yoga/issues'
scmUrl = POM_SCM_URL
scmConnection = POM_SCM_CONNECTION
scmDeveloperConnection = POM_SCM_DEV_CONNECTION
publishedGroupId = GROUP
libraryName = 'yoga'
artifact = 'yoga'
developerId = POM_DEVELOPER_ID
developerName = POM_DEVELOPER_NAME
projectLicenses = {
license {
name = POM_LICENSE_NAME
url = POM_LICENSE_URL
distribution = POM_LICENSE_DIST
}
}
}
// Set up the Android Maven publication (POM etc.)
apply from: rootProject.file('gradle/android-maven-install.gradle')
// Upload to Bintray
apply from: rootProject.file('gradle/bintray.gradle')

View File

@@ -1,15 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Common Android tasks for all releases that generate Javadocs, sources, etc.
apply from: rootProject.file('gradle/android-tasks.gradle')
// Upload to Bintray
apply from: rootProject.file('gradle/release-bintray.gradle')
// Upload directly to standard Maven Central (for SNAPSHOTs)
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

View File

@@ -0,0 +1,14 @@
{
"allAbis": [
"armeabi-v7a",
"arm64-v8a",
"x86",
"x86_64"
],
"validAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
]
}

View File

@@ -0,0 +1,23 @@
{
"ndkHandlerSupportedAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"ndkHandlerDefaultAbis": [
"ARMEABI_V7A",
"ARM64_V8A",
"X86",
"X86_64"
],
"externalNativeBuildAbiFilters": [],
"ndkConfigAbiFilters": [
"armeabi-v7a",
"x86_64",
"x86",
"arm64-v8a"
],
"splitsFilterAbis": [],
"ideBuildOnlyTargetAbi": true
}

View File

@@ -0,0 +1,11 @@
{
"ndk": "/opt/android_sdk/ndk/21.3.6528147",
"revision": {
"mMajor": 21,
"mMinor": 3,
"mMicro": 6528147,
"mPreview": 0,
"mPrecision": "MICRO",
"mPreviewSeparator": " "
}
}

View File

@@ -0,0 +1,9 @@
{
"ndkVersionFromDsl": "21.3.6528147",
"sdkFolder": "/opt/android_sdk",
"sideBySideNdkFolderNames": [
"21.4.7075529",
"21.3.6528147",
"21.1.6352462"
]
}

View File

@@ -3,11 +3,11 @@
# This source code is licensed under the MIT license found in the # This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX_LIBRARY_WHITELIST", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "YOGA_ROOTS", "yoga_cxx_lib", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test", "yoga_prebuilt_cxx_library") load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID", "CXX", "CXX_LIBRARY_WHITELIST", "JNI_TARGET", "JSR_305_TARGET", "JUNIT_TARGET", "PROGUARD_ANNOTATIONS_TARGET", "SOLOADER_TARGET", "YOGA_ROOTS", "yoga_android_dep", "yoga_cxx_library", "yoga_dep", "yoga_java_binary", "yoga_java_library", "yoga_java_test", "yoga_prebuilt_cxx_library")
CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [ CXX_LIBRARY_WHITELIST_FOR_TESTS = CXX_LIBRARY_WHITELIST + [
yoga_cxx_lib("testutil:jni"), yoga_android_dep("testutil:jni"),
yoga_cxx_lib("testutil:testutil"), yoga_android_dep("testutil:testutil-jni"),
] ]
YOGA_JAVA_IMPLEMENTATION_FILES = [ YOGA_JAVA_IMPLEMENTATION_FILES = [
@@ -46,7 +46,7 @@ yoga_cxx_library(
"-Os", "-Os",
"-std=c++11", "-std=c++11",
], ],
platforms = ANDROID, platforms = (CXX, ANDROID),
preprocessor_flags = [ preprocessor_flags = [
"-DFBJNI_WITH_FAST_CALLS", "-DFBJNI_WITH_FAST_CALLS",
], ],
@@ -54,7 +54,7 @@ yoga_cxx_library(
visibility = ["PUBLIC"], visibility = ["PUBLIC"],
deps = [ deps = [
JNI_TARGET, JNI_TARGET,
yoga_dep(":yoga"), yoga_dep(":yoga-static"),
":ndklog", ":ndklog",
], ],
) )
@@ -71,7 +71,7 @@ yoga_java_library(
visibility = ["PUBLIC"], visibility = ["PUBLIC"],
deps = [ deps = [
JSR_305_TARGET, JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET, PROGUARD_ANNOTATIONS_TARGET,
], ],
) )
@@ -85,7 +85,7 @@ yoga_java_library(
":java-interface", ":java-interface",
":jni", ":jni",
JSR_305_TARGET, JSR_305_TARGET,
PROGRUARD_ANNOTATIONS_TARGET, PROGUARD_ANNOTATIONS_TARGET,
SOLOADER_TARGET, SOLOADER_TARGET,
], ],
) )
@@ -108,6 +108,7 @@ yoga_java_library(
yoga_java_test( yoga_java_test(
name = "tests", name = "tests",
srcs = glob(["tests/**/*.java"]), srcs = glob(["tests/**/*.java"]),
contacts = ["oncall+yoga@xmail.facebook.com"],
cxx_library_whitelist = CXX_LIBRARY_WHITELIST_FOR_TESTS, cxx_library_whitelist = CXX_LIBRARY_WHITELIST_FOR_TESTS,
use_cxx_libraries = True, use_cxx_libraries = True,
visibility = ["PUBLIC"], visibility = ["PUBLIC"],

View File

@@ -1,21 +1,17 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'
group = GROUP apply plugin: 'com.android.library'
version = VERSION_NAME
android { android {
compileSdkVersion rootProject.compileSdkVersion compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion buildToolsVersion rootProject.buildToolsVersion
ndkVersion rootProject.ndkVersion
defaultConfig { defaultConfig {
minSdkVersion rootProject.minSdkVersion minSdkVersion rootProject.minSdkVersion
@@ -35,7 +31,6 @@ android {
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path 'CMakeLists.txt' path 'CMakeLists.txt'
version '3.6.0-rc2'
} }
} }
@@ -58,32 +53,11 @@ android {
} }
dependencies { dependencies {
implementation 'com.google.code.findbugs:jsr305:3.0.1' implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation project(':yoga:proguard-annotations') implementation project(':yoga:proguard-annotations')
implementation 'com.facebook.soloader:soloader:0.5.1' implementation 'com.facebook.soloader:soloader:0.10.4'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation project(':testutil') testImplementation project(':testutil')
} }
task sourcesJar(type: Jar) { apply plugin: 'com.vanniktech.maven.publish'
classifier = 'source'
from android.sourceSets.main.java.srcDirs
}
task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
ext {
bintrayName = 'com.facebook.yoga:yoga'
}
apply from: rootProject.file('gradle/release.gradle')

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaAlign { public enum YogaAlign {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaDimension { public enum YogaDimension {

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaDirection { public enum YogaDirection {

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaDisplay { public enum YogaDisplay {

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaEdge { public enum YogaEdge {

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaExperimentalFeature { public enum YogaExperimentalFeature {

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaFlexDirection { public enum YogaFlexDirection {

View File

@@ -0,0 +1,35 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// @generated by enums.py
package com.facebook.yoga;
public enum YogaGutter {
COLUMN(0),
ROW(1),
ALL(2);
private final int mIntValue;
YogaGutter(int intValue) {
mIntValue = intValue;
}
public int intValue() {
return mIntValue;
}
public static YogaGutter fromInt(int value) {
switch (value) {
case 0: return COLUMN;
case 1: return ROW;
case 2: return ALL;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
}
}
}

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaJustify { public enum YogaJustify {
@@ -32,8 +34,7 @@ public enum YogaJustify {
case 2: return FLEX_END; case 2: return FLEX_END;
case 3: return SPACE_BETWEEN; case 3: return SPACE_BETWEEN;
case 4: return SPACE_AROUND; case 4: return SPACE_AROUND;
case 5: case 5: return SPACE_EVENLY;
return SPACE_EVENLY;
default: throw new IllegalArgumentException("Unknown enum value: " + value); default: throw new IllegalArgumentException("Unknown enum value: " + value);
} }
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.proguard.annotations.DoNotStrip;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.

View File

@@ -1,10 +1,12 @@
/* /*
* Copyright (c) Facebook, Inc. and its affiliates. * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* This source code is licensed under the MIT license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
// @generated by enums.py
package com.facebook.yoga; package com.facebook.yoga;
public enum YogaMeasureMode { public enum YogaMeasureMode {

Some files were not shown because too many files have changed in this diff Show More