From 55d614c4c27ff96db343ef0dfdd581addddba338 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:06:36 -0700 Subject: [PATCH 01/39] WIP --- .github/actions/setup-android/action.yml | 17 +++++++ .github/actions/setup-website/action.yml | 19 ++++++++ .github/workflows/ci.yml | 58 ------------------------ .github/workflows/publish-android.yml | 47 +++++++++++++++++++ .github/workflows/publish-website.yml | 26 +++++++++++ .github/workflows/release.yml | 32 ------------- .github/workflows/valiadate-android.yml | 38 ++++++++++++++++ .github/workflows/validate-website.yml | 12 +++++ README.md | 26 ++--------- build.gradle | 27 ----------- java/build.gradle | 4 +- scripts/publish-snapshot.sh | 21 --------- scripts/setup-keys.enc | 1 - 13 files changed, 166 insertions(+), 162 deletions(-) create mode 100644 .github/actions/setup-android/action.yml create mode 100644 .github/actions/setup-website/action.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish-android.yml create mode 100644 .github/workflows/publish-website.yml delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/valiadate-android.yml create mode 100644 .github/workflows/validate-website.yml delete mode 100755 scripts/publish-snapshot.sh delete mode 100644 scripts/setup-keys.enc diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml new file mode 100644 index 00000000..1e24cb23 --- /dev/null +++ b/.github/actions/setup-android/action.yml @@ -0,0 +1,17 @@ +name: Setup Android envirionment + +runs: + using: "composite" + steps: + - name: Install JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Install NDK 21 + shell: bash + run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} + + - name: Install Ninja + shell: bash + run: sudo apt-get install -y ninja-build diff --git a/.github/actions/setup-website/action.yml b/.github/actions/setup-website/action.yml new file mode 100644 index 00000000..465a93f1 --- /dev/null +++ b/.github/actions/setup-website/action.yml @@ -0,0 +1,19 @@ +name: Setup Website envirionment + +runs: + using: "composite" + steps: + - name: Install NodeJS 12 + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: yarn install + shell: bash + run: yarn install --frozen-lockfile + working-directory: website + + - name: yarn build + shell: bash + run: yarn build + working-directory: website diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 722d8a20..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -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 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml new file mode 100644 index 00000000..01dac41a --- /dev/null +++ b/.github/workflows/publish-android.yml @@ -0,0 +1,47 @@ +name: Publish Android artifacts + +on: + release: + types: + - created + workflow_dispatch: + inputs: + version: + description: 'Version to publish as' + required: true + +jobs: + publish: + name: Upload to Maven Central + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-android + + - name: Write GPG secret keyring + run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg + + - name: Update gradle.properties + workingDirectory: ./target + run: | + if [ -z "${{ inputs.version }}" ]; then + echo "VERSION_NAME=${{ inputs.version }}" >> gradle.properties + else + version = `echo "${{ github.ref }}" | sed -E 's/v(.+)/\1/'` + echo "VERSION_NAME=$version" >> gradle.properties + fi + echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> gradle.properties + echo "signing.keyId=${{ secrets.SIGNING_KEY_ID }}" >> gradle.properties + echo "signing.password=${{ secrets.SIGNING_PASSWORD }}" >> gradle.properties + echo "nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}" >> gradle.properties + echo "mavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties + + - name: Upload Android archives + workingDirectory: ./target + + run: ./gradlew :yoga:assembleRelease publish --info + + - name: Publish release + workingDirectory: ./target + run: ./gradlew closeAndReleaseRepository diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml new file mode 100644 index 00000000..2ae71ba2 --- /dev/null +++ b/.github/workflows/publish-website.yml @@ -0,0 +1,26 @@ +name: Publish Website artifcats + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + publish: + name: Push to GitHub Pages + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-website + + - 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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1231fb66..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,32 +0,0 @@ -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 diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml new file mode 100644 index 00000000..3ac8d8e3 --- /dev/null +++ b/.github/workflows/valiadate-android.yml @@ -0,0 +1,38 @@ +name: Android + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: Build (${{ matrix.mode }}) + runs-on: ubuntu-latest + strategy: + matrix: + mode: [Debug, Release] + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-android + + - name: Build + run: ./gradlew assemble${{ matrix.mode }} + + test: + name: Unit Tests (${{ matrix.mode }}) + runs-on: ubuntu-latest + strategy: + matrix: + mode: [Debug] + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-android + + - name: Build + run: ./gradlew assemble${{ matrix.mode }} + + - name: List + run: ls -R -l /home/runner/work/yoga/yoga/java + + - name: Run Java unit tests + run: ./gradlew :yoga:test${{ matrix.mode }}UnitTest --info diff --git a/.github/workflows/validate-website.yml b/.github/workflows/validate-website.yml new file mode 100644 index 00000000..e6e6fbfd --- /dev/null +++ b/.github/workflows/validate-website.yml @@ -0,0 +1,12 @@ +name: Website + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-website diff --git a/README.md b/README.md index d1d65542..dcb76a27 100644 --- a/README.md +++ b/README.md @@ -63,26 +63,8 @@ This will now only run the standalone webpack build upon install. ## Maintainer Release Guide -To publish a new release, follow these steps: +Release artifacts are published automatically when a new GitHub release is +created. The publishing workflows may also be executed manually, given a Git +Tag, to re-attempt publish. -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= -mavenCentralRepositoryPassword= - -# You can get the keyId (in GPG 1.4 format) by running `gpg1 --list-keys`. -signing.secretKeyRingFile= -signing.keyId= -signing.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! +NPM and NuGet packages are not currently published. diff --git a/build.gradle b/build.gradle index 4bffb4fd..ff43f4a7 100644 --- a/build.gradle +++ b/build.gradle @@ -37,33 +37,6 @@ ext { targetCompatibilityVersion = JavaVersion.VERSION_1_7 } -// If you have an idea on how to avoid this, please get in touch or -// answer https://stackoverflow.com/questions/43867014/how-to-use-the-gradle-ndk-build-to-compile-for-the-host-machine. -task copyNativeLibs(type: Copy, dependsOn: ':buckBuildNative') { - from "${rootDir}/buck-out/gen/java/tests#default,shared-library-symlink-tree/" - include '*.so' - include '*.dylib' - into "$buildDir/jniLibs" -} - -task buckBuildNative(type: Exec) { - workingDir rootDir - environment BUCKVERSION: 'last' - commandLine 'buck', 'build', '//java/...' -} - -allprojects { - afterEvaluate { - tasks.withType(Test) { - dependsOn copyNativeLibs - def libDir = "${rootDir}/build/jniLibs" - systemProperty 'java.library.path', libDir - environment 'LD_LIBRARY_PATH', libDir - environment 'DYLD_LIBRARY_PATH', libDir - } - } -} - task clean(type: Delete) { delete rootProject.buildDir } diff --git a/java/build.gradle b/java/build.gradle index c77068c3..2ee343b1 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -8,6 +8,8 @@ apply plugin: 'com.android.library' +// TODO Proguard consumers + android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -47,7 +49,7 @@ android { } test { - java.srcDirs 'tests' + java.srcDir 'tests' } } } diff --git a/scripts/publish-snapshot.sh b/scripts/publish-snapshot.sh deleted file mode 100755 index 236d8055..00000000 --- a/scripts/publish-snapshot.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# -# Deploy a SNAPSHOT JAR after every successful CI run To Sonatype. - -# -# 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 -e - -BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" -IS_SNAPSHOT="$(grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' "$BASEDIR/gradle.properties")" - -if [ "$IS_SNAPSHOT" == "" ]; then - echo >&2 "Skipping build. Given build doesn't appear to be a SNAPSHOT release." -else - env TERMINAL=dumb "$BASEDIR/gradlew" publish -fi diff --git a/scripts/setup-keys.enc b/scripts/setup-keys.enc deleted file mode 100644 index 89144cbf..00000000 --- a/scripts/setup-keys.enc +++ /dev/null @@ -1 +0,0 @@ -kþèçßÞ=+\Mòènýmq6©Pƒáq³Z<¦c%§Þãjô¾d«–îŠÐ(¿Š»ê9C7P`]×ùæ®#ûZŸ+¼™‡ê¹^ 7¾¹‹ôÙ*–³¬rç`LàA™1m°’0h¥n% vâù \ No newline at end of file -- 2.50.1.windows.1 From 6168ad818eb6cbb48aae253578c4fdae7cc57b49 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:26:16 -0700 Subject: [PATCH 02/39] Apple --- .github/actions/clang-format/action.yml | 14 +++++++++++++ .github/actions/setup-apple/action.yml | 9 +++++++++ .github/workflows/valiadate-android.yml | 20 ------------------ .github/workflows/valiadate-apple.yml | 27 +++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 .github/actions/clang-format/action.yml create mode 100644 .github/actions/setup-apple/action.yml create mode 100644 .github/workflows/valiadate-apple.yml diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml new file mode 100644 index 00000000..2f2bb01d --- /dev/null +++ b/.github/actions/clang-format/action.yml @@ -0,0 +1,14 @@ +name: Clang Format +inputs: + directory: + description: Directory to Lint + required: true + +runs: + using: "composite" + steps: + - name: clang-format ${{ inputs.directory }} + uses: jidicula/clang-format-action@v4.9.0 + with: + clang-format-version: '12' # This should be roughly in sync with Arcanist + check-path: ${{ inputs.directory }} diff --git a/.github/actions/setup-apple/action.yml b/.github/actions/setup-apple/action.yml new file mode 100644 index 00000000..6ef41f58 --- /dev/null +++ b/.github/actions/setup-apple/action.yml @@ -0,0 +1,9 @@ +name: Setup Apple envirionment + +runs: + using: "composite" + steps: + # TODO: This and Ruby should be versioned + - name: Install Cocoapods + shell: bash + run: sudo gem install cocoapods diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml index 3ac8d8e3..78716fa2 100644 --- a/.github/workflows/valiadate-android.yml +++ b/.github/workflows/valiadate-android.yml @@ -16,23 +16,3 @@ jobs: - name: Build run: ./gradlew assemble${{ matrix.mode }} - - test: - name: Unit Tests (${{ matrix.mode }}) - runs-on: ubuntu-latest - strategy: - matrix: - mode: [Debug] - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-android - - - name: Build - run: ./gradlew assemble${{ matrix.mode }} - - - name: List - run: ls -R -l /home/runner/work/yoga/yoga/java - - - name: Run Java unit tests - run: ./gradlew :yoga:test${{ matrix.mode }}UnitTest --info diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml new file mode 100644 index 00000000..47716a92 --- /dev/null +++ b/.github/workflows/valiadate-apple.yml @@ -0,0 +1,27 @@ +name: Apple + +on: [push, pull_request, workflow_dispatch] + +jobs: + lint-pods: + name: Lint Podspecs + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-apple + + - name: pod spec lint + run: pod spec lint --verbose + + clang-format: + name: Clang Format + runs-on: ubuntu-latest + + steps: + - name: clang-format + uses: ./.github/actions/clang-format + with: + directory: ./YogaKit -- 2.50.1.windows.1 From c3ac56e6ee185aa657b2dc6a8ec2180de1ec5519 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:32:23 -0700 Subject: [PATCH 03/39] cpp --- .github/workflows/valiadate-apple.yml | 14 ++++++++++++++ .github/workflows/valiadate-cpp.yml | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/valiadate-cpp.yml diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index 47716a92..8c640743 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -16,11 +16,25 @@ jobs: - name: pod spec lint run: pod spec lint --verbose + install-sample: + name: Install YogaKitSample + runs-on: macos-latest + + steps: + - name: Setup + uses: ./.github/actions/setup-apple + + - name: pod install + run: pod install + workingDirectory: ./YogaKit/YogaKitSample + clang-format: name: Clang Format runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - name: clang-format uses: ./.github/actions/clang-format with: diff --git a/.github/workflows/valiadate-cpp.yml b/.github/workflows/valiadate-cpp.yml new file mode 100644 index 00000000..6221fc08 --- /dev/null +++ b/.github/workflows/valiadate-cpp.yml @@ -0,0 +1,16 @@ +name: C++ + +on: [push, pull_request, workflow_dispatch] + +jobs: + clang-format: + name: Clang Format + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: clang-format + uses: ./.github/actions/clang-format + with: + directory: ./yoga -- 2.50.1.windows.1 From 018ebe3d37066b95c7f1807cdc938594e202ee66 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:40:52 -0700 Subject: [PATCH 04/39] format --- .github/actions/clang-format/action.yml | 13 ++++++++----- .github/actions/setup-website/action.yml | 5 ----- .github/workflows/publish-android.yml | 4 +++- .github/workflows/publish-website.yml | 8 +++++++- .github/workflows/validate-website.yml | 8 +++++++- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 2f2bb01d..9e8251b9 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -7,8 +7,11 @@ inputs: runs: using: "composite" steps: - - name: clang-format ${{ inputs.directory }} - uses: jidicula/clang-format-action@v4.9.0 - with: - clang-format-version: '12' # This should be roughly in sync with Arcanist - check-path: ${{ inputs.directory }} + - name: Install + shell: bash + run: sudo apt install clang-format-12 # This should be roughly in sync with Arcanist + + - name: clang-format + shell: bash + run: clang-format-12 + workingDirectory: ${{ inputs.directory }} diff --git a/.github/actions/setup-website/action.yml b/.github/actions/setup-website/action.yml index 465a93f1..d7cfe42d 100644 --- a/.github/actions/setup-website/action.yml +++ b/.github/actions/setup-website/action.yml @@ -12,8 +12,3 @@ runs: shell: bash run: yarn install --frozen-lockfile working-directory: website - - - name: yarn build - shell: bash - run: yarn build - working-directory: website diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 01dac41a..2f995302 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -17,7 +17,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-android + + - name: Setup + uses: ./.github/actions/setup-android - name: Write GPG secret keyring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 2ae71ba2..5443065d 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -13,7 +13,13 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-website + + - name: Setup + uses: ./.github/actions/setup-website + + - name: yarn build + run: yarn build + working-directory: website - uses: peaceiris/actions-gh-pages@v3 with: diff --git a/.github/workflows/validate-website.yml b/.github/workflows/validate-website.yml index e6e6fbfd..f94c7cd2 100644 --- a/.github/workflows/validate-website.yml +++ b/.github/workflows/validate-website.yml @@ -9,4 +9,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-website + + - name: Setup + uses: ./.github/actions/setup-website + + - name: yarn build + run: yarn build + working-directory: website -- 2.50.1.windows.1 From 7fc3a341fbcd77a833b50659adf1582e590eae34 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:43:30 -0700 Subject: [PATCH 05/39] wd --- .github/actions/clang-format/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 9e8251b9..7f3c3da1 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -13,5 +13,4 @@ runs: - name: clang-format shell: bash - run: clang-format-12 - workingDirectory: ${{ inputs.directory }} + run: clang-format-12 ${{ inputs.directory }} -- 2.50.1.windows.1 From 1e0971e9863a367a4c3e146c7b772f0ebae967c2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:44:37 -0700 Subject: [PATCH 06/39] workingDirectory --- .github/workflows/valiadate-apple.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index 8c640743..5e2da56c 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -25,8 +25,8 @@ jobs: uses: ./.github/actions/setup-apple - name: pod install - run: pod install workingDirectory: ./YogaKit/YogaKitSample + run: pod install clang-format: name: Clang Format -- 2.50.1.windows.1 From 201dc80cf17ce5a210f87a31872f603e35519aca Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:46:58 -0700 Subject: [PATCH 07/39] hyphen --- .github/actions/clang-format/action.yml | 3 ++- .github/workflows/publish-android.yml | 6 +++--- .github/workflows/valiadate-apple.yml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 7f3c3da1..f800e776 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -12,5 +12,6 @@ runs: run: sudo apt install clang-format-12 # This should be roughly in sync with Arcanist - name: clang-format + working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-12 ${{ inputs.directory }} + run: clang-format-12 . diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 2f995302..9427caa3 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -25,7 +25,7 @@ jobs: run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties - workingDirectory: ./target + working-directory: ./target run: | if [ -z "${{ inputs.version }}" ]; then echo "VERSION_NAME=${{ inputs.version }}" >> gradle.properties @@ -40,10 +40,10 @@ jobs: echo "mavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties - name: Upload Android archives - workingDirectory: ./target + working-directory: ./target run: ./gradlew :yoga:assembleRelease publish --info - name: Publish release - workingDirectory: ./target + working-directory: ./target run: ./gradlew closeAndReleaseRepository diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index 5e2da56c..ae5c01ae 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -25,7 +25,7 @@ jobs: uses: ./.github/actions/setup-apple - name: pod install - workingDirectory: ./YogaKit/YogaKitSample + working-directory: ./YogaKit/YogaKitSample run: pod install clang-format: -- 2.50.1.windows.1 From ce1446e3bf959547bad7c2af24cb5f9fa1a7c818 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:48:19 -0700 Subject: [PATCH 08/39] . --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index f800e776..bda8de2d 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -14,4 +14,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-12 . + run: clang-format-12 -- 2.50.1.windows.1 From 931cd34073342d2ff8af2df3cafc65466295a542 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:49:34 -0700 Subject: [PATCH 09/39] Add formating error --- yoga/Yoga.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index a5c70b47..ad2645c6 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -21,7 +21,7 @@ #include /* define fmaxf if < VC12 */ -#if _MSC_VER < 1800 +#if _MSC_VER < 1800 __forceinline const float fmaxf(const float a, const float b) { return (a > b) ? a : b; } -- 2.50.1.windows.1 From 8c8ea5e6f0f472a3e5a986f3cb392aeb99768829 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 07:55:13 -0700 Subject: [PATCH 10/39] . --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index bda8de2d..5cbb8323 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -14,4 +14,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-12 + run: clang-format-12 **/*(.h|.cpp|.m|.mm) -- 2.50.1.windows.1 From a6016c9567e575643045816f2accf321ed7bffa0 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:00:27 -0700 Subject: [PATCH 11/39] google-java-format --- .github/actions/clang-format/action.yml | 2 +- .github/workflows/valiadate-android.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 5cbb8323..a33e410f 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -14,4 +14,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-12 **/*(.h|.cpp|.m|.mm) + run: clang-format-12 **/*.h **/*.cpp **/*.m **/*.mm diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml index 78716fa2..db721961 100644 --- a/.github/workflows/valiadate-android.yml +++ b/.github/workflows/valiadate-android.yml @@ -16,3 +16,13 @@ jobs: - name: Build run: ./gradlew assemble${{ matrix.mode }} + + format: + name: Build (${{ matrix.mode }}) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: google-java-format + run: npx --yes google-java-format -i --glob=java/**/*.java -- 2.50.1.windows.1 From bb6e6cbf568dcb3e13251539d6498293f2802040 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:06:45 -0700 Subject: [PATCH 12/39] . --- .github/actions/clang-format/action.yml | 8 ++++++-- .github/workflows/valiadate-android.yml | 2 +- .github/workflows/valiadate-apple.yml | 12 ------------ .github/workflows/valiadate-cpp.yml | 2 +- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index a33e410f..1ddf3a15 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -3,15 +3,19 @@ inputs: directory: description: Directory to Lint required: true + version: + description: LLVM version to use # Should be kept roughly in sync with arcanist + required: false + default: 12 runs: using: "composite" steps: - name: Install shell: bash - run: sudo apt install clang-format-12 # This should be roughly in sync with Arcanist + run: sudo apt install clang-format-${{ inputs.version }} - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-12 **/*.h **/*.cpp **/*.m **/*.mm + run: clang-format-${{ inputs.version }} --Werror **/*.h **/*.cpp # Yoga's config doesn't support ObjC diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml index db721961..913f5090 100644 --- a/.github/workflows/valiadate-android.yml +++ b/.github/workflows/valiadate-android.yml @@ -18,7 +18,7 @@ jobs: run: ./gradlew assemble${{ matrix.mode }} format: - name: Build (${{ matrix.mode }}) + name: Format runs-on: ubuntu-latest steps: diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index ae5c01ae..d14486bc 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -27,15 +27,3 @@ jobs: - name: pod install working-directory: ./YogaKit/YogaKitSample run: pod install - - clang-format: - name: Clang Format - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: clang-format - uses: ./.github/actions/clang-format - with: - directory: ./YogaKit diff --git a/.github/workflows/valiadate-cpp.yml b/.github/workflows/valiadate-cpp.yml index 6221fc08..3214ffad 100644 --- a/.github/workflows/valiadate-cpp.yml +++ b/.github/workflows/valiadate-cpp.yml @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch] jobs: clang-format: - name: Clang Format + name: Format runs-on: ubuntu-latest steps: -- 2.50.1.windows.1 From ff5d29230e902c9987dd41167b9e2ed32eb6a57c Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:09:29 -0700 Subject: [PATCH 13/39] --dry-run --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 1ddf3a15..d65a3bae 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -18,4 +18,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-${{ inputs.version }} --Werror **/*.h **/*.cpp # Yoga's config doesn't support ObjC + run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.h **/*.cpp # Yoga's config doesn't support ObjC -- 2.50.1.windows.1 From b34f44f4eceac84b64307c5db6fdd903f5f75d66 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:13:23 -0700 Subject: [PATCH 14/39] mess up the formatting --- yoga/Yoga.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index ad2645c6..a0f7d3a7 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -21,7 +21,7 @@ #include /* define fmaxf if < VC12 */ -#if _MSC_VER < 1800 +#if _MSC_VER < 1800 __forceinline const float fmaxf(const float a, const float b) { return (a > b) ? a : b; } @@ -340,8 +340,8 @@ YOGA_EXPORT bool YGNodeIsReferenceBaseline(YGNodeRef node) { YOGA_EXPORT void YGNodeInsertChild( const YGNodeRef owner, - const YGNodeRef child, - const uint32_t index) { + const YGNodeRef child, + const uint32_t index) { YGAssertWithNode( owner, child->getOwner() == nullptr, @@ -361,9 +361,14 @@ YOGA_EXPORT void YGNodeSwapChild( const YGNodeRef owner, const YGNodeRef child, const uint32_t index) { + + + + + owner->replaceChild(child, index); child->setOwner(owner); -} + } YOGA_EXPORT void YGNodeRemoveChild( const YGNodeRef owner, -- 2.50.1.windows.1 From a23699d739230fe445c0793ebb23d3ca96100ebe Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:17:10 -0700 Subject: [PATCH 15/39] wut --- .github/workflows/valiadate-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/valiadate-cpp.yml b/.github/workflows/valiadate-cpp.yml index 3214ffad..56f01b85 100644 --- a/.github/workflows/valiadate-cpp.yml +++ b/.github/workflows/valiadate-cpp.yml @@ -13,4 +13,4 @@ jobs: - name: clang-format uses: ./.github/actions/clang-format with: - directory: ./yoga + directory: yoga -- 2.50.1.windows.1 From e4a306b4d782837a955cb29ad55b33a8b665307e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:21:52 -0700 Subject: [PATCH 16/39] yoga.cpp --- .github/actions/clang-format/action.yml | 4 ++-- .github/workflows/valiadate-apple.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index d65a3bae..3c82166e 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -13,9 +13,9 @@ runs: steps: - name: Install shell: bash - run: sudo apt install clang-format-${{ inputs.version }} + run: sudo apt-get install clang-format-${{ inputs.version }} - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.h **/*.cpp # Yoga's config doesn't support ObjC + run: clang-format-${{ inputs.version }} --dry-run --Werror yoga.cpp # Yoga's config doesn't support ObjC diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index d14486bc..24ad6705 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -21,6 +21,8 @@ jobs: runs-on: macos-latest steps: + - uses: actions/checkout@v3 + - name: Setup uses: ./.github/actions/setup-apple -- 2.50.1.windows.1 From 2a8e562791ba89497cfc0d62154894e51ae49054 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:23:01 -0700 Subject: [PATCH 17/39] case --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 3c82166e..65d3de80 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -18,4 +18,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-${{ inputs.version }} --dry-run --Werror yoga.cpp # Yoga's config doesn't support ObjC + run: clang-format-${{ inputs.version }} --dry-run --Werror Yoga.cpp # Yoga's config doesn't support ObjC -- 2.50.1.windows.1 From 54eed5d7413251cf92168cf910157bb08e257ddd Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:25:42 -0700 Subject: [PATCH 18/39] glob --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 65d3de80..c641ad33 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -18,4 +18,4 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-${{ inputs.version }} --dry-run --Werror Yoga.cpp # Yoga's config doesn't support ObjC + run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp # Yoga's config doesn't support ObjC -- 2.50.1.windows.1 From b288c1491454b0ffecee2a3957e8e79c53e8acae Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:27:31 -0700 Subject: [PATCH 19/39] globstar --- .github/actions/clang-format/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index c641ad33..bc6c7019 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -18,4 +18,6 @@ runs: - name: clang-format working-directory: ${{ inputs.directory }} shell: bash - run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp # Yoga's config doesn't support ObjC + run: | + shopt -s globstar + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp -- 2.50.1.windows.1 From 3067175b6410b9c31d268f9d901a2fc069d4b44a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:29:35 -0700 Subject: [PATCH 20/39] h --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index bc6c7019..93406001 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -20,4 +20,4 @@ runs: shell: bash run: | shopt -s globstar - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h -- 2.50.1.windows.1 From 47d34bd5970c1355f3ccf6d3b03e2267d5b3619e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:31:33 -0700 Subject: [PATCH 21/39] clang-format off --- enums.py | 2 +- yoga/YGEnums.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/enums.py b/enums.py index 8e37c7c7..6d3fd287 100644 --- a/enums.py +++ b/enums.py @@ -107,7 +107,7 @@ root = os.path.dirname(os.path.abspath(__file__)) with open(root + "/yoga/YGEnums.h", "w") as f: f.write(get_license("cpp")) f.write("#pragma once\n") - f.write("// clang-format: off\n\n") + f.write("// clang-format off\n\n") f.write('#include "YGMacros.h"\n\n') f.write('YG_EXTERN_C_BEGIN\n\n') diff --git a/yoga/YGEnums.h b/yoga/YGEnums.h index 8faec2eb..d9d94e16 100644 --- a/yoga/YGEnums.h +++ b/yoga/YGEnums.h @@ -8,7 +8,7 @@ // @generated by enums.py #pragma once -// clang-format: off +// clang-format off #include "YGMacros.h" -- 2.50.1.windows.1 From a0ad0ed17a0fa01bde8ba30d495d2d041ff90224 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:35:52 -0700 Subject: [PATCH 22/39] Fix formatting --- .github/workflows/valiadate-android.yml | 4 +++- yoga/Yoga.cpp | 11 +++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml index 913f5090..a6ef0120 100644 --- a/.github/workflows/valiadate-android.yml +++ b/.github/workflows/valiadate-android.yml @@ -12,7 +12,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-android + + - name: Setup + uses: ./.github/actions/setup-android - name: Build run: ./gradlew assemble${{ matrix.mode }} diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index a0f7d3a7..a5c70b47 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -340,8 +340,8 @@ YOGA_EXPORT bool YGNodeIsReferenceBaseline(YGNodeRef node) { YOGA_EXPORT void YGNodeInsertChild( const YGNodeRef owner, - const YGNodeRef child, - const uint32_t index) { + const YGNodeRef child, + const uint32_t index) { YGAssertWithNode( owner, child->getOwner() == nullptr, @@ -361,14 +361,9 @@ YOGA_EXPORT void YGNodeSwapChild( const YGNodeRef owner, const YGNodeRef child, const uint32_t index) { - - - - - owner->replaceChild(child, index); child->setOwner(owner); - } +} YOGA_EXPORT void YGNodeRemoveChild( const YGNodeRef owner, -- 2.50.1.windows.1 From 5a9ca30d36432678b16761f0911061fb7e71e9e2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:40:29 -0700 Subject: [PATCH 23/39] hmm --- .github/workflows/valiadate-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/valiadate-cpp.yml b/.github/workflows/valiadate-cpp.yml index 56f01b85..3214ffad 100644 --- a/.github/workflows/valiadate-cpp.yml +++ b/.github/workflows/valiadate-cpp.yml @@ -13,4 +13,4 @@ jobs: - name: clang-format uses: ./.github/actions/clang-format with: - directory: yoga + directory: ./yoga -- 2.50.1.windows.1 From 114e267d8dd63cf98b9588c6239dac83e3895497 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 08:42:53 -0700 Subject: [PATCH 24/39] cpp --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 93406001..bc6c7019 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -20,4 +20,4 @@ runs: shell: bash run: | shopt -s globstar - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp -- 2.50.1.windows.1 From e0b243601e9cb7ad45c86321db421d32d9628668 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:07:55 -0700 Subject: [PATCH 25/39] ObjC --- yoga/.clang-format | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 yoga/.clang-format diff --git a/yoga/.clang-format b/yoga/.clang-format new file mode 100644 index 00000000..47b3b29b --- /dev/null +++ b/yoga/.clang-format @@ -0,0 +1,4 @@ +Language: ObjC + +# Yoga enums are conditionally compiled to NS_ENUM, forcing YGMacros.h to be interpreted as Objective C. +DisableFormat: true -- 2.50.1.windows.1 From 46a170fb71cc97394675183936f341898e3bb180 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:08:07 -0700 Subject: [PATCH 26/39] ObjC --- .clang-format | 112 ++++++++++++++++++++++++ .github/actions/clang-format/action.yml | 4 +- .github/workflows/valiadate-apple.yml | 12 +++ 3 files changed, 126 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 7bb07207..d64a4072 100644 --- a/.clang-format +++ b/.clang-format @@ -54,3 +54,115 @@ SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 Standard: Cpp11 UseTab: Never +--- +Language: ObjC +AccessModifierOffset: -1 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: false +AlignConsecutiveBitFields: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: DontAlign +AlignTrailingComments: false +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortEnumsOnASingleLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: false +ColumnLimit: 80 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DeriveLineEnding: true +DerivePointerAlignment: false +DisableFormat: false +FixNamespaceComments: true +ForEachMacros: + - FOR_EACH + - FOR_EACH_R + - FOR_EACH_RANGE +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^<.*\.h(pp)?>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IndentCaseLabels: true +IndentCaseBlocks: false +IndentGotoLabels: true +IndentPPDirectives: None +IndentExternBlock: AfterExternBlock +IndentWidth: 2 +IndentWrappedFunctionNames: false +InsertTrailingCommas: None +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Left +ReflowComments: true +SortIncludes: true +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpaceBeforeSquareBrackets: false +Standard: Latest +TabWidth: 8 +UseCRLF: false +UseTab: Never +... diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index bc6c7019..6b71b079 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -19,5 +19,5 @@ runs: working-directory: ${{ inputs.directory }} shell: bash run: | - shopt -s globstar - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp + shopt -s extglob + clang-format-${{ inputs.version }} --dry-run --Werror **/*(.cpp|.h|.m|.mm) diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index 24ad6705..b92866a7 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -29,3 +29,15 @@ jobs: - name: pod install working-directory: ./YogaKit/YogaKitSample run: pod install + + clang-format: + name: Clang Format + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: clang-format + uses: ./.github/actions/clang-format + with: + directory: ./YogaKit -- 2.50.1.windows.1 From 2c819bc05068dd0bfc181d785d2438c5cc9834c4 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:10:29 -0700 Subject: [PATCH 27/39] globstar --- .github/actions/clang-format/action.yml | 4 ++-- .github/workflows/valiadate-apple.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 6b71b079..64f3bed0 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -19,5 +19,5 @@ runs: working-directory: ${{ inputs.directory }} shell: bash run: | - shopt -s extglob - clang-format-${{ inputs.version }} --dry-run --Werror **/*(.cpp|.h|.m|.mm) + shopt -s globstar + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index b92866a7..d9d6ae82 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -31,7 +31,7 @@ jobs: run: pod install clang-format: - name: Clang Format + name: Format runs-on: ubuntu-latest steps: -- 2.50.1.windows.1 From 8bbc40c2b656903287181706402a7b2c1d6fd269 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:14:30 -0700 Subject: [PATCH 28/39] nullglob --- .github/actions/clang-format/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 64f3bed0..6e0e50ad 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -20,4 +20,5 @@ runs: shell: bash run: | shopt -s globstar - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm + shopt -s nullglob + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*. **/*.m **/*.mm -- 2.50.1.windows.1 From b6344224e22dec6d50d58db2397fd56822f65701 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:15:47 -0700 Subject: [PATCH 29/39] h --- .github/actions/clang-format/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index 6e0e50ad..f968c225 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -21,4 +21,4 @@ runs: run: | shopt -s globstar shopt -s nullglob - clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*. **/*.m **/*.mm + clang-format-${{ inputs.version }} --dry-run --Werror **/*.cpp **/*.h **/*.m **/*.mm -- 2.50.1.windows.1 From 8ad58051ba73a1d4ddf809c225719424a55cc60c Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:20:52 -0700 Subject: [PATCH 30/39] matrix --- .github/workflows/valiadate-apple.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index d9d6ae82..e6fa98c8 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -5,6 +5,7 @@ on: [push, pull_request, workflow_dispatch] jobs: lint-pods: name: Lint Podspecs + if: ${{ false }} # Apple Build is Broken runs-on: macos-latest steps: @@ -16,9 +17,13 @@ jobs: - name: pod spec lint run: pod spec lint --verbose - install-sample: - name: Install YogaKitSample + build-sample: + name: Build (${{ matrix.mode }}) + if: ${{ false }} # Apple Build is Broken runs-on: macos-latest + strategy: + matrix: + mode: [Debug, Release] steps: - uses: actions/checkout@v3 @@ -30,6 +35,8 @@ jobs: working-directory: ./YogaKit/YogaKitSample run: pod install + # TODO: xcodebuild + clang-format: name: Format runs-on: ubuntu-latest -- 2.50.1.windows.1 From 17de7372848c30f0920639971b45e54482167c9a Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 09:39:16 -0700 Subject: [PATCH 31/39] . --- .github/workflows/publish-android.yml | 10 ---------- java/build.gradle | 6 ------ yoga/.clang-format | 4 ---- 3 files changed, 20 deletions(-) delete mode 100644 yoga/.clang-format diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 9427caa3..524304de 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -25,14 +25,7 @@ jobs: run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties - working-directory: ./target run: | - if [ -z "${{ inputs.version }}" ]; then - echo "VERSION_NAME=${{ inputs.version }}" >> gradle.properties - else - version = `echo "${{ github.ref }}" | sed -E 's/v(.+)/\1/'` - echo "VERSION_NAME=$version" >> gradle.properties - fi echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> gradle.properties echo "signing.keyId=${{ secrets.SIGNING_KEY_ID }}" >> gradle.properties echo "signing.password=${{ secrets.SIGNING_PASSWORD }}" >> gradle.properties @@ -40,10 +33,7 @@ jobs: echo "mavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties - name: Upload Android archives - working-directory: ./target - run: ./gradlew :yoga:assembleRelease publish --info - name: Publish release - working-directory: ./target run: ./gradlew closeAndReleaseRepository diff --git a/java/build.gradle b/java/build.gradle index 2ee343b1..1672a9ea 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -8,8 +8,6 @@ apply plugin: 'com.android.library' -// TODO Proguard consumers - android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -47,10 +45,6 @@ android { manifest.srcFile 'AndroidManifest.xml' res.srcDirs = ['res'] } - - test { - java.srcDir 'tests' - } } } diff --git a/yoga/.clang-format b/yoga/.clang-format deleted file mode 100644 index 47b3b29b..00000000 --- a/yoga/.clang-format +++ /dev/null @@ -1,4 +0,0 @@ -Language: ObjC - -# Yoga enums are conditionally compiled to NS_ENUM, forcing YGMacros.h to be interpreted as Objective C. -DisableFormat: true -- 2.50.1.windows.1 From edd1e26e820f6e6feba7e17d2640b92bf11aa681 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 14:26:13 -0700 Subject: [PATCH 32/39] Apply suggestions from code review --- .github/actions/clang-format/action.yml | 2 +- .github/workflows/valiadate-android.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/clang-format/action.yml b/.github/actions/clang-format/action.yml index f968c225..a0d52af2 100644 --- a/.github/actions/clang-format/action.yml +++ b/.github/actions/clang-format/action.yml @@ -13,7 +13,7 @@ runs: steps: - name: Install shell: bash - run: sudo apt-get install clang-format-${{ inputs.version }} + run: sudo apt-get install -y clang-format-${{ inputs.version }} - name: clang-format working-directory: ${{ inputs.directory }} diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/valiadate-android.yml index a6ef0120..55b07c5b 100644 --- a/.github/workflows/valiadate-android.yml +++ b/.github/workflows/valiadate-android.yml @@ -27,4 +27,4 @@ jobs: - uses: actions/checkout@v3 - name: google-java-format - run: npx --yes google-java-format -i --glob=java/**/*.java + run: npx --yes google-java-format --set-exit-if-changed --dry-run --glob=java/**/*.java -- 2.50.1.windows.1 From 4dad34dcca43e43fbdc8d1924335e82d231c738d Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 14 Oct 2022 14:34:08 -0700 Subject: [PATCH 33/39] Update valiadate-apple.yml --- .github/workflows/valiadate-apple.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/valiadate-apple.yml index e6fa98c8..a474c17f 100644 --- a/.github/workflows/valiadate-apple.yml +++ b/.github/workflows/valiadate-apple.yml @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch] jobs: lint-pods: - name: Lint Podspecs + name: Lint if: ${{ false }} # Apple Build is Broken runs-on: macos-latest -- 2.50.1.windows.1 From 77e1637caa7f182c17381810e892f97402e54cb0 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:06:18 -0700 Subject: [PATCH 34/39] rename --- .github/workflows/{valiadate-android.yml => validate-android.yml} | 0 .github/workflows/{valiadate-apple.yml => validate-apple.yml} | 0 .github/workflows/{valiadate-cpp.yml => validate-cpp.yml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{valiadate-android.yml => validate-android.yml} (100%) rename .github/workflows/{valiadate-apple.yml => validate-apple.yml} (100%) rename .github/workflows/{valiadate-cpp.yml => validate-cpp.yml} (100%) diff --git a/.github/workflows/valiadate-android.yml b/.github/workflows/validate-android.yml similarity index 100% rename from .github/workflows/valiadate-android.yml rename to .github/workflows/validate-android.yml diff --git a/.github/workflows/valiadate-apple.yml b/.github/workflows/validate-apple.yml similarity index 100% rename from .github/workflows/valiadate-apple.yml rename to .github/workflows/validate-apple.yml diff --git a/.github/workflows/valiadate-cpp.yml b/.github/workflows/validate-cpp.yml similarity index 100% rename from .github/workflows/valiadate-cpp.yml rename to .github/workflows/validate-cpp.yml -- 2.50.1.windows.1 From 27c98103dd4250d76d7080df046c5f0744d30775 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:10:49 -0700 Subject: [PATCH 35/39] No Ninja --- .github/actions/setup-android/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index 1e24cb23..c09e0e4b 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -12,6 +12,6 @@ runs: shell: bash run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} - - name: Install Ninja - shell: bash - run: sudo apt-get install -y ninja-build + # - name: Install Ninja + # shell: bash + # run: sudo apt-get install -y ninja-build -- 2.50.1.windows.1 From 6e70e3fa3151e37c465796bfc5f1641f8573f61e Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:20:14 -0700 Subject: [PATCH 36/39] Remove Java formatting --- .github/workflows/validate-android.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/validate-android.yml b/.github/workflows/validate-android.yml index 55b07c5b..014921c0 100644 --- a/.github/workflows/validate-android.yml +++ b/.github/workflows/validate-android.yml @@ -18,13 +18,3 @@ jobs: - name: Build run: ./gradlew assemble${{ matrix.mode }} - - format: - name: Format - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: google-java-format - run: npx --yes google-java-format --set-exit-if-changed --dry-run --glob=java/**/*.java -- 2.50.1.windows.1 From 0d70f0fd31f1661fb8b0c835f54387e1711e72b2 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:23:11 -0700 Subject: [PATCH 37/39] Remove separate Ninja Installation --- .github/actions/setup-android/action.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/actions/setup-android/action.yml b/.github/actions/setup-android/action.yml index c09e0e4b..c2666453 100644 --- a/.github/actions/setup-android/action.yml +++ b/.github/actions/setup-android/action.yml @@ -11,7 +11,3 @@ runs: - name: Install NDK 21 shell: bash run: echo "y" | /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} - - # - name: Install Ninja - # shell: bash - # run: sudo apt-get install -y ninja-build -- 2.50.1.windows.1 From b4252b49676d08bb346f2888c95a3f82fbf89cd7 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:55:41 -0700 Subject: [PATCH 38/39] In memory secrets --- .github/workflows/publish-android.yml | 28 +++++++++++---------------- .github/workflows/publish-website.yml | 4 ++-- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 524304de..27e30e9f 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -1,4 +1,4 @@ -name: Publish Android artifacts +name: Android on: release: @@ -12,7 +12,7 @@ on: jobs: publish: - name: Upload to Maven Central + name: Publish to Maven Central runs-on: ubuntu-latest steps: @@ -21,19 +21,13 @@ jobs: - name: Setup uses: ./.github/actions/setup-android - - name: Write GPG secret keyring - run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - - - name: Update gradle.properties + - name: Publish and release run: | - echo "signing.secretKeyRingFile=/tmp/secring.gpg" >> gradle.properties - echo "signing.keyId=${{ secrets.SIGNING_KEY_ID }}" >> gradle.properties - echo "signing.password=${{ secrets.SIGNING_PASSWORD }}" >> gradle.properties - echo "nmavenCentralPassword=${{ secrets.SONATYPE_NEXUS_PASSWORD }}" >> gradle.properties - echo "mavenCentralUsername=${{ secrets.SONATYPE_NEXUS_USERNAME }}" >> gradle.properties - - - name: Upload Android archives - run: ./gradlew :yoga:assembleRelease publish --info - - - name: Publish release - run: ./gradlew closeAndReleaseRepository + ./gradlew :yoga:assembleRelease publish --info + ./gradlew closeAndReleaseRepository + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 5443065d..78b36798 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -1,4 +1,4 @@ -name: Publish Website artifcats +name: Website on: push: @@ -8,7 +8,7 @@ on: jobs: publish: - name: Push to GitHub Pages + name: Publish to GitHub Pages runs-on: ubuntu-latest steps: -- 2.50.1.windows.1 From 30fedcff76f2a7ddb7be27586462c7a87a866d47 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 17 Oct 2022 14:57:58 -0700 Subject: [PATCH 39/39] No version stamping yet --- .github/workflows/publish-android.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index 27e30e9f..16f6d4e4 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -5,10 +5,6 @@ on: types: - created workflow_dispatch: - inputs: - version: - description: 'Version to publish as' - required: true jobs: publish: -- 2.50.1.windows.1