diff --git a/.cargo/config.toml b/.cargo/config.toml index 74f45c08..da2da23b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,6 +1,4 @@ # make the default target the lib target -[alias] -b = "post build" [target.armv7-unknown-linux-gnueabihf] linker = "arm-linux-gnueabihf-gcc" [target.aarch64-unknown-linux-gnu] diff --git a/.github/actions/build-plugin/action.yml b/.github/actions/build-plugin/action.yml index 1fc9f8b3..91fea27f 100644 --- a/.github/actions/build-plugin/action.yml +++ b/.github/actions/build-plugin/action.yml @@ -6,18 +6,11 @@ inputs: required: true default: '' description: Rust target platform. - extra_flags: - required: false - default: '' - description: Rust extra flags. - features: - required: false - default: '' - description: simd-nightly,simd-stable,parallel,enhanced-determinism runs: using: composite steps: + - uses: extractions/setup-just@v3 - name: Update Rust shell: sh run: | @@ -26,33 +19,28 @@ runs: shell: sh run: | rustc --print=target-list - - name: Rust Add target + - name: Add additional arm64 target for macOS shell: sh + if: ${{ inputs.arch == 'x86_64-apple-darwin'}} run: | - rustup target add ${{ inputs.arch }} - #--features="${{ inputs.features }}" --no-default-features - - name: Build + rustup target add aarch64-apple-darwin + - name: Rust add current target shell: sh run: | - cargo build --target=${{ inputs.arch }} --release ${{ inputs.extra_flags}} - - name: Copy to release + rustup target add ${{ inputs.arch }} + - name: Build for Windows and Linux shell: sh + if: ${{ inputs.arch != 'x86_64-apple-darwin'}} run: | - mkdir -p target/release - rm -rf target/release - cp -rf target/${{ inputs.arch }}/release target/release - - name: Build Rapier Macos Universal + just build-patchwork release ${{ inputs.arch }} + - name: Build for Mac shell: sh - # we already built for x86_64-apple-darwin for mac, now build arm64 if: ${{ inputs.arch == 'x86_64-apple-darwin'}} run: | - mkdir -p target/release - rustup target add aarch64-apple-darwin - cargo build --target=aarch64-apple-darwin --release - lipo -create -output target/release/libpatchwork_rust_core.dylib target/aarch64-apple-darwin/release/libpatchwork_rust_core.dylib target/x86_64-apple-darwin/release/libpatchwork_rust_core.dylib - - name: Move Static Libs macOS + just build-patchwork release "all-apple-darwin" + - name: Copy to release shell: sh - if: ${{ inputs.arch == 'x86_64-apple-darwin'}} run: | - mv target/x86_64-apple-darwin/release/libpatchwork_rust_core.a target/release/libpatchwork_rust_core.x86_64.a - mv target/aarch64-apple-darwin/release/libpatchwork_rust_core.a target/release/libpatchwork_rust_core.arm64.a + mkdir -p target/release + rm -rf target/release + cp -rf target/${{ inputs.arch }}/release target/release diff --git a/.github/workflows/all_editor_builds.yml b/.github/workflows/all_editor_builds.yml index 4763efae..bcba421b 100644 --- a/.github/workflows/all_editor_builds.yml +++ b/.github/workflows/all_editor_builds.yml @@ -1,17 +1,11 @@ -name: Build Editor All Platforms +name: ๐Ÿค– Build Godot for All Platforms on: workflow_call: # Global Settings # SCONS_CACHE for windows must be set in the build environment env: - GODOT_REPOSITORY: godotengine/godot - GODOT_BASE_BRANCH: master - # Change Developers.md too - GODOT_MAIN_SYNC_REF: bb92a4c8e27e30cdec05ab6d540d724b9b3cfb72 SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes module_patchwork_editor_enabled=yes - SCONSFLAGS_TEMPLATE: no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no - SCONS_CACHE_MSVC_CONFIG: true concurrency: group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}} @@ -19,14 +13,13 @@ concurrency: jobs: build: - # Windows 10 with latest image runs-on: ${{ matrix.os }} name: ${{ matrix.name }} strategy: fail-fast: false matrix: include: - - name: "Windows Editor" + - name: "๐ŸชŸ Build Godot for Windows" os: "windows-latest" id: windows-editor platform: windows @@ -34,7 +27,7 @@ jobs: sconsflags: tests=yes debug_symbols=yes bin: ./bin/godot.windows.editor.x86_64.exe - - name: "๐Ÿง Linux Editor" + - name: "๐Ÿง Build Godot for Linux" os: "ubuntu-22.04" id: linux-editor platform: linux @@ -43,7 +36,7 @@ jobs: sconsflags-template: optimize=size use_lto=yes debug_symbols=no bin: ./bin/godot.linuxbsd.editor.x86_64 - - name: "๐ŸŽ macOS Editor" + - name: "๐ŸŽ Build Godot for macOS" os: "macos-14" id: macos-editor platform: macos @@ -52,22 +45,38 @@ jobs: bin: ./bin/godot.macos.editor.arm64 steps: - - name: checkout-godot + # Checkout patchwork to tmp/ + - name: Checkout patchwork-godot-plugin uses: actions/checkout@v4 with: - repository: ${{env.GODOT_REPOSITORY}} - ref: ${{env.GODOT_MAIN_SYNC_REF}} + fetch-depth: 0 + path: tmp/patchwork-tmp + + # We must move patchwork to a higher directory than our CWD, + # because if we don't, cloning godot will overwrite patchwork. + # (And Godot's actions expect Godot to be our CWD.) + - name: Move to higher directory + shell: sh + run: mv tmp/patchwork-tmp ../patchwork-tmp - - name: checkout-patchwork_editor + # Grab the environment variables from build.env and output them + - name: Fetch env variables + id: dotenv + uses: falti/dotenv-action@v1.1.5 + with: + path: ../patchwork-tmp/build.env + keys-case: bypass + + - name: Checkout Godot uses: actions/checkout@v4 with: - path: modules/patchwork_editor - fetch-depth: 0 + repository: ${{ steps.dotenv.outputs.GODOT_REPO }} + ref: ${{ steps.dotenv.outputs.GODOT_REF }} - - name: copy actions + - name: Copy editor directory shell: bash run: | - cp -R modules/patchwork_editor/.github/actions/* .github/actions/ + cp -R ../patchwork-tmp/editor modules/patchwork_editor - name: Select Xcode 16 if: matrix.platform == 'macos' @@ -138,7 +147,7 @@ jobs: - name: Prepare artifact # Stripping the debug symbols screws up lipo'd binaries on macos, so don't do it if: matrix.platform != 'macos' - uses: ./.github/actions/godot-prepare-artifact + uses: ./../patchwork-tmp/.github/actions/godot-prepare-artifact - name: Save Godot build cache # if: success() || (steps.restore-cache.outputs.cache-hit == 'false' && (steps.compile-editor.outcome != 'skipped' || steps.compile-template.outcome != 'skipped')) @@ -152,11 +161,11 @@ jobs: if: matrix.platform == 'macos' && matrix.target == 'editor' shell: bash run: | - chmod +x ${{ github.workspace }}/bin/godot_macos_editor.app/Contents/MacOS/Godot + chmod +x bin/godot_macos_editor.app/Contents/MacOS/Godot - name: Mac Sign if: matrix.platform == 'macos' && matrix.target == 'editor' - uses: ./.github/actions/macos-sign + uses: ./../patchwork-tmp/.github/actions/macos-sign with: FRAMEWORK_PATH: ${{ github.workspace }}/bin/godot_macos_editor.app SIGN_FLAGS: "--deep --force --options=runtime --entitlements ${{ github.workspace }}/misc/dist/macos/editor.entitlements" @@ -171,106 +180,6 @@ jobs: - uses: actions/upload-artifact@v4 if: matrix.id != 'linux-sanitizers' with: - name: patchwork_editor-${{ matrix.platform }} - path: ${{github.workspace}}/bin/* + name: godot-with-patchwork-${{ matrix.platform }} + path: ${{ github.workspace }}/bin/* retention-days: 90 - - # test: - # needs: build - # runs-on: ${{ matrix.os }} - # name: ${{ matrix.name }} test - # strategy: - # fail-fast: false - # matrix: - # include: - # - name: "Windows" - # os: "windows-latest" - # platform: windows - # bin: ./bin/godot.windows.editor.x86_64.exe - - # - name: "๐Ÿง Linux" - # os: "ubuntu-24.04" - # platform: linux - # bin: ./bin/godot.linuxbsd.editor.x86_64 - - # - name: "๐ŸŽ macOS" - # os: "macos-14" - # platform: macos - # bin: ./bin/godot.macos.editor.arm64 - - # steps: - # - name: checkout-godot - # uses: actions/checkout@v4 - # with: - # repository: GODOT_REPOSITORY - # ref: ${{env.GODOT_MAIN_SYNC_REF}} - - # - name: checkout-patchwork_editor - # uses: actions/checkout@v4 - # with: - # path: modules/patchwork_editor - # fetch-depth: 0 - - # - name: copy actions - # shell: bash - # run: | - # cp -R modules/patchwork_editor/.github/actions/* .github/actions/ - - # - name: Download patchwork_editor artifacts - # uses: actions/download-artifact@v4 - # with: - # name: patchwork_editor-editor-${{ matrix.platform }} - # path: bin - - # - name: set permissions - # shell: bash - # run: | - # chmod a+x bin/godot* - - # - name: run tests - # shell: bash - # run: | - # ${{matrix.bin}} --headless --test --force-colors "--test-case=[patchwork_editor]*" - - release: - if: startsWith(github.ref, 'refs/tags/') - runs-on: "ubuntu-latest" - permissions: - contents: write - needs: [build] - steps: - - name: Download Linux artifact - uses: actions/download-artifact@v4 - with: - name: patchwork_editor-linux - path: artifacts/linux - - name: Download MacOS artifact - uses: actions/download-artifact@v4 - with: - name: patchwork_editor-macos - path: artifacts/macos - - name: Download Windows artifact - uses: actions/download-artifact@v4 - with: - name: patchwork_editor-windows - path: artifacts/windows - - name: Zip artifacts - run: | - ls -la artifacts/* - cd artifacts/windows - zip -r9 "../patchwork_editor-${{ github.ref_name }}-windows.zip" * - cd ../.. - cd artifacts/macos - chmod a+x godot_macos_editor.app/Contents/MacOS/Godot - zip -r9 "../patchwork_editor-${{ github.ref_name }}-macos.zip" * - cd ../.. - cd artifacts/linux - chmod a+x * - zip -r9 "../patchwork_editor-${{ github.ref_name }}-linux.zip" * - - name: Release - uses: nikitalita/action-gh-release@v1.0 - with: - files: | - artifacts/patchwork_editor-${{ github.ref_name }}-windows.zip - artifacts/patchwork_editor-${{ github.ref_name }}-macos.zip - artifacts/patchwork_editor-${{ github.ref_name }}-linux.zip diff --git a/.github/workflows/compose_projects.yml b/.github/workflows/compose_projects.yml new file mode 100644 index 00000000..c754ca68 --- /dev/null +++ b/.github/workflows/compose_projects.yml @@ -0,0 +1,63 @@ +name: ๐Ÿงต Compose Projects +on: + workflow_call: + +jobs: + # Grab the environment variables from build.env and output them + load-env: + name: ๐Ÿ” Load Environment variables + runs-on: "ubuntu-latest" + outputs: + THREADBARE_REPO: ${{ steps.dotenv.outputs.THREADBARE_REPO }} + THREADBARE_REF: ${{ steps.dotenv.outputs.THREADBARE_REF }} + MODDABLE_PLATFORMER_REPO: ${{ steps.dotenv.outputs.MODDABLE_PLATFORMER_REPO }} + MODDABLE_PLATFORMER_REF: ${{ steps.dotenv.outputs.MODDABLE_PLATFORMER_REF }} + steps: + - uses: actions/checkout@v4 + - id: dotenv + uses: falti/dotenv-action@v1.1.5 + with: + path: build.env + keys-case: bypass + + compose-projects: + needs: [load-env] + runs-on: "ubuntu-latest" + name: ๐Ÿชก Compose ${{ matrix.project.name }} + strategy: + fail-fast: false + matrix: + project: + - name: threadbare + repo: ${{ needs.load-env.outputs.THREADBARE_REPO }} + ref: ${{ needs.load-env.outputs.THREADBARE_REF }} + - name: moddable-platformer + repo: ${{ needs.load-env.outputs.MODDABLE_PLATFORMER_REPO }} + ref: ${{ needs.load-env.outputs.MODDABLE_PLATFORMER_REF }} + steps: + - name: Checkout project + uses: actions/checkout@v4 + with: + repository: ${{ matrix.project.repo }} + ref: ${{ matrix.project.ref }} + path: ${{ matrix.project.name }} + fetch-depth: 0 + persist-credentials: false + - name: Download Patchwork + uses: actions/download-artifact@v7 + with: + pattern: patchwork-godot-plugin + path: patchwork-godot-plugin + - name: Copy to addons + shell: sh + run: | + mkdir -p ${{ matrix.project.name }}/addons/patchwork + cp -r patchwork-godot-plugin/* ${{ matrix.project.name }}/addons/patchwork + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.project.name }}-with-patchwork + path: | + ${{ matrix.project.name }} + if-no-files-found: error + diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index f0abfc6e..572fff33 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -1,11 +1,11 @@ -name: ๐Ÿง Linux Builds +name: ๐Ÿง Build Patchwork for Linux on: workflow_call: jobs: linux: runs-on: "ubuntu-22.04" - name: linux ${{ matrix.arch }} + name: ๐Ÿ“ Build ${{ matrix.arch }} strategy: fail-fast: false matrix: @@ -15,10 +15,10 @@ jobs: #"armv7-unknown-linux-gnueabihf", # TODO: fix this, newer godot-rust is failing to build for arm32 #"i686-unknown-linux-gnu" ] - include-static-libs: [false] - steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: "Install dependencies" shell: sh run: | @@ -43,25 +43,11 @@ jobs: uses: ./.github/actions/build-plugin with: arch: ${{ matrix.arch }} - # features: ${{ matrix.features.feature }},${{ matrix.precision }}-${{ matrix.dimensions.feature }} - - name: Copy to bin - shell: sh - run: | - mkdir -p rust/plugin/linux - cp target/release/libpatchwork_rust_core.so rust/plugin/linux/libpatchwork_rust_core.linux.${{ matrix.arch }}.so - ls -la rust/plugin/linux - - name: Copy static lib - if: ${{ matrix.include-static-libs }} - shell: sh - run: | - mkdir -p rust/plugin/linux - cp target/release/libpatchwork_rust_core.a rust/plugin/linux/libpatchwork_rust_core.linux.${{ matrix.arch }}.a - ls -la rust/plugin/linux + - name: Upload uses: actions/upload-artifact@v4 with: - name: patchwork-godot-linux-${{ matrix.arch }} - path: | - rust/plugin/linux/* + name: patchwork-build-linux-${{ matrix.arch }} + path: ./build/patchwork/* if-no-files-found: error diff --git a/.github/workflows/macos_builds.yml b/.github/workflows/macos_builds.yml index a73d641b..67d95a2c 100644 --- a/.github/workflows/macos_builds.yml +++ b/.github/workflows/macos_builds.yml @@ -1,4 +1,4 @@ -name: ๐ŸŽ macOS Builds +name: ๐ŸŽ Build Patchwork for macOS on: workflow_call: @@ -8,17 +8,15 @@ env: jobs: macos: runs-on: "macos-14" - name: ${{ matrix.arch }} + name: ๐Ÿ“ Build ${{ matrix.arch }} strategy: fail-fast: false matrix: arch: ["x86_64-apple-darwin"] - include-static-libs: [false] - steps: - - uses: actions/checkout@v4 - - # restore cache + - uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: Restore Cache uses: Swatinem/rust-cache@v2 with: @@ -28,28 +26,11 @@ jobs: uses: ./.github/actions/build-plugin with: arch: ${{ matrix.arch }} - # features: ${{ matrix.features.feature }},${{ matrix.precision }}-${{ matrix.dimensions.feature }} - - - name: Copy to bin - shell: sh - run: | - mkdir -p rust/plugin/macos/libpatchwork_rust_core.macos.framework - cp target/release/libpatchwork_rust_core.dylib rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib - ls -la rust/plugin/macos/libpatchwork_rust_core.macos.framework - - - name: Copy static libs - if: ${{ matrix.include-static-libs }} - shell: sh - run: | - mkdir -p rust/plugin/macos/libpatchwork_rust_core.macos.framework - cp target/release/libpatchwork_rust_core.arm64.a rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.arm64.a - cp target/release/libpatchwork_rust_core.x86_64.a rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.x86_64.a - ls -la rust/plugin/macos/libpatchwork_rust_core.macos.framework - name: Mac Sign uses: ./.github/actions/macos-sign with: - FRAMEWORK_PATH: ${{ github.workspace }}/rust/plugin/macos/libpatchwork_rust_core.macos.framework + FRAMEWORK_PATH: ./build/patchwork/bin/libpatchwork_rust_core.macos.framework SIGN_FLAGS: "--deep" APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }} APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} @@ -57,10 +38,10 @@ jobs: APPLE_DEV_ID: ${{ secrets.APPLE_DEV_ID }} APPLE_DEV_TEAM_ID: ${{ secrets.APPLE_DEV_TEAM_ID }} APPLE_DEV_APP_ID: ${{ secrets.APPLE_DEV_APP_ID }} + - name: Upload uses: actions/upload-artifact@v4 with: - name: patchwork-godot-macos-${{ matrix.arch}} - path: | - rust/plugin/macos/**/* + name: patchwork-build-macos-${{ matrix.arch }} + path: ./build/patchwork/* if-no-files-found: error diff --git a/.github/workflows/merge_builds.yml b/.github/workflows/merge_builds.yml new file mode 100644 index 00000000..74bfd4ec --- /dev/null +++ b/.github/workflows/merge_builds.yml @@ -0,0 +1,27 @@ +name: ๐Ÿงฉ Merge Patchwork Builds +on: + workflow_call: + +jobs: + merge-builds: + runs-on: "ubuntu-latest" + name: ๐Ÿงฉ Merge Patchwork Builds + strategy: + fail-fast: false + steps: + # just download the artifacts from the macos, windows and linux plugin builds + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: patchwork-build-* + path: ${{ github.workspace }}/patchwork-godot-plugin + merge-multiple: true + - name: Wut + run: | + ls -la ${{ github.workspace }}/patchwork-godot-plugin/bin || echo "No artifacts" + + - name: Upload patchwork-godot-plugin + uses: actions/upload-artifact@v4 + with: + path: patchwork-godot-plugin + name: patchwork-godot-plugin \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c94f3850 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: ๐Ÿ“ฆ Release +on: + workflow_call: + +jobs: + release: + runs-on: ubuntu-latest + name: โœ‰๏ธ Release ${{ matrix.artifact }} + strategy: + fail-fast: false + matrix: + artifact: + - godot-with-patchwork-windows + - godot-with-patchwork-linux + - godot-with-patchwork-macos + - patchwork-godot-plugin + - threadbare-with-patchwork + - moddable-platformer-with-patchwork + + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + pattern: ${{ matrix.artifact }} + path: ${{ github.workspace }} + + - name: Zip artifact + run: | + zip -r9 ${{ matrix.artifact }}-${{ github.ref_name }}.zip ${{ matrix.artifact }}/* + + - name: Release artifact + if: github.ref_type == 'tag' + uses: softprops/action-gh-release@v2 + with: + files: | + ${{ matrix.artifact }}-${{ github.ref_name }}.zip diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index f50f86b9..558cf875 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -28,126 +28,35 @@ concurrency: jobs: editor-builds: - name: ๐Ÿ“ Editor All Platforms + name: ๐Ÿค– Build Godot for All Platforms uses: ./.github/workflows/all_editor_builds.yml secrets: inherit macos-plugin-builds: - name: ๐ŸŽ macOS + name: ๐ŸŽ Build Patchwork for macOS uses: ./.github/workflows/macos_builds.yml secrets: inherit windows-plugin-builds: - name: ๐Ÿ Windows + name: ๐ŸชŸ Build Patchwork for Windows uses: ./.github/workflows/windows_builds.yml + linux-plugin-builds: - name: ๐Ÿง Linux + name: ๐Ÿง Build Patchwork for Linux uses: ./.github/workflows/linux_builds.yml merge-plugin-builds: - runs-on: ubuntu-latest - name: Merge + name: ๐Ÿงฉ Merge Patchwork Builds needs: [macos-plugin-builds, windows-plugin-builds, linux-plugin-builds] - steps: - # checkout - - uses: actions/checkout@v4 - with: - path: ws/addons/patchwork - persist-credentials: false - fetch-depth: 0 + uses: ./.github/workflows/merge_builds.yml - - name: Install python3 and git - run: | - sudo apt-get update - sudo apt-get install -y python3 git + compose-projects: + name: ๐Ÿงต Compose Projects + needs: [merge-plugin-builds] + uses: ./.github/workflows/compose_projects.yml - - name: Update version - run: | - cd ws/addons/patchwork - python3 update_version.py - # just download the artifacts from the macos, windows and linux plugin builds - - name: Download Linux artifacts - uses: actions/download-artifact@v4 - with: - pattern: patchwork-godot-linux-* - path: ws/addons/patchwork/rust/plugin/linux - merge-multiple: true - - name: Download MacOS artifacts - uses: actions/download-artifact@v4 - with: - pattern: patchwork-godot-macos-* - path: ws/addons/patchwork/rust/plugin/macos - merge-multiple: true - - name: Download Windows artifacts - uses: actions/download-artifact@v4 - with: - pattern: patchwork-godot-windows-* - path: ws/addons/patchwork/rust/plugin/windows - merge-multiple: true - - name: Wut - run: | - ls -la ws/addons/patchwork/rust/plugin/linux || echo "No linux artifacts" - ls -la ws/addons/patchwork/rust/plugin/macos/libpatchwork_rust_core.macos.framework || echo "No macos artifacts" - ls -la ws/addons/patchwork/rust/plugin/windows || echo "No windows artifacts" - - name: Create artifacts/ - run: mkdir artifacts - # add the entire "addons" folder to the artifacts - - name: Copy addons to artifacts/ - run: cp -R ws/addons artifacts/patchwork-godot-plugin - - name: Upload patchwork-godot-plugin - uses: actions/upload-artifact@v4 - with: - path: artifacts/patchwork-godot-plugin - name: patchwork-godot-plugin - - uses: actions/checkout@v4 - with: - repository: endlessm/moddable-platformer - ref: main - path: moddable-platformer - fetch-depth: 0 - persist-credentials: false - - name: Copy addons to moddable-platformer - run: | - mkdir -p moddable-platformer/addons - cp -R ws/addons/patchwork moddable-platformer/addons - - name: Copy moddable-platformer to artifacts/ - run: cp -R moddable-platformer artifacts/moddable-platformer-with-patchwork - - name: Upload moddable-platformer - uses: actions/upload-artifact@v4 - with: - path: artifacts/moddable-platformer-with-patchwork - name: moddable-platformer-with-patchwork - - uses: actions/checkout@v4 - with: - repository: endlessm/threadbare - ref: main - path: threadbare - fetch-depth: 0 - lfs: true - persist-credentials: false - - name: Copy addons to threadbare - run: | - cp -R ws/addons/patchwork threadbare/addons - - name: Copy threadbare to artifacts/ - run: cp -R threadbare artifacts/threadbare-with-patchwork - - name: Upload threadbare - uses: actions/upload-artifact@v4 - with: - path: artifacts/threadbare-with-patchwork - name: threadbare-with-patchwork - - name: Zip artifacts for release - if: startsWith(github.ref, 'refs/tags/') - run: | - ls -la artifacts/* - cd artifacts - zip -r9 "patchwork-godot-plugin.zip" "patchwork-godot-plugin/*" - zip -r9 "moddable-platformer-with-patchwork.zip" "moddable-platformer-with-patchwork/*" - zip -r9 "threadbare-with-patchwork.zip" "threadbare-with-patchwork/*" - - name: Release - if: startsWith(github.ref, 'refs/tags/') - uses: nikitalita/action-gh-release@v1.0 - with: - files: | - artifacts/patchwork-godot-plugin.zip - artifacts/moddable-platformer-with-patchwork.zip - artifacts/threadbare-with-patchwork.zip + release: + name: ๐Ÿ“ฆ Release + if: github.ref_type == 'tag' + needs: [editor-builds, merge-plugin-builds, compose-projects] + uses: ./.github/workflows/release.yml \ No newline at end of file diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index c7890710..f2c84c95 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -1,19 +1,20 @@ -name: ๐Ÿ Windows Builds +name: ๐ŸชŸ Build Patchwork for Windows on: workflow_call: jobs: build-windows: runs-on: "windows-latest" - name: Windows ${{ matrix.arch }} + name: ๐Ÿ“ Build ${{ matrix.arch }} strategy: fail-fast: false matrix: # ARM32 Is not officially supported yet, you need to self build rust target. arch: ["x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"] #, , "i686-pc-windows-msvc", "aarch64-pc-windows-msvc", "thumbv7a-pc-windows-msvc"] - include-static-libs: [false] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: Restore Cache uses: Swatinem/rust-cache@v2 with: @@ -22,27 +23,10 @@ jobs: uses: ./.github/actions/build-plugin with: arch: ${{ matrix.arch }} - # features: ${{ matrix.features.feature }},${{ matrix.precision }}-${{ matrix.dimensions.feature }} - - name: Copy to bin - shell: sh - run: | - ls target/release - mkdir -p rust/plugin/windows - cp target/release/patchwork_rust_core.dll rust/plugin/windows/patchwork_rust_core.windows.${{ matrix.arch }}.dll - ls -la rust/plugin/windows - - - name: Copy static lib - if: ${{ matrix.include-static-libs }} - shell: sh - run: | - mkdir -p rust/plugin/windows - cp target/release/patchwork_rust_core.lib rust/plugin/windows/patchwork_rust_core.windows.${{ matrix.arch }}.lib - ls -la rust/plugin/windows - + - name: Upload uses: actions/upload-artifact@v4 with: - name: patchwork-godot-windows-${{ matrix.arch }} - path: | - rust/plugin/windows/* + name: patchwork-build-windows-${{ matrix.arch }} + path: ./build/patchwork/* if-no-files-found: error diff --git a/.gitignore b/.gitignore index cdd7fa68..b967cad2 100644 --- a/.gitignore +++ b/.gitignore @@ -316,7 +316,6 @@ platform/windows/godot_res.res # Visual Studio 2017 and Visual Studio Code workspace folder /.vs -/.vscode/*.json # Visual Studio Code workspace file *.code-workspace diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..b29124e6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,13 @@ +{ + "recommendations": [ + "ms-python.black-formatter", + "ms-vscode.cpptools", + "llvm-vs-code-extensions.vscode-clangd", + "vadimcn.vscode-lldb", + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "nefrob.vscode-just-syntax", + // TODO: enable this once they implement a project picker + // "geequlim.godot-tools" + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json.template b/.vscode/extensions.json.template deleted file mode 100644 index fb8fa515..00000000 --- a/.vscode/extensions.json.template +++ /dev/null @@ -1,9 +0,0 @@ -{ - // Recommended extensions for developing gdsdecomp - "recommendations": [ - "ms-python.black-formatter", - "ms-vscode.cpptools", - "llvm-vs-code-extensions.vscode-clangd", - "llvm-vs-code-extensions.lldb-dap" - ] -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..fdd68ea3 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,169 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Hot reload Patchwork", + "type": "node-terminal", + "request": "launch", + // unsure if this works on non-windows platforms; test + "command": "just build-patchwork release && exit", + "windows": { "command": "just build-patchwork release && $host.SetShouldExit(0)" } + }, + { + "name": "Hot reload Patchwork (dev)", + "type": "node-terminal", + "request": "launch", + "command": "just build-patchwork debug && exit", + "windows": { "command": "just build-patchwork debug && $host.SetShouldExit(0)" } + }, + { + "name": "lldb: Launch moddable-platformer", + "type": "lldb", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "console": "integratedTerminal", + "cwd": "${workspaceFolder}", + "initCommands": [ + "script import ${workspaceFolder}/build/GodotFormatters/godot_formatters", + ], + "preLaunchTask": "Build: Prepare moddable-platformer (Release)" + }, + { + "name": "lldb: Launch moddable-platformer (dev)", + "type": "lldb", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.dev.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.dev.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.dev.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "console": "integratedTerminal", + "cwd": "${workspaceFolder}", + "initCommands": [ + "script import ${workspaceFolder}/build/GodotFormatters/godot_formatters", + ], + "preLaunchTask": "Build: Prepare moddable-platformer (Debug)" + }, + { + "name": "Windows: Launch moddable-platformer", + "type": "cppvsdbg", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "preLaunchTask": "Build: Prepare moddable-platformer (Release)" + }, + { + "name": "Windows: Launch moddable-platformer (dev)", + "type": "cppvsdbg", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.dev.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.dev.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.dev.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "preLaunchTask": "Build: Prepare moddable-platformer (Debug)" + }, + { + "name": "macOS: Launch moddable-platformer", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/bin/godot.macos.editor.arm64", + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build: Prepare moddable-platformer (Release)", + "MIMode": "lldb" + }, + // Since mac is using LLDB anyways, do we really need a separate config for it with cppdbg? + { + "name": "macOS: Launch moddable-platformer (dev)", + "type": "cppdbg", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.dev.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.dev.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.dev.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build: Prepare moddable-platformer (Debug)", + "MIMode": "lldb" + }, + { + "name": "Linux: Launch moddable-platformer", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/bin/godot.macos.editor.arm64", + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build: Prepare moddable-platformer (Release)", + "MIMode": "gdb" + }, + { + "name": "Linux: Launch moddable-platformer (dev)", + "type": "cppdbg", + "request": "launch", + "program": "", + "osx": { "program": "${workspaceFolder}/bin/godot.macos.editor.dev.arm64" }, + "windows": { "program": "${workspaceFolder}/build/godot/bin/godot.windows.editor.dev.x86_64.exe" }, + "linux": { "program": "${workspaceFolder}/bin/godot.linux.editor.dev.x86_64" }, + "args": [ + "-e", + "--path", + "${workspaceFolder}/build/moddable-platformer", + ], + "visualizerFile": "${workspaceFolder}build/godot/platform/windows/godot.natvis", + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "preLaunchTask": "Build: Prepare moddable-platformer (Debug)", + "MIMode": "gdb" + }, + ] +} diff --git a/.vscode/launch.json.template b/.vscode/launch.json.template deleted file mode 100644 index 17e85baf..00000000 --- a/.vscode/launch.json.template +++ /dev/null @@ -1,135 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - // This is to test decompiling Game PCKs, this uses the debug editor binary - { - "name": "(Windows) Launch CLI recovery (editor dev)", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.windows.editor.dev.x86_64.exe", - "args": [ - "--headless", - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone", - // Put the pck you want to test here - "--recover=${workspaceFolder}/../wherever_the_pck_you_want_to_test_is", - "--output-dir=${workspaceFolder}/../wherever_you_want_the_output_to_be" - ], - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "console": "integratedTerminal", - "preLaunchTask": "Build: editor dev_build" - }, - // Use this to launch the GDRE standalone GUI, this uses the debug editor binary - { - "name": "(Windows) Launch GDRE Standalone (editor dev)", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.windows.editor.dev.x86_64.exe", - "args": [ - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone" - ], - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "console": "integratedTerminal", - "preLaunchTask": "Build: editor dev_build" - }, - // Use this to launch the standalone editor with the template_release binary - { - "name": "(Windows) Launch GDRE Standalone (template_release)", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.windows.template_release.x86_64.exe", - "args": [ - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone" - ], - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "console": "integratedTerminal", - "preLaunchTask": "Build: editor template_release" - }, - // This launches the editor to edit the standalone Godot project - { - "name": "(Windows) Launch Editor (gdre standalone) (editor Debug)", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.windows.editor.dev.x86_64.exe", - "args": [ - "-e", - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone" - ], - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "console": "externalTerminal", - "preLaunchTask": "Build: editor dev_build" - }, - { - "name": "(Windows) Launch Editor (test project) (editor Optimized)", - "type": "cppvsdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.windows.editor.x86_64.exe", - "args": [ - "-e", - "--path", - //"${workspaceFolder}/modules/gdsdecomp/standalone" - "${workspaceFolder}/../godot-projects/godot-4.x-test-project" - ], - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "console": "integratedTerminal", - "preLaunchTask": "Build: editor optimized" - }, - { - "name": "(macOS) Launch CLI recovery (editor dev)", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.macos.editor.dev.arm64", - "args": [ - "--headless", - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone", - // Put the pck you want to test here - "--recover=${workspaceFolder}/../wherever_the_pck_you_want_to_test_is", - "--output-dir=${workspaceFolder}/../wherever_you_want_the_output_to_be" - ], - "cwd": "${workspaceFolder}", - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "MIMode": "lldb", - "preLaunchTask": "Build: editor dev_build" - }, - { - "name": "(Linux) Launch CLI recovery (editor dev)", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/bin/godot.linux.editor.dev.x86_64", - "args": [ - "--headless", - "--path", - "${workspaceFolder}/modules/gdsdecomp/standalone", - // Put the pck you want to test here - "--recover=${workspaceFolder}/../wherever_the_pck_you_want_to_test_is", - "--output-dir=${workspaceFolder}/../wherever_you_want_the_output_to_be" - ], - "cwd": "${workspaceFolder}", - "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", - "MIMode": "gdb", - "preLaunchTask": "Build: editor dev_build" - }, - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1f8b0497 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,16 @@ +{ + "[cpp]": { + "editor.formatOnSave": true + }, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.formatOnSave": true + }, + "black-formatter.args": [ + "-l 120" + ], + "C_Cpp.intelliSenseEngine": "disabled", + "clangd.arguments": [ + "--compile-commands-dir=${workspaceFolder}/build/godot" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json.template b/.vscode/settings.json.template deleted file mode 100644 index 572b4007..00000000 --- a/.vscode/settings.json.template +++ /dev/null @@ -1,135 +0,0 @@ -{ - "files.associations": { - "*.rpy": "renpy", - "*.INF": "ini", - "*.h": "cpp", - "algorithm": "cpp", - "fstream": "cpp", - "sstream": "cpp", - "xiosbase": "cpp", - "xlocmes": "cpp", - "locale": "cpp", - "memory": "cpp", - "mutex": "cpp", - "thread": "cpp", - "xlocale": "cpp", - "xlocmon": "cpp", - "xlocnum": "cpp", - "xloctime": "cpp", - "*.inc": "cpp", - "array": "cpp", - "bitset": "cpp", - "deque": "cpp", - "initializer_list": "cpp", - "list": "cpp", - "queue": "cpp", - "random": "cpp", - "span": "cpp", - "stack": "cpp", - "type_traits": "cpp", - "vector": "cpp", - "xhash": "cpp", - "xstring": "cpp", - "xtree": "cpp", - "xutility": "cpp", - "atomic": "cpp", - "forward_list": "cpp", - "iterator": "cpp", - "chrono": "cpp", - "streambuf": "cpp", - "map": "cpp", - "set": "cpp", - "condition_variable": "cpp", - "iomanip": "cpp", - "ostream": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "unordered_map": "cpp", - "unordered_set": "cpp", - "utility": "cpp", - "xfacet": "cpp", - "xlocbuf": "cpp", - "xmemory": "cpp", - "functional": "cpp", - "complex": "cpp", - "xtr1common": "cpp", - "charconv": "cpp", - "cmath": "cpp", - "compare": "cpp", - "cstddef": "cpp", - "format": "cpp", - "istream": "cpp", - "limits": "cpp", - "new": "cpp", - "numeric": "cpp", - "optional": "cpp", - "ratio": "cpp", - "shared_mutex": "cpp", - "stop_token": "cpp", - "*.rh": "cpp", - "filesystem": "cpp", - "string": "cpp", - "ZIP.C": "cpp", - "UNZIP.C": "cpp", - "exception": "cpp", - "xlocinfo": "cpp", - "bit": "cpp", - "cctype": "cpp", - "cinttypes": "cpp", - "clocale": "cpp", - "concepts": "cpp", - "csignal": "cpp", - "cstdarg": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "ios": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "stdexcept": "cpp", - "typeinfo": "cpp", - "xstddef": "cpp" - }, - "editor.formatOnSaveMode": "modificationsIfAvailable", - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter", - "editor.formatOnSave": true - }, - "black-formatter.args": [ - "-l 120" - ], - "[cpp]": { - "editor.formatOnSave": true - }, - "git.scanRepositories": [ - "${workspaceFolder}", - "${workspaceFolder}/modules/gdsdecomp" - ], - "git.repositoryScanMaxDepth": 4, - "gitlens.detectNestedRepositories": true, - "gitlens.advanced.repositorySearchDepth": 4, - "C_Cpp.errorSquiggles": "enabled", - // "search.useIgnoreFiles": false, - // "search.useGlobalIgnoreFiles": true, - // "search.useParentIgnoreFiles": true, - "files.exclude": { - "**/*.x86_64.o": true, - "**/*.x86_64.a": true, - "**/*.x86_64.o.d": true, - "**/*.x86_64.san.o": true, - "**/*.x86_64.san.a": true, - "**/*.arm64.o": true, - "**/*.arm64.a": true, - "**/*.arm64.o.d": true, - "**/*.arm64.san.o": true, - "**/*.arm64.san.a": true - }, - "dotnet.defaultSolution": "disable", - "clangd.fallbackFlags": [ - "-I${workspaceFolder}", - "-I${workspaceFolder}/modules/gdsdecomp" - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..53f9f349 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,23 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "shell", + "group": "build", + "problemMatcher": [ + "$msCompile" + ], + "label": "Build: Prepare moddable-platformer (Release)", + "command": "just _acquire-formatters && just prepare moddable-platformer release release" + }, + { + "type": "shell", + "group": "build", + "problemMatcher": [ + "$msCompile" + ], + "label": "Build: Prepare moddable-platformer (Debug)", + "command": "just _acquire-formatters && just prepare moddable-platformer debug debug" + }, + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json.template b/.vscode/tasks.json.template deleted file mode 100644 index 56211d19..00000000 --- a/.vscode/tasks.json.template +++ /dev/null @@ -1,156 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "shell", - "group": { - "kind": "build", - "isDefault": true - }, - "problemMatcher": [ - "$msCompile" - ], - "command": "scons", - "label": "Build: editor dev_build", - "windows": { - // optional, uncomment if it has difficulty finding Visual Studio - // "options": { - // "shell": { - // "executable": "cmd.exe", - // "args": [ - // "/d", - // "/c", - // "\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\" amd64\"", - // "&" - // ] - // } - // } - }, - "args": [ - "dev_build=yes", - "target=editor", - "compiledb=yes", - "deprecated=yes", - "minizip=yes", - "tests=yes" - ], - }, - { - "type": "shell", - "group": { - "kind": "build", - "isDefault": false - }, - "problemMatcher": [ - "$msCompile" - ], - "command": "scons", - "label": "Build: editor dev_build with sanitizers", - "args": [ - "dev_build=yes", - "target=editor", - "compiledb=yes", - "deprecated=yes", - "minizip=yes", - "tests=yes", - "use_asan=yes" - ], - }, - { - "type": "shell", - "group": "build", - "problemMatcher": [ - "$msCompile" - ], - "command": "scons", - "label": "Build: editor optimized", - "args": [ - "dev_build=no", - "debug_symbols=no", - "target=editor", - "deprecated=yes", - "minizip=yes" - ], - }, - { - "type": "shell", - "group": "build", - "problemMatcher": [ - "$msCompile" - ], - "label": "Build: template_debug arm64", - "linux": { - "command": "scons arch=arm64 platform=linuxbsd target=template_debug module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes optimize=size use_lto=yes use_volk=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "osx": { - "command": "scons arch=arm64 platform=macos target=template_debug optimize=size use_lto=yes use_volk=no module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "windows": { - "command": "scons arch=arm64 platform=windows target=template_debug module_text_server_fb_enabled=yes minizip=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - }, - { - "type": "shell", - "group": "build", - "problemMatcher": [ - "$msCompile" - ], - "label": "Build: template_debug x86_64", - "linux": { - "command": "scons arch=x86_64 platform=linuxbsd target=template_debug module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes optimize=size use_lto=yes use_volk=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "osx": { - "command": "scons arch=x86_64 platform=macos target=template_debug optimize=size use_lto=yes use_volk=no module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "windows": { - "command": "scons arch=x86_64 platform=windows target=template_debug module_text_server_fb_enabled=yes minizip=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - }, - { - "type": "shell", - "group": "build", - "problemMatcher": [ - "$msCompile" - ], - "label": "Build: template_release arm64", - "linux": { - "command": "scons arch=arm64 platform=linuxbsd target=template_release module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes optimize=size use_lto=yes use_volk=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "osx": { - "command": "scons arch=arm64 platform=macos target=template_release optimize=size use_lto=yes use_volk=no module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "windows": { - "command": "scons arch=arm64 platform=windows target=template_release module_text_server_fb_enabled=yes minizip=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - // Optional, uncomment if it has trouble finding it - // "options": { - // "shell": { - // "executable": "cmd.exe", - // "args": [ - // "/d", - // "/c", - // "\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\" amd64\"", - // "&" - // ] - // } - // } - }, - }, - { - "type": "shell", - "group": "build", - "problemMatcher": [ - "$msCompile" - ], - "label": "Build: template_release x86_64", - "linux": { - "command": "scons arch=x86_64 platform=linuxbsd target=template_release module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes optimize=size use_lto=yes use_volk=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "osx": { - "command": "scons arch=x86_64 platform=macos target=template_release optimize=size use_lto=yes use_volk=no module_text_server_fb_enabled=yes minizip=yes debug_symbols=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - "windows": { - "command": "scons arch=x86_64 platform=windows target=template_release module_text_server_fb_enabled=yes minizip=yes deprecated=yes no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no", - }, - }, - ] -} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index aed1633c..ac60eef6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ -# workspace is in rust/plugin +# workspace is in rust [workspace] members = [ - "rust/plugin", + "rust", ] diff --git a/Developers.md b/Developers.md index 2a23440e..b402731a 100644 --- a/Developers.md +++ b/Developers.md @@ -6,7 +6,7 @@ # 1. Git installed? git --version -# 2. Rust installed? +# 2. Rust installed? Must be at least 1.91.1 rustc --version cargo --version @@ -18,190 +18,83 @@ scons --version # Windows: Check Visual Studio is installed # macOS: xcode-select -p # Linux: gcc --version -``` - -If any are missing, see [Detailed Setup](#detailed-setup) below. - ---- - -### Clone Repositories - -```bash -# Clone custom Godot fork -git clone -b master https://github.com/godotengine/godot -git checkout bb92a4c8e27e30cdec05ab6d540d724b9b3cfb72 -cd godot - -# Clone plugin into modules/ -cd modules -git clone https://github.com/inkandswitch/patchwork-godot-plugin patchwork_editor --recurse-submodules +# 5. `just` installed? If not, `cargo install just` +just --version ``` -**Directory structure verification**: - -``` -godot/ -โ”œโ”€โ”€ modules/ -โ”‚ โ”œโ”€โ”€ patchwork_editor/ โ† Plugin here -โ”‚ โ”‚ โ”œโ”€โ”€ editor/ โ† C++ module -โ”‚ โ”‚ โ”œโ”€โ”€ gdscript/ โ† GDScript UI -โ”‚ โ”‚ โ”œโ”€โ”€ rust/plugin/ โ† Rust core -โ”‚ โ”‚ โ”œโ”€โ”€ plugin.cfg -โ”‚ โ”‚ โ””โ”€โ”€ Patchwork.gdextension -โ”‚ โ””โ”€โ”€ ... (other modules) -โ”œโ”€โ”€ bin/ โ† Compiled editor will be here -โ”œโ”€โ”€ core/ -โ””โ”€โ”€ SConstruct โ† Build configuration -``` +If any are missing, see [Detailed Setup](#detailed-setup) below. --- -### Build - -The [patchwork_build_tools](https://github.com/berraknil/patchwork-dev-tools) repository provides automation scripts that streamline the entire build, sync, and development workflow. - -If you would like to build and develop manually, please continue below. - -#### Prerequisites -If you haven't cloned the patchwork_editor module yet: +### `just` build system -```bash -cd godot/modules -git clone https://github.com/nikitalita/patchwork_editor patchwork_editor --recurse-submodules -``` - -**1. Build the Rust Plugin** - -```bash -# Install cargo-post to run post build process successfully -cargo install cargo-post +We use [just](https://github.com/casey/just) as our command runner. -# Navigate to patchwork_editor root directory -cd godot/modules/patchwork_editor +To view a detailed list of targets, type `just`. -# Build -cargo post build +### Quick start: Launching projects -# The DLL/library will be copied to the appropriate location for your platform -``` +If you want to get up and running as fast as possible, type `just launch`. It will launch Endless's `moddable-platformer` project with Patchwork installed, using a custom-built Godot editor with the Patchwork module. -**2. Build Godot with Patchwork Module** +Otherwise, you can specify arguments for `just launch`: ```bash -# Navigate to Godot root -cd godot - -# Build Godot editor with SCons -# Basic build: -scons platform=windows target=editor - -# With optimization and parallel jobs: -scons platform=windows target=editor -j8 production=yes - -# Other platforms: -scons platform=linuxbsd target=editor -j8 -scons platform=macos target=editor -j8 +project=[moddable-platformer|threadbare] # launch threadbare or moddable-platformer projects +patchwork_profile=[release|debug] # whether we should build the rust code with release or debug configuration +godot_profile=[release|debug|sani] # whether we should build Godot with release, debug, or sani configuration +server_url= # force embed a server URL into the project. By default, just keeps whatever server URL is already configured in the project. ``` -**Important SCons flags:** - -- `platform=` - Target platform (windows, linuxbsd, macos) -- `target=editor` - Build the editor (not export templates) -- `-j8` - Use 8 parallel jobs (adjust to your CPU cores) -- `production=yes` - Optimized build (slower compile, faster runtime) -- `dev_build=yes` - Debug symbols (for development) - -**Common Build Issues:** +#### Using Visual Studio Code -If you encounter `LNK1106: invalid file or disk full` error on Windows: +A variety of helpful launch configurations are specified when you open the project in Visual Studio Code. These run `just` commands to prepare projects, and then attach an in-editor debugger. -```powershell -# 1. Clean build artifacts -scons --clean +When working with GDScript, you'll need to open `moddable-platformer` or `threadbare` directly in VSCode, and Godot must be running with `just launch`. -# 2. Check disk space (need at least 20GB free) -Get-PSDrive C -# 3. Reduce parallel jobs (less memory/disk usage) -scons platform=windows target=editor -j4 +### Build structure -# 4. Add antivirus exclusion for godot build directory -# Go to Windows Security โ†’ Virus & threat protection โ†’ Exclusions -# Add: C:\path\to\godot +When you run `just launch`, the output generated files are copied to `build/`. There are several important directories, here: -# 5. Use shorter path if possible -# Move godot to C:\godot instead of deep nested folders -``` +- `build/patchwork`: + + The built plugin. + + `bin`: Rust binaries + + `public`: Symlinked from `public/` in the repo root. For GDScript and assets we must ship directly with the plugin. +- `build/moddable-platformer`/`build/threadbare`: + + A clone of each project repository. + + `addons/patchwork`: Symlinked from `build/patchwork`, so feel free to make GDScript or UI changes directly to `addons/patchwork/public`. +- `build/godot`: + + A clone of the Godot repository + + `modules/patchwork_editor`: Symlinked from `editor/` to form a new editor module. + + `bin`: Contains the built Godot executable. +- `GodotFormatters`: + + A special `lldb` formatter for Godot objects. Only cloned when running the project through VSCode. -**3. Verify Build Output** -Check that the editor was built: -```bash -# Windows -ls bin/godot.windows.editor.x86_64.exe -# Linux -ls bin/godot.linuxbsd.editor.x86_64 - -# macOS -ls bin/godot.macos.editor.arm64 -``` - -**4. Link Plugin to Your Project** - -Link the plugin directory in your project: - -#### Windows -In your Godot project directory, run the following commands: -(cmd.exe only, this does not work on powershell) -``` -mkdir .\addons -mklink /D .\addons\patchwork C:\path\to\godot\modules\patchwork_editor -``` - -#### Linux and macOS -```bash -# In your Godot project directory, run the following commands: -mkdir -p addons -ln -s /path/to/godot/modules/patchwork_editor addons/patchwork -``` - -**5. Open Project with Custom Editor** - -```bash -# Windows -godot\bin\godot.windows.editor.x86_64.exe -e --path "C:\path\to\your\project" - -# Linux -godot/bin/godot.linuxbsd.editor.x86_64 -e --path "/path/to/your/project" - -# macOS -godot/bin/godot.macos.editor.arm64 -e --path "/path/to/your/project" -``` - -**6. Understanding Patchwork's Architecture** +### Understanding Patchwork's Architecture Patchwork is a **hybrid Godot Engine C++ module + GDExtension**, not a traditional plugin: -- **Godot Engine C++ Module** (`modules/patchwork_editor/`) - Built INTO your custom Godot editor +- **Godot Engine C++ Module** (`editor/`) - Built INTO your custom Godot editor - Automatically active when you launch the custom editor - - Registers core classes (`PatchworkEditor`, etc.) - - Primarily here to provide editor functionality that is not currently exposed to GDExtensions + - Registers the `PatchworkEditor` class + - Only here to provide editor functionality that is not currently exposed to GDExtensions - Will eventually be removed once this functionality is upstreamed to Godot -- **GDExtension Component** (`addons/patchwork/`) - Provides Rust functionality +- **GDExtension Component** (`public/` and `rust/`) - Actually runs the application - Contains the Rust plugin DLL/library - - Contains GDScript UI components + - Contains public GDScript UI components - Located in your project's `addons/patchwork/` folder Because the C++ module is compiled directly into Godot (see [register_types.cpp:11-14](register_types.cpp#L11-L14)), Patchwork automatically initializes when the editor starts. The `plugin.cfg` file exists for compatibility but has an empty `script=""` field because there's no GDScript plugin script to enable/disable. -**In summary:** When you build Godot with Patchwork and copy the files to `addons/patchwork/`, the plugin is **always active** - you don't need to manually enable it in the Plugins menu. The Patchwork tab will appear automatically. +**In summary:** When `just` builds Godot with Patchwork and symlinks the files to `addons/patchwork/`, the plugin is **always active** - you don't need to manually enable it in the Plugins menu. The Patchwork tab will appear automatically. -#### Manual Development Workflow +### Development Workflow When developing manually, after making changes: @@ -211,32 +104,13 @@ Click the "Reload UI" button in the Patchwork tab to reload the UI. **For Rust changes:** -```bash - -cd godot/modules/patchwork_editor -cargo post build --release -# Restart Godot to reload library -``` - -```powershell -# Windows - Rebuild Rust -cd godot\modules\patchwork_editor -cargo post build --release -# Restart Godot to reload DLL -``` +Either run `just build-patchwork (release/debug)` in a terminal, or launch the `Hot reload patchwork` target in VSCode. Godot should reload the Rust binary automatically, but you may have to restart the editor if it explodes. **For C++ module changes:** -```bash -# Rebuild Godot -cd godot -scons platform=windows target=editor -j8 - -# Restart Godot with the new editor -bin/godot.windows.editor.x86_64.exe -e --path "YOUR_PROJECT" -``` +Close the editor, and run `just launch` again (or launch from VSCode). -#### Rust Plugin Development with Auto-Rebuild +#### Auto-rebuild Rust changes (optional) For faster Rust development iteration, use `watchexec` to automatically rebuild on file changes: @@ -261,10 +135,10 @@ cargo install watchexec-cli cd godot/modules/patchwork_editor # Auto-rebuild on any .rs or .toml file change -watchexec -e rs,toml cargo post build +watchexec -e rs,toml just build-patchwork (release/debug) ``` -This will watch for changes to `.rs` and `.toml` files and automatically run `cargo post build` when changes are detected. +This will watch for changes to `.rs` and `.toml` files and automatically run `just build-patchwork` when changes are detected. Godot will automatically reload the plugin after the build is complete. **3. macOS Code Signing (if needed):** @@ -272,7 +146,7 @@ Godot will automatically reload the plugin after the build is complete. If you're on macOS and need code signing for the built library: ```bash -# In the rust/plugin directory, create the identity file +# In the rust directory, create the identity file mkdir -p .cargo echo "Apple Development: Your Name (TEAMID)" > .cargo/.devidentity @@ -293,7 +167,7 @@ echo "Apple Development: Nikita Zatkovich (RFTZV7M2RV)" > .cargo/.devidentity curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Restart terminal, then verify -rustc --version # Should be 1.57.0 or higher +rustc --version # Should be 1.91.1 or higher cargo --version ``` @@ -378,3 +252,11 @@ echo "Apple Development: Your Name (TEAMID)" > .cargo/.devidentity Without this, macOS will show security warnings when loading the plugin. --- + +### 5. Install Just + +Once you have `cargo`, it's easiest to run: + +``` +cargo install just +``` \ No newline at end of file diff --git a/Patchwork.gdextension b/Patchwork.gdextension deleted file mode 100644 index aa9c435b..00000000 --- a/Patchwork.gdextension +++ /dev/null @@ -1,18 +0,0 @@ -[configuration] -entry_symbol = "gdext_rust_init" -compatibility_minimum = 4.5 -reloadable = true - -[libraries] -linux.debug.x86_64 = "rust/plugin/linux/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" -linux.release.x86_64 = "rust/plugin/linux/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" -linux.debug.arm64 = "rust/plugin/linux/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" -linux.release.arm64 = "rust/plugin/linux/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" -linux.debug.arm32 = "rust/plugin/linux/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" -linux.release.arm32 = "rust/plugin/linux/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" -windows.debug.x86_64 = "rust/plugin/windows/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" -windows.release.x86_64 = "rust/plugin/windows/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" -windows.debug.arm64 = "rust/plugin/windows/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" -windows.release.arm64 = "rust/plugin/windows/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" -macos.debug = "rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" -macos.release = "rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" diff --git a/Patchwork.gdextension.uid b/Patchwork.gdextension.uid deleted file mode 100644 index 48488de2..00000000 --- a/Patchwork.gdextension.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b282fmxpn2ysu diff --git a/SCsub b/SCsub deleted file mode 100644 index 982cc303..00000000 --- a/SCsub +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python - -import os -import re -import shutil -from subprocess import Popen, PIPE, check_output -import glob - -Import("env") -Import("env_modules") - - -MODULE_DIR = os.path.realpath(".") -EXTERNAL_DIR = os.path.join(MODULE_DIR, "external") -EXTERNAL_LIB_DIR = os.path.join(EXTERNAL_DIR, "lib") - - -env_patchwork_editor = env_modules.Clone() -env_patchwork_editor["disable_exceptions"] = False - -env_patchwork_editor.Append(CPPPATH=["."]) - - -# env_patchwork_editor.Append(CPPPATH=["external/include"]) -# env.Append(LIBPATH=[EXTERNAL_LIB_DIR]) - -# icon stuff - -# env_patchwork_editor.Append(CPPPATH=["#thirdparty/thorsvg/"]) - -# env_patchwork_editor["BUILDERS"]["MakeGDREIconsBuilder"] = Builder( -# action=env_patchwork_editor.Run(gdre_icon_builder.make_gdre_icons_action), -# suffix=".h", -# src_suffix=".svg", -# ) -# icon_sources = Glob("icons/*.svg") - -# env_patchwork_editor.Alias( -# "gdre_icons", -# [env_patchwork_editor.MakeGDREIconsBuilder("editor/gdre_icons.gen.h", icon_sources)], -# ) - - -# automerge stuff - - -def get_sources(rel_path, filters=["*.h", "*.hpp", "*.cpp"]): - abs_path = os.path.join(MODULE_DIR, rel_path) - # check if abs_path exists - if not os.path.exists(abs_path): - raise Exception( - f"Path {abs_path} does not exist, please run `git submodule update --init --recursive` in the patchwork_editor directory" - ) - sources = [] - for suffix in filters: - globstr = os.path.join(abs_path, "**", suffix) - sources += glob.glob(globstr, recursive=True) - return [os.path.relpath(source, MODULE_DIR) for source in sources] - - -def cmake_builder(external_dir, source_dir, build_dir, libs, config_options=None): - output = bytes() - # get dev_build from env - dev_build = env["dev_build"] if "dev_build" in env else False - build_variant = "Debug" if dev_build else "Release" - print("BUILD VARIANT", build_variant) - - Config_cmd = ["cmake", "-S", source_dir, "-B", build_dir , "-DCMAKE_BUILD_TYPE=" + build_variant] - if config_options: - Config_cmd += config_options - try: - if os.path.exists(build_dir): - shutil.rmtree(build_dir, ignore_errors=True) - output += check_output(["cmake", "-E", "make_directory", external_dir]) + b"\n" - output += check_output(["cmake", "-E", "make_directory", build_dir]) + b"\n" - output += check_output(Config_cmd) + b"\n" - output += check_output(["cmake", "--build", build_dir]) + b"\n" - # remove the old libs - for lib in libs: - lib_path = os.path.join(external_dir, lib) - if os.path.exists(lib_path): - os.remove(lib_path) - output += check_output(["cmake", "--install", build_dir, "--prefix", external_dir]) + b"\n" - except Exception as e: - # convert output to string - output = output.decode("utf-8") - print(f"Failed to build automerge-c: {e}") - print(f"Output: {output}") - exit(1) - # output = output.decode("utf-8") - # print(output) - - -def add_libs_to_env(module_obj, libs, sources): - for lib in libs: - env_patchwork_editor.Depends(lib, sources) - # get the basename of the library minus the extension - lib_name = os.path.basename(lib).split(".")[0] - full_lib_path = os.path.join(MODULE_DIR, lib) - env.Append(LIBS=[lib_name]) - env.Depends(module_obj, libs) - - -PATCHWORK_RUST_PREFIX = "thirdparty/patchwork_rust" -PATCHWORK_RUST_DIR = os.path.join(MODULE_DIR, PATCHWORK_RUST_PREFIX) -PATCHWORK_RUST_BUILD_DIR = os.path.join(PATCHWORK_RUST_DIR, "build") -PATCHWORK_LIBS = ["external/lib/libpatchwork_rust.a", "external/lib/libpatchwork_rust_core.a"] -AUTOMERGE_CONFIG_OPTS = ["-DUTF32_INDEXING=true"] - - -def patchwork_rust_builder(target, source, env): - cmake_builder(EXTERNAL_DIR, PATCHWORK_RUST_DIR, PATCHWORK_RUST_BUILD_DIR, PATCHWORK_LIBS, AUTOMERGE_CONFIG_OPTS) - - -def build_patchwork_rust(module_obj): - SRC_SUFFIXES = ["*.h", "*.cpp", "*.rs", "*.txt"] - env_patchwork_editor["BUILDERS"]["PatchworkRustBuilder"] = Builder( - action=patchwork_rust_builder, - suffix=".a", - src_suffix=["*.h", "*.cpp", "*.rs", "*.txt"], - ) - - patchwork_rust_sources = get_sources(PATCHWORK_RUST_PREFIX, SRC_SUFFIXES) - env_patchwork_editor.Alias( - "patchworkrustlib", - [env_patchwork_editor.PatchworkRustBuilder(PATCHWORK_LIBS, patchwork_rust_sources)], - ) - add_libs_to_env(module_obj, PATCHWORK_LIBS, patchwork_rust_sources) - - -def doproc(cmd): - # ensure that it doesn't print stderr to the terminal if print_err is False - process = Popen(cmd, stdout=PIPE, stderr=PIPE) - (output, err) = process.communicate() - if not err: - return output.decode("utf-8").strip() - else: - return None - -semver_regex = r"^[vV]?(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" - - -def write_version_header(): - git = shutil.which("git") - version_info = "unknown" - is_tag = False - if git == None: - print("GDRE WARNING: cannot find git on path, unknown version will be saved in gdre_version.gen.h") - else: - # git describe --abbrev=6 - version_info = doproc([git, "describe", "--tags", "--abbrev=6"]) - if version_info is None: - print("GDRE WARNING: git failed to run, unknown version will be saved in gdre_version.gen.h") - version_info = "unknown" - else: - # git describe --exact-match --tags HEAD - res = doproc([git, "describe", "--exact-match", "--tags", "HEAD"]) - if not res: - splits = version_info.split("-") - build_info = splits[-1] - build_num = splits[-2] - # everything but the last two elements - new_version_info = "-".join(splits[:-2]) - semver_regex_match = re.match(semver_regex, new_version_info) - if semver_regex_match: - major = semver_regex_match.group("major") - minor = semver_regex_match.group("minor") - patch = semver_regex_match.group("patch") - prerelease_tag = semver_regex_match.group("prerelease") - build_metadata = semver_regex_match.group("buildmetadata") - else: - print("WARNING: version string does not match semver format") - splits = new_version_info.split(".") - if len(splits) < 3: - print("WARNING: version string is too short") - major = "0" - minor = "0" - patch = "0" - else: - major = splits[0] - minor = splits[1] - patch = splits[2] - prerelease_tag = "" - build_metadata = "" - dev_stuff = f"dev.{build_num}+{build_info}" - if prerelease_tag: - prerelease_name = prerelease_tag.split(".")[0] - prerelease_num = prerelease_tag.split(".")[-1] - if prerelease_num.isdigit(): - prerelease_num = str(int(prerelease_num) + 1) - print("prerelease_num", prerelease_num) - prerelease_tag = f"{prerelease_name}.{prerelease_num}" - else: - prerelease_tag += ".1" - new_version_info = f"{major}.{minor}.{patch}-{prerelease_tag}+{dev_stuff.replace('+', '-')}" - else: - patch = str(int(patch) + 1) if patch.isdigit() else 0 - new_version_info = f"{major}.{minor}.{patch}-{dev_stuff}" - version_info = new_version_info - else: - version_info = res - - f = open("editor/patchwork_version.gen.h", "w") - # check if we're not on a tag - process = Popen([git, "status", "--porcelain"], stdout=PIPE) - # define GDRE_VERSION "dev-poc (for Godot 4.0)" - f.write('#define GDRE_VERSION "') - f.write(version_info) - f.write('"\n') - f.close() - - -write_version_header() - -module_obj = [] - -env_patchwork_editor.add_source_files(module_obj, "*.cpp") -env_patchwork_editor.add_source_files(module_obj, "editor/*.cpp") -# build_patchwork_rust(module_obj) -env.modules_sources += module_obj diff --git a/assets/.gdignore b/assets/.gdignore deleted file mode 100644 index e69de29b..00000000 diff --git a/build.env b/build.env new file mode 100644 index 00000000..5eeb0361 --- /dev/null +++ b/build.env @@ -0,0 +1,13 @@ +# Endless projects +MODDABLE_PLATFORMER_REPO=endlessm/moddable-platformer +MODDABLE_PLATFORMER_REF=godot-4.6 +THREADBARE_REPO=endlessm/threadbare +THREADBARE_REF=godot-4.6 + +# Godot +GODOT_REPO=godotengine/godot.git +GODOT_REF=bb92a4c8e27e30cdec05ab6d540d724b9b3cfb72 + +# Godot formatters for LLVM +GODOT_FORMATTERS_REPO=nikitalita/GodotFormatters.git +GODOT_FORMATTERS_REF=master \ No newline at end of file diff --git a/config.py b/config.py deleted file mode 100644 index 76762382..00000000 --- a/config.py +++ /dev/null @@ -1,14 +0,0 @@ -def can_build(env, platform): - return env.editor_build - - -def configure(env): - pass - - -# def get_doc_classes(): -# return [] - - -# def get_doc_path(): -# return "doc_classes" diff --git a/editor/SCsub b/editor/SCsub new file mode 100644 index 00000000..a5f3c501 --- /dev/null +++ b/editor/SCsub @@ -0,0 +1,102 @@ +#!/usr/bin/env python +import re +import shutil +from subprocess import Popen, PIPE + +Import("env") +Import("env_modules") + +env_patchwork_editor = env_modules.Clone() +env_patchwork_editor["disable_exceptions"] = False + +env_patchwork_editor.Append(CPPPATH=["."]) + +def doproc(cmd): + # ensure that it doesn't print stderr to the terminal if print_err is False + process = Popen(cmd, stdout=PIPE, stderr=PIPE) + (output, err) = process.communicate() + if not err: + return output.decode("utf-8").strip() + else: + return None + +semver_regex = r"^[vV]?(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" + +# TODO (Lilith): Do we still need to do this? What's the point of this? +def write_version_header(): + git = shutil.which("git") + version_info = "unknown" + is_tag = False + if git == None: + print("GDRE WARNING: cannot find git on path, unknown version will be saved in gdre_version.gen.h") + else: + # git describe --abbrev=6 + version_info = doproc([git, "describe", "--tags", "--abbrev=6"]) + if version_info is None: + print("GDRE WARNING: git failed to run, unknown version will be saved in gdre_version.gen.h") + version_info = "unknown" + else: + # git describe --exact-match --tags HEAD + res = doproc([git, "describe", "--exact-match", "--tags", "HEAD"]) + if not res: + splits = version_info.split("-") + build_info = splits[-1] + build_num = splits[-2] + # everything but the last two elements + new_version_info = "-".join(splits[:-2]) + semver_regex_match = re.match(semver_regex, new_version_info) + if semver_regex_match: + major = semver_regex_match.group("major") + minor = semver_regex_match.group("minor") + patch = semver_regex_match.group("patch") + prerelease_tag = semver_regex_match.group("prerelease") + build_metadata = semver_regex_match.group("buildmetadata") + else: + print("WARNING: version string does not match semver format") + splits = new_version_info.split(".") + if len(splits) < 3: + print("WARNING: version string is too short") + major = "0" + minor = "0" + patch = "0" + else: + major = splits[0] + minor = splits[1] + patch = splits[2] + prerelease_tag = "" + build_metadata = "" + dev_stuff = f"dev.{build_num}+{build_info}" + if prerelease_tag: + prerelease_name = prerelease_tag.split(".")[0] + prerelease_num = prerelease_tag.split(".")[-1] + if prerelease_num.isdigit(): + prerelease_num = str(int(prerelease_num) + 1) + print("prerelease_num", prerelease_num) + prerelease_tag = f"{prerelease_name}.{prerelease_num}" + else: + prerelease_tag += ".1" + new_version_info = f"{major}.{minor}.{patch}-{prerelease_tag}+{dev_stuff.replace('+', '-')}" + else: + patch = str(int(patch) + 1) if patch.isdigit() else 0 + new_version_info = f"{major}.{minor}.{patch}-{dev_stuff}" + version_info = new_version_info + else: + version_info = res + + f = open("patchwork_version.gen.h", "w") + # check if we're not on a tag + process = Popen([git, "status", "--porcelain"], stdout=PIPE) + # define GDRE_VERSION "dev-poc (for Godot 4.0)" + f.write('#define GDRE_VERSION "') + f.write(version_info) + f.write('"\n') + f.close() + + +write_version_header() + +module_obj = [] + +env_patchwork_editor.add_source_files(module_obj, "*.cpp") +# build_patchwork_rust(module_obj) +env.modules_sources += module_obj diff --git a/editor/config.py b/editor/config.py new file mode 100644 index 00000000..47225fb3 --- /dev/null +++ b/editor/config.py @@ -0,0 +1,6 @@ +def can_build(env, platform): + return env.editor_build + + +def configure(env): + pass \ No newline at end of file diff --git a/editor/patchwork_editor.h b/editor/patchwork_editor.h index 551e86ba..6e126f94 100644 --- a/editor/patchwork_editor.h +++ b/editor/patchwork_editor.h @@ -1,8 +1,8 @@ #ifndef PATCHWORK_EDITOR_H #define PATCHWORK_EDITOR_H -#include "core/io/resource_importer.h" #include "core/object/ref_counted.h" +#include "core/io/resource_importer.h" #include "core/variant/dictionary.h" #include "core/variant/variant.h" #include "editor/editor_node.h" diff --git a/register_types.cpp b/editor/register_types.cpp similarity index 95% rename from register_types.cpp rename to editor/register_types.cpp index 3aaa3d26..739c98d5 100644 --- a/register_types.cpp +++ b/editor/register_types.cpp @@ -4,7 +4,7 @@ #include "register_types.h" #include "editor/editor_node.h" -#include "editor/patchwork_editor.h" +#include "patchwork_editor.h" void patchwork_editor_init_callback() { EditorNode *editor = EditorNode::get_singleton(); @@ -19,6 +19,9 @@ void initialize_patchwork_editor_module(ModuleInitializationLevel p_level) { ClassDB::register_class(); // register the editor inspector section } + + + } void uninitialize_patchwork_editor_module(ModuleInitializationLevel p_level) { diff --git a/register_types.h b/editor/register_types.h similarity index 99% rename from register_types.h rename to editor/register_types.h index cdc4d30f..8c1da247 100644 --- a/register_types.h +++ b/editor/register_types.h @@ -12,3 +12,4 @@ void uninitialize_patchwork_editor_module(ModuleInitializationLevel p_level); void init_ver_regex(); void free_ver_regex(); #endif // PATCHWORK_EDITOR_REGISTER_TYPES_H + diff --git a/justfile b/justfile new file mode 100644 index 00000000..6ba972aa --- /dev/null +++ b/justfile @@ -0,0 +1,378 @@ +set dotenv-load +set dotenv-filename := "build.env" +set dotenv-required + +# Get the default architecture +default_arch := shell("rustc --version --verbose | grep host | awk '{print $2}'") + +default: + just --list + +# Safely symlink src to dest +_symlink src dest: + #!/usr/bin/env python3 + # Use python for a cross-platform safe symlink that isn't dependent on Git bash installation settings + from pathlib import Path + src = Path("{{src}}") + dest = Path("{{dest}}") + if dest.exists(): + if not dest.is_symlink(): + print(f"Destination {{dest}} already exists and is NOT a symlink!") + exit(1) + + target = (dest.parent / dest.readlink()).resolve() + + if not target.samefile(src.resolve()): + print(f"Destination {{dest}} already exists, but it points to {target} instead of {src.resolve()}.") + exit(1) + + # symlink already exists and is valid + exit(0) + + try: + dest.symlink_to(src.resolve(), True) + exit(0) + except OSError as e: + print((f"Failed to create symlink from {dest.resolve()} to {src.resolve()}. " + "If you are on Windows, you MUST enable Developer Mode in system settings.")) + exit(1) + + +# Create build/ +@_make-build-dir: + mkdir -p build + +# Create build/patchwork +@_make-plugin-dir: _make-build-dir + mkdir -p build/patchwork + +# Clone a repository to a directory and check out a commit. +_clone repo_url directory checkout: + #!/usr/bin/env sh + # set -euxo pipefail + if [[ ! -d "{{directory}}" ]]; then + git clone "git@github.com:{{repo_url}}" "{{directory}}" + else + if git -C "{{directory}}" remote | grep -q '^origin$'; then + git -C "{{directory}}" remote set-url origin "git@github.com:{{repo_url}}" + else + git -C "{{directory}}" remote add origin "git@github.com:{{repo_url}}" + fi + fi + + # try checkout, if we get an error fetch then try again. + # this won't pull updates from the remote, but that's probably fine for now. + # if we need to handle local changes, this will need to be refactored (to force reset?) + if git -C "{{directory}}" checkout "{{checkout}}" | grep -q '^fatal'; then + git -C "{{directory}}" fetch --all + git -C "{{directory}}" checkout "{{checkout}}" + fi + + +# Clone our desired project and checkout the proper commit. +[arg('project', pattern='moddable-platformer|threadbare')] +_acquire-project project: _make-build-dir + #!/usr/bin/env sh + # set -euxo pipefail + if [[ "{{project}}" = "moddable-platformer" ]]; then + just _clone "$MODDABLE_PLATFORMER_REPO" "build/{{project}}" "$MODDABLE_PLATFORMER_REF" + else + just _clone "$THREADBARE_REPO" "build/{{project}}" "$THREADBARE_REF" + fi + +# Clone the Godot repository and checkout the proper commit. +_acquire-godot: _make-build-dir + just _clone "$GODOT_REPO" "build/godot" "$GODOT_REF" + +# Clone the GodotFormatters repository and checkout the proper commit. +_acquire-formatters: _make-build-dir + just _clone "$GODOT_FORMATTERS_REPO" "build/GodotFormatters" "$GODOT_FORMATTERS_REF" + +# Link our plugin build directory to the desired project. +_link-project project: (_acquire-project project) _make-plugin-dir + mkdir -p "build/{{project}}/addons" + just _symlink "build/patchwork" "build/{{project}}/addons/patchwork" + +# Link our custom Godot editor module +_link-godot: _acquire-godot + mkdir -p "build/godot/" + just _symlink "editor" "build/godot/modules/patchwork_editor" + +# Link the assets directory for our plugin +_link-public: _make-plugin-dir + just _symlink "public" "build/patchwork/public" + +# Build the Godot editor with our editor module linked in. Available profiles are release, debug, or sani (for use_asan=yes) +[arg('profile', pattern='release|debug|sani')] +build-godot profile: _link-godot + #!/usr/bin/env sh + # set -euxo pipefail + cd "build/godot" + # TODO: figure out a way to see if scons actually needs a run, since this takes forever even when built + if [[ {{profile}} = "release" ]] ; then + scons dev_build=no debug_symbols=no target=editor deprecated=yes minizip=yes compiledb=yes metal=no module_text_server_fb_enabled=yes + elif [[ {{profile}} = "sani" ]] ; then + scons dev_build=yes target=editor compiledb=yes deprecated=yes minizip=yes tests=yes use_asan=yes metal=no module_text_server_fb_enabled=yes + else + scons dev_build=yes target=editor compiledb=yes deprecated=yes minizip=yes tests=yes metal=no module_text_server_fb_enabled=yes + fi + +# Build the Rust plugin binaries. +_build-plugin architecture profile: + cargo build --profile="{{profile}}" --target="{{architecture}}" + +# Build the multi-arch target for MacOS. +[parallel] +_build-plugin-all-macos profile: (_build-plugin "aarch64-apple-darwin" profile) (_build-plugin "x86_64-apple-darwin" profile) _make-plugin-dir + mkdir -p build/patchwork/bin + + # Copy the entire macos directory to get the Resources framework directory + rm -rf "build/patchwork/bin/libpatchwork_rust_core.macos.framework" + cp -r "rust/macos/libpatchwork_rust_core.macos.framework" "build/patchwork/bin/libpatchwork_rust_core.macos.framework" + + # Rather than copying the generated .dylibs, we combine them into a single one. + lipo -create -output build/patchwork/bin/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.dylib \ + target/aarch64-apple-darwin/{{profile}}/libpatchwork_rust_core.dylib \ + target/x86_64-apple-darwin/{{profile}}/libpatchwork_rust_core.dylib + # TODO: Perhaps sign here instead of in github actions? + +[parallel] +_build-plugin-single-arch architecture profile: (_build-plugin architecture profile) _make-plugin-dir + #!/usr/bin/env sh + # set -euo pipefail + mkdir -p build/patchwork/bin + + # Copy the entire macos directory to get the Resources framework directory + rm -rf "build/patchwork/bin/libpatchwork_rust_core.macos.framework" + cp -r "rust/macos/libpatchwork_rust_core.macos.framework" "build/patchwork/bin/libpatchwork_rust_core.macos.framework" + + if [ -f "target/{{architecture}}/{{profile}}/patchwork_rust_core.dll" ] ; then + cp "target/{{architecture}}/{{profile}}/patchwork_rust_core.dll" \ + build/patchwork/bin/patchwork_rust_core.windows.{{architecture}}.dll + fi + + if [ -f "target/{{architecture}}/{{profile}}/libpatchwork_rust_core.so" ] ; then + cp "target/{{architecture}}/{{profile}}/libpatchwork_rust_core.so" \ + build/patchwork/bin/patchwork_rust_core.linux.{{architecture}}.so + fi + + if [ -f "target/{{architecture}}/{{profile}}/libpatchwork_rust_core.dylib" ] ; then + cp "target/{{architecture}}/{{profile}}/libpatchwork_rust_core.dylib" \ + build/patchwork/bin/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib + fi + + if [ -f "target/{{architecture}}/{{profile}}/patchwork_rust_core.pdb" ] ; then + cp "target/{{architecture}}/{{profile}}/patchwork_rust_core.pdb" \ + build/patchwork/bin/patchwork_rust_core.pdb + fi + +# Write plugin.cfg and Patchwork.gdextension +_configure-patchwork: _make-plugin-dir + #!/usr/bin/env python3 + import os + import subprocess + + # load the version from git + print(f"Current directory: {os.getcwd()}") + print(os.listdir()) + + git_describe = subprocess.check_output(["git", "describe", "--tags", "--abbrev=6"]).decode("utf-8").strip() + + # if it has more than two `-` in the version, replace all the subsequent `-` with `+` + if git_describe.count("-") >= 2: + first_index = git_describe.find("-") + if first_index != -1: + git_describe = git_describe[:first_index] + "-" + git_describe[first_index + 1 :].replace("-", "+") + + print(f"Loaded version from Git repository: {git_describe}") + + with open("build/patchwork/plugin.cfg", "a") as file: + file.write(f"""[plugin] + name="Patchwork" + description="Version control for Godot" + author="Ink & Switch" + version="{git_describe}" + script="" + """) + + with open("build/patchwork/Patchwork.gdextension", "a") as file: + file.write(f"""[configuration] + entry_symbol = "gdext_rust_init" + compatibility_minimum = 4.6 + reloadable = true + + [libraries] + linux.debug.x86_64 = "bin/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" + linux.release.x86_64 = "bin/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" + linux.debug.arm64 = "bin/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" + linux.release.arm64 = "bin/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" + linux.debug.arm32 = "bin/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" + linux.release.arm32 = "bin/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" + windows.debug.x86_64 = "bin/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" + windows.release.x86_64 = "bin/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" + windows.debug.arm64 = "bin/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" + windows.release.arm64 = "bin/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" + macos.debug = "bin/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" + macos.release = "bin/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" + """) + +# Build the plugin and output it to the plugin build dir. For MacOS multi-arch, use architecture=all-apple-darwin to build all architectures. +[parallel] +[arg('profile', pattern='release|debug')] +build-patchwork profile architecture=(default_arch): _configure-patchwork _link-public + #!/usr/bin/env sh + # set -euxo pipefail + if [[ "{{architecture}}" = "all-apple-darwin" ]] ; then + just _build-plugin-all-macos "{{profile}}" + exit 0 + fi + + profile="release" + if [[ "{{profile}}" = "debug" ]] ; then + profile="release_debug" + fi + + just _build-plugin-single-arch "{{architecture}}" "$profile" + +# Reset the Godot repository, removing the linked module and resetting the repo state. +clean-godot: + #!/usr/bin/env sh + # set -euxo pipefail + if [[ ! -d "build" ]]; then + exit 0 + fi + cd "build" + + # set -euxo pipefail + if [[ ! -d "godot" ]]; then + exit 0 + fi + cd godot + git checkout -f $GODOT_REF + git clean -xdf + +# Remove any built Patchwork artifacts. +clean-patchwork: + #!/usr/bin/env sh + # set -euxo pipefail + cargo clean + if [[ ! -d "build/patchwork" ]]; then + exit 0 + fi + rm -rf "build/patchwork" + +# Clean a single project, resetting the repository and unlinking Patchwork. +[arg('project', pattern='moddable-platformer|threadbare')] +clean-project project: + #!/usr/bin/env sh + # set -euxo pipefail + if [[ "{{project}}" = "moddable-platformer" ]]; then + checkout="$MODDABLE_PLATFORMER_REF" + else + checkout="$THREADBARE_REF" + fi + + if [[ ! -d "build" ]]; then + exit 0 + fi + cd "build" + + if [[ ! -d "{{project}}" ]]; then + exit 0 + fi + cd {{project}} + git checkout -f "$checkout" + git clean -xdf + +# Clean Patchwork, and the projects threadbare, moddable-platformer. +clean: (clean-project "threadbare") (clean-project "moddable-platformer") clean-patchwork + +# Write to the project .cfg with a new server url +[arg('project', pattern='moddable-platformer|threadbare')] +_write-url project url: (_link-project project) + #!/usr/bin/env python3 + import os + import subprocess + from pathlib import Path + + # For now, if the URL is blank (default), don't touch the config. + # When we have an actual serve command, we can then expect the user to always specify. + if {{url}} == "": + exit(0) + + path = "build/{{project}}/patchwork.cfg" + + try: + f = open(path) + except FileNotFoundError: + lines = [] + else: + with f: lines = f.readlines() + + new_lines: list[str] = [] + found_patchwork = False + for line in lines: + # place the server url immediately after patchwork + if line.startswith("[patchwork]"): + found_patchwork = True + new_lines.append(line) + new_lines.append('server_url="{{url}}"\n') + # skip future server URLs + elif not line.startswith("server_url="): + new_lines.append(line) + + if not found_patchwork: + new_lines = ['[patchwork]\n', 'server_url="{{url}}"'] + + with open(path, "w") as file: + file.writelines(new_lines) + +# Prepare a project for launch with Godot. Available projects are threadbare, moddable-platformer. +[parallel] +[arg('project', pattern='moddable-platformer|threadbare')] +[arg('patchwork_profile', pattern='release|debug')] +[arg('godot_profile', pattern='release|debug|sani')] +prepare project="moddable-platformer" patchwork_profile="release" godot_profile="release" server_url="":\ + (_link-project project) (build-godot godot_profile) (build-patchwork patchwork_profile) + + +# Launch a project with Godot. Available projects are threadbare, moddable-platformer. +[arg('project', pattern='moddable-platformer|threadbare')] +[arg('patchwork_profile', pattern='release|debug')] +[arg('godot_profile', pattern='release|debug|sani')] +launch project="moddable-platformer" patchwork_profile="release" godot_profile="release" server_url="": \ + (prepare project patchwork_profile godot_profile server_url) + #!/usr/bin/env sh + # set -euxo pipefail + + case "{{arch()}}" in + "x86_64") + arch=x86_64 ;; + "aarch64") + arch=arm64 ;; + *) + echo "Unsupported architecture for development: {{arch()}}." + echo "If you think this architecture should be supported, please open an issue on Github with your use-case and system details." + exit 1 ;; + esac + + case "{{os()}}" in + "windows") + ext=".exe" ;; + "linux") + ext="" ;; + "macos") + ext="" ;; + *) + echo "Unsupported OS for development: {{os()}}." + echo "If you think this OS should be supported, please open an issue on Github with your use-case and system details." + exit 1 ;; + esac + + if [[ {{godot_profile}} = "release" ]] ; then + godot_path="build/godot/bin/godot.{{os()}}.editor.$arch$ext" + else + godot_path="build/godot/bin/godot.{{os()}}.editor.dev.$arch$ext" + fi + + $godot_path -e --path "build/{{project}}" \ No newline at end of file diff --git a/plugin.cfg b/plugin.cfg deleted file mode 100644 index 87d34621..00000000 --- a/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="Patchwork" -description="version control for godot" -author="" -version="v0.0.1-alpha.19" -script="" diff --git a/gdscript/diff_editor_theme.tres b/public/gdscript/diff_editor_theme.tres similarity index 100% rename from gdscript/diff_editor_theme.tres rename to public/gdscript/diff_editor_theme.tres diff --git a/gdscript/diff_inspector_container.gd b/public/gdscript/diff_inspector_container.gd similarity index 100% rename from gdscript/diff_inspector_container.gd rename to public/gdscript/diff_inspector_container.gd diff --git a/gdscript/diff_inspector_container.gd.uid b/public/gdscript/diff_inspector_container.gd.uid similarity index 100% rename from gdscript/diff_inspector_container.gd.uid rename to public/gdscript/diff_inspector_container.gd.uid diff --git a/gdscript/diff_stylebox_tex.png b/public/gdscript/diff_stylebox_tex.png similarity index 100% rename from gdscript/diff_stylebox_tex.png rename to public/gdscript/diff_stylebox_tex.png diff --git a/gdscript/diff_stylebox_tex.png.import b/public/gdscript/diff_stylebox_tex.png.import similarity index 73% rename from gdscript/diff_stylebox_tex.png.import rename to public/gdscript/diff_stylebox_tex.png.import index 963986cf..fc896d49 100644 --- a/gdscript/diff_stylebox_tex.png.import +++ b/public/gdscript/diff_stylebox_tex.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://do66plo2fdvr7" -path="res://.godot/imported/diff_stylebox_tex.png-2dbe174f4bcbcc82b867ba7022d11459.ctex" +path="res://.godot/imported/diff_stylebox_tex.png-573a98e9d9c11088d79e6fddae5308b9.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/gdscript/diff_stylebox_tex.png" -dest_files=["res://.godot/imported/diff_stylebox_tex.png-2dbe174f4bcbcc82b867ba7022d11459.ctex"] +source_file="res://addons/patchwork/public/gdscript/diff_stylebox_tex.png" +dest_files=["res://.godot/imported/diff_stylebox_tex.png-573a98e9d9c11088d79e6fddae5308b9.ctex"] [params] diff --git a/gdscript/highlight_changes_layer.gd b/public/gdscript/highlight_changes_layer.gd similarity index 98% rename from gdscript/highlight_changes_layer.gd rename to public/gdscript/highlight_changes_layer.gd index 69c05f74..fa2993e0 100644 --- a/gdscript/highlight_changes_layer.gd +++ b/public/gdscript/highlight_changes_layer.gd @@ -23,7 +23,7 @@ func _ready(): # Create and assign the shader material shader_material = ShaderMaterial.new() - var shader = load("res://addons/patchwork/gdscript/highlight_shader.gdshader") + var shader = load("res://addons/patchwork/public/gdscript/highlight_shader.gdshader") shader_material.shader = shader color_rect.material = shader_material diff --git a/gdscript/highlight_changes_layer.gd.uid b/public/gdscript/highlight_changes_layer.gd.uid similarity index 100% rename from gdscript/highlight_changes_layer.gd.uid rename to public/gdscript/highlight_changes_layer.gd.uid diff --git a/gdscript/highlight_shader.gdshader b/public/gdscript/highlight_shader.gdshader similarity index 100% rename from gdscript/highlight_shader.gdshader rename to public/gdscript/highlight_shader.gdshader diff --git a/gdscript/highlight_shader.gdshader.uid b/public/gdscript/highlight_shader.gdshader.uid similarity index 100% rename from gdscript/highlight_shader.gdshader.uid rename to public/gdscript/highlight_shader.gdshader.uid diff --git a/gdscript/patchwork_config.gd.uid b/public/gdscript/patchwork_config.gd.uid similarity index 100% rename from gdscript/patchwork_config.gd.uid rename to public/gdscript/patchwork_config.gd.uid diff --git a/gdscript/sidebar.gd b/public/gdscript/sidebar.gd similarity index 97% rename from gdscript/sidebar.gd rename to public/gdscript/sidebar.gd index 63fc3a4f..f8db7583 100644 --- a/gdscript/sidebar.gd +++ b/public/gdscript/sidebar.gd @@ -4,7 +4,7 @@ extends MarginContainer # Godot 3.x: something.connect("signal_name", self, "_on_signal_name") # Godot 4.x: something.connect("signal_name", self._on_signal_name) -const diff_inspector_script = preload("res://addons/patchwork/gdscript/diff_inspector_container.gd") +const diff_inspector_script = preload("res://addons/patchwork/public/gdscript/diff_inspector_container.gd") @onready var branch_picker: OptionButton = %BranchPicker @onready var history_tree: Tree = %HistoryTree @onready var history_list_popup: PopupMenu = %HistoryListPopup @@ -464,20 +464,20 @@ func confirm_merge_preview(): func toggle_section(section_header: Button, section_body: Control): var parent_vbox = section_header.get_parent() if section_body.visible: - section_header.icon = load("res://addons/patchwork/icons/collapsable-closed.svg") + section_header.icon = load("res://addons/patchwork/public/icons/collapsable-closed.svg") section_body.visible = false parent_vbox.set_v_size_flags(Control.SIZE_FILL) else: - section_header.icon = load("res://addons/patchwork/icons/collapsable-open.svg") + section_header.icon = load("res://addons/patchwork/public/icons/collapsable-open.svg") section_body.visible = true parent_vbox.set_v_size_flags(Control.SIZE_EXPAND_FILL) func unfold_section(section_header: Button, section_body: Control): - section_header.icon = load("res://addons/patchwork/icons/collapsable-open.svg") + section_header.icon = load("res://addons/patchwork/public/icons/collapsable-open.svg") section_body.visible = true func fold_section(section_header: Button, section_body: Control): - section_header.icon = load("res://addons/patchwork/icons/collapsable-closed.svg") + section_header.icon = load("res://addons/patchwork/public/icons/collapsable-closed.svg") section_body.visible = false func update_history_tree(): @@ -520,7 +520,7 @@ func update_history_tree(): # Sometimes this is null while starting up, before the branch has loaded in. # If so the button will just appear later when we update UI. if merged_branch: - item.add_button(HistoryColumns.TEXT, load("res://addons/patchwork/icons/branch-icon-history.svg"), 0, + item.add_button(HistoryColumns.TEXT, load("res://addons/patchwork/public/icons/branch-icon-history.svg"), 0, false, "Checkout branch " + merged_branch.name) item.set_text(HistoryColumns.TEXT, change.summary) @@ -593,10 +593,10 @@ func update_merge_preview(): if !GodotProject.is_safe_to_merge(): merge_preview_message_label.text = "\"" + target_branch.name + "\" has changed since \"" + source_branch.name + "\" was created.\nBe careful and review your changes before merging." - merge_preview_message_icon.texture = load("res://addons/patchwork/icons/warning-circle.svg") + merge_preview_message_icon.texture = load("res://addons/patchwork/public/icons/warning-circle.svg") else: merge_preview_message_label.text = "This branch is safe to merge.\n \"" + target_branch.name + "\" hasn't changed since \"" + source_branch.name + "\" was created." - merge_preview_message_icon.texture = load("res://addons/patchwork/icons/checkmark-circle.svg") + merge_preview_message_icon.texture = load("res://addons/patchwork/public/icons/checkmark-circle.svg") func update_revert_preview(): var active = GodotProject.is_revert_preview_branch_active() @@ -639,19 +639,19 @@ func update_sync_status() -> void: var sync_status = GodotProject.get_sync_status() if sync_status.state == "unknown": - sync_status_icon.texture_normal = load("res://addons/patchwork/icons/circle-alert.svg") + sync_status_icon.texture_normal = load("res://addons/patchwork/public/icons/circle-alert.svg") sync_status_icon.tooltip_text = "Disconnected - might have unsynced changes" elif sync_status.state == "syncing": - sync_status_icon.texture_normal = load("res://addons/patchwork/icons/circle-sync.svg") + sync_status_icon.texture_normal = load("res://addons/patchwork/public/icons/circle-sync.svg") sync_status_icon.tooltip_text = "Syncing" elif sync_status.state == "up_to_date": - sync_status_icon.texture_normal = load("res://addons/patchwork/icons/circle-check.svg") + sync_status_icon.texture_normal = load("res://addons/patchwork/public/icons/circle-check.svg") sync_status_icon.tooltip_text = "Fully synced" elif sync_status.state == "disconnected": - sync_status_icon.texture_normal = load("res://addons/patchwork/icons/circle-alert.svg") + sync_status_icon.texture_normal = load("res://addons/patchwork/public/icons/circle-alert.svg") if sync_status.unsynced_changes == 0: sync_status_icon.tooltip_text = "Disconnected - no unsynced local changes" elif sync_status.unsynced_changes == 1: @@ -689,7 +689,7 @@ func add_branch_to_picker(branch: Dictionary, selected_branch_id: String, indent # this should not happen, but right now the sync is not working correctly so we need to surface this in the interface if !branch.is_loaded: - branch_picker.set_item_icon(branch_index, load("res://addons/patchwork/icons/warning.svg")) + branch_picker.set_item_icon(branch_index, load("res://addons/patchwork/public/icons/warning.svg")) branch_picker.set_item_metadata(branch_index, branch.id) @@ -776,7 +776,7 @@ func setup_history_list_popup() -> void: # TODO: adjust this when more items are added history_list_popup.max_size.y = 48 * EditorInterface.get_editor_scale() history_list_popup.id_pressed.connect(_on_history_list_popup_id_pressed) - history_list_popup.add_icon_item(load("res://addons/patchwork/icons/undo-redo.svg"), "Reset to here", HistoryListPopupItem.RESET_TO_COMMIT) + history_list_popup.add_icon_item(load("res://addons/patchwork/public/icons/undo-redo.svg"), "Reset to here", HistoryListPopupItem.RESET_TO_COMMIT) # history_list_popup.add_item("Create remix from here", HistoryListPopupItem.CREATE_BRANCH_AT_COMMIT) func _on_history_tree_mouse_selected(_at_position: Vector2, button_idx: int) -> void: diff --git a/gdscript/sidebar.gd.uid b/public/gdscript/sidebar.gd.uid similarity index 100% rename from gdscript/sidebar.gd.uid rename to public/gdscript/sidebar.gd.uid diff --git a/gdscript/sidebar.tscn b/public/gdscript/sidebar.tscn similarity index 96% rename from gdscript/sidebar.tscn rename to public/gdscript/sidebar.tscn index 02f75db4..27721478 100644 --- a/gdscript/sidebar.tscn +++ b/public/gdscript/sidebar.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=19 format=3 uid="uid://cxyjgsyba1v85"] -[ext_resource type="Script" uid="uid://bxgybx6gjahju" path="res://addons/patchwork/gdscript/sidebar.gd" id="1_ebh36"] -[ext_resource type="Texture2D" uid="uid://ceyam02frwm6g" path="res://addons/patchwork/icons/circle-check.svg" id="2_of6ia"] -[ext_resource type="Texture2D" uid="uid://xec6o14n4y2v" path="res://addons/patchwork/icons/person.svg" id="3_m2w8q"] -[ext_resource type="Theme" uid="uid://hr3cor4s2ov2" path="res://addons/patchwork/gdscript/diff_editor_theme.tres" id="4_7letu"] -[ext_resource type="Texture2D" uid="uid://blu0iomxyyu3k" path="res://addons/patchwork/icons/collapsable-open.svg" id="4_of6ia"] -[ext_resource type="Script" uid="uid://d145i10hos3c6" path="res://addons/patchwork/gdscript/diff_inspector_container.gd" id="4_uttw7"] -[ext_resource type="Texture2D" uid="uid://bu0h5oa7aoanu" path="res://addons/patchwork/icons/sign-add-svgrepo-com.svg" id="5_iqebc"] -[ext_resource type="Texture2D" uid="uid://cy3bt4icrwm3w" path="res://addons/patchwork/icons/remove-svgrepo-com.svg" id="6_ha5pl"] -[ext_resource type="Texture2D" uid="uid://mr0rb0dbfyws" path="res://addons/patchwork/icons/edit-two-svgrepo-com.svg" id="7_o8jin"] -[ext_resource type="Texture2D" uid="uid://crrc8r8dr3cbu" path="res://addons/patchwork/icons/branch-icon.svg" id="7_qb0q7"] -[ext_resource type="Texture2D" uid="uid://b3jhx5bvcdswo" path="res://addons/patchwork/icons/warning-circle.svg" id="9_p7w5p"] -[ext_resource type="Texture2D" uid="uid://4obywo8ddx25" path="res://addons/patchwork/icons/arrow.svg" id="9_xrl6o"] +[ext_resource type="Script" uid="uid://bxgybx6gjahju" path="res://addons/patchwork/public/gdscript/sidebar.gd" id="1_ebh36"] +[ext_resource type="Texture2D" uid="uid://ceyam02frwm6g" path="res://addons/patchwork/public/icons/circle-check.svg" id="2_of6ia"] +[ext_resource type="Texture2D" uid="uid://xec6o14n4y2v" path="res://addons/patchwork/public/icons/person.svg" id="3_m2w8q"] +[ext_resource type="Theme" uid="uid://hr3cor4s2ov2" path="res://addons/patchwork/public/gdscript/diff_editor_theme.tres" id="4_7letu"] +[ext_resource type="Texture2D" uid="uid://blu0iomxyyu3k" path="res://addons/patchwork/public/icons/collapsable-open.svg" id="4_of6ia"] +[ext_resource type="Script" uid="uid://d145i10hos3c6" path="res://addons/patchwork/public/gdscript/diff_inspector_container.gd" id="4_uttw7"] +[ext_resource type="Texture2D" uid="uid://bu0h5oa7aoanu" path="res://addons/patchwork/public/icons/sign-add-svgrepo-com.svg" id="5_iqebc"] +[ext_resource type="Texture2D" uid="uid://cy3bt4icrwm3w" path="res://addons/patchwork/public/icons/remove-svgrepo-com.svg" id="6_ha5pl"] +[ext_resource type="Texture2D" uid="uid://mr0rb0dbfyws" path="res://addons/patchwork/public/icons/edit-two-svgrepo-com.svg" id="7_o8jin"] +[ext_resource type="Texture2D" uid="uid://crrc8r8dr3cbu" path="res://addons/patchwork/public/icons/branch-icon.svg" id="7_qb0q7"] +[ext_resource type="Texture2D" uid="uid://b3jhx5bvcdswo" path="res://addons/patchwork/public/icons/warning-circle.svg" id="9_p7w5p"] +[ext_resource type="Texture2D" uid="uid://4obywo8ddx25" path="res://addons/patchwork/public/icons/arrow.svg" id="9_xrl6o"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_of6ia"] bg_color = Color(0.129412, 0.14902, 0.180392, 1) diff --git a/gdscript/sticky_note.gd b/public/gdscript/sticky_note.gd similarity index 100% rename from gdscript/sticky_note.gd rename to public/gdscript/sticky_note.gd diff --git a/gdscript/sticky_note.gd.uid b/public/gdscript/sticky_note.gd.uid similarity index 100% rename from gdscript/sticky_note.gd.uid rename to public/gdscript/sticky_note.gd.uid diff --git a/gdscript/sticky_note.tscn b/public/gdscript/sticky_note.tscn similarity index 94% rename from gdscript/sticky_note.tscn rename to public/gdscript/sticky_note.tscn index 27bd26af..15bfdd9f 100644 --- a/gdscript/sticky_note.tscn +++ b/public/gdscript/sticky_note.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://b853277vwgxxm"] -[ext_resource type="Script" uid="uid://bsvqjddqcc6vw" path="res://addons/patchwork/gdscript/sticky_note.gd" id="1_rpp8a"] +[ext_resource type="Script" uid="uid://bsvqjddqcc6vw" path="res://addons/patchwork/public/gdscript/sticky_note.gd" id="1_rpp8a"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_rpp8a"] bg_color = Color(1, 0.862745, 0, 1) diff --git a/gdscript/task_modal.gd b/public/gdscript/task_modal.gd similarity index 100% rename from gdscript/task_modal.gd rename to public/gdscript/task_modal.gd diff --git a/gdscript/task_modal.gd.uid b/public/gdscript/task_modal.gd.uid similarity index 100% rename from gdscript/task_modal.gd.uid rename to public/gdscript/task_modal.gd.uid diff --git a/gdscript/test_Scene.tscn b/public/gdscript/test_Scene.tscn similarity index 87% rename from gdscript/test_Scene.tscn rename to public/gdscript/test_Scene.tscn index 8dc303b9..2be0f59a 100644 --- a/gdscript/test_Scene.tscn +++ b/public/gdscript/test_Scene.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=5 format=3 uid="uid://12d4178fctf5"] -[ext_resource type="Texture2D" uid="uid://cy3bt4icrwm3w" path="res://addons/patchwork/icons/remove-svgrepo-com.svg" id="1_jfbnn"] -[ext_resource type="Texture2D" uid="uid://bugirug2evvpe" path="res://addons/patchwork/gdscript/thing.png" id="2_7omcb"] -[ext_resource type="Texture2D" uid="uid://do66plo2fdvr7" path="res://addons/patchwork/gdscript/diff_stylebox_tex.png" id="3_3jpv1"] +[ext_resource type="Texture2D" uid="uid://cy3bt4icrwm3w" path="res://addons/patchwork/public/icons/remove-svgrepo-com.svg" id="1_jfbnn"] +[ext_resource type="Texture2D" uid="uid://bugirug2evvpe" path="res://addons/patchwork/public/gdscript/thing.png" id="2_7omcb"] +[ext_resource type="Texture2D" uid="uid://do66plo2fdvr7" path="res://addons/patchwork/public/gdscript/diff_stylebox_tex.png" id="3_3jpv1"] [sub_resource type="StyleBoxTexture" id="StyleBoxTexture_i0747"] texture = ExtResource("3_3jpv1") diff --git a/gdscript/thing.png b/public/gdscript/thing.png similarity index 100% rename from gdscript/thing.png rename to public/gdscript/thing.png diff --git a/gdscript/thing.png.import b/public/gdscript/thing.png.import similarity index 76% rename from gdscript/thing.png.import rename to public/gdscript/thing.png.import index 5562c5e6..bdce262d 100644 --- a/gdscript/thing.png.import +++ b/public/gdscript/thing.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bugirug2evvpe" -path="res://.godot/imported/thing.png-d95c84a70ef0adb70438796fa095e000.ctex" +path="res://.godot/imported/thing.png-cc5fa0c05993da4e76dadc5452705502.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/gdscript/thing.png" -dest_files=["res://.godot/imported/thing.png-d95c84a70ef0adb70438796fa095e000.ctex"] +source_file="res://addons/patchwork/public/gdscript/thing.png" +dest_files=["res://.godot/imported/thing.png-cc5fa0c05993da4e76dadc5452705502.ctex"] [params] diff --git a/gdscript/utils.gd b/public/gdscript/utils.gd similarity index 100% rename from gdscript/utils.gd rename to public/gdscript/utils.gd diff --git a/gdscript/utils.gd.uid b/public/gdscript/utils.gd.uid similarity index 100% rename from gdscript/utils.gd.uid rename to public/gdscript/utils.gd.uid diff --git a/icons/GuiTabMenuHl.svg b/public/icons/GuiTabMenuHl.svg similarity index 100% rename from icons/GuiTabMenuHl.svg rename to public/icons/GuiTabMenuHl.svg diff --git a/icons/GuiTabMenuHl.svg.import b/public/icons/GuiTabMenuHl.svg.import similarity index 77% rename from icons/GuiTabMenuHl.svg.import rename to public/icons/GuiTabMenuHl.svg.import index c55743bb..3aee02bd 100644 --- a/icons/GuiTabMenuHl.svg.import +++ b/public/icons/GuiTabMenuHl.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://ymewwqpn0vi4" -path="res://.godot/imported/GuiTabMenuHl.svg-b2447c83b04d5d1ebc07b46a44527932.ctex" +path="res://.godot/imported/GuiTabMenuHl.svg-96d22ff765433578d20d34219e553d4d.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/GuiTabMenuHl.svg" -dest_files=["res://.godot/imported/GuiTabMenuHl.svg-b2447c83b04d5d1ebc07b46a44527932.ctex"] +source_file="res://addons/patchwork/public/icons/GuiTabMenuHl.svg" +dest_files=["res://.godot/imported/GuiTabMenuHl.svg-96d22ff765433578d20d34219e553d4d.ctex"] [params] diff --git a/icons/GuiTabMenuHl_rotated.svg b/public/icons/GuiTabMenuHl_rotated.svg similarity index 100% rename from icons/GuiTabMenuHl_rotated.svg rename to public/icons/GuiTabMenuHl_rotated.svg diff --git a/icons/GuiTabMenuHl_rotated.svg.import b/public/icons/GuiTabMenuHl_rotated.svg.import similarity index 75% rename from icons/GuiTabMenuHl_rotated.svg.import rename to public/icons/GuiTabMenuHl_rotated.svg.import index 36b73960..44eca560 100644 --- a/icons/GuiTabMenuHl_rotated.svg.import +++ b/public/icons/GuiTabMenuHl_rotated.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dl27ecpxoon8a" -path="res://.godot/imported/GuiTabMenuHl_rotated.svg-215fe1588691cf1893f7732fe2fb09eb.ctex" +path="res://.godot/imported/GuiTabMenuHl_rotated.svg-16fcd1a56387d63d18efc6c31d1200db.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/GuiTabMenuHl_rotated.svg" -dest_files=["res://.godot/imported/GuiTabMenuHl_rotated.svg-215fe1588691cf1893f7732fe2fb09eb.ctex"] +source_file="res://addons/patchwork/public/icons/GuiTabMenuHl_rotated.svg" +dest_files=["res://.godot/imported/GuiTabMenuHl_rotated.svg-16fcd1a56387d63d18efc6c31d1200db.ctex"] [params] diff --git a/icons/arrow.svg b/public/icons/arrow.svg similarity index 100% rename from icons/arrow.svg rename to public/icons/arrow.svg diff --git a/icons/arrow.svg.import b/public/icons/arrow.svg.import similarity index 78% rename from icons/arrow.svg.import rename to public/icons/arrow.svg.import index b3108be7..89cf136d 100644 --- a/icons/arrow.svg.import +++ b/public/icons/arrow.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://4obywo8ddx25" -path="res://.godot/imported/arrow.svg-246d8d46ce07dd73a0530b66dcff2231.ctex" +path="res://.godot/imported/arrow.svg-bcd9a836cfd3b85698c1696cd7bb9321.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/arrow.svg" -dest_files=["res://.godot/imported/arrow.svg-246d8d46ce07dd73a0530b66dcff2231.ctex"] +source_file="res://addons/patchwork/public/icons/arrow.svg" +dest_files=["res://.godot/imported/arrow.svg-bcd9a836cfd3b85698c1696cd7bb9321.ctex"] [params] diff --git a/icons/branch-icon-history.svg b/public/icons/branch-icon-history.svg similarity index 100% rename from icons/branch-icon-history.svg rename to public/icons/branch-icon-history.svg diff --git a/icons/branch-icon-history.svg.import b/public/icons/branch-icon-history.svg.import similarity index 75% rename from icons/branch-icon-history.svg.import rename to public/icons/branch-icon-history.svg.import index 92dfe782..f620d4cb 100644 --- a/icons/branch-icon-history.svg.import +++ b/public/icons/branch-icon-history.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bh3yfjam1ousp" -path="res://.godot/imported/branch-icon-history.svg-3becca55656b6a1515bf220dbbd791b7.ctex" +path="res://.godot/imported/branch-icon-history.svg-4545928a611f6dad29db728570a68e4b.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/branch-icon-history.svg" -dest_files=["res://.godot/imported/branch-icon-history.svg-3becca55656b6a1515bf220dbbd791b7.ctex"] +source_file="res://addons/patchwork/public/icons/branch-icon-history.svg" +dest_files=["res://.godot/imported/branch-icon-history.svg-4545928a611f6dad29db728570a68e4b.ctex"] [params] diff --git a/icons/branch-icon.svg b/public/icons/branch-icon.svg similarity index 100% rename from icons/branch-icon.svg rename to public/icons/branch-icon.svg diff --git a/icons/branch-icon.svg.import b/public/icons/branch-icon.svg.import similarity index 77% rename from icons/branch-icon.svg.import rename to public/icons/branch-icon.svg.import index f1fed706..d0be527b 100644 --- a/icons/branch-icon.svg.import +++ b/public/icons/branch-icon.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://crrc8r8dr3cbu" -path="res://.godot/imported/branch-icon.svg-c91c720eae8869999e5dcc5a7734f859.ctex" +path="res://.godot/imported/branch-icon.svg-0718c16fd57484242e92f10e7dbcbab7.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/branch-icon.svg" -dest_files=["res://.godot/imported/branch-icon.svg-c91c720eae8869999e5dcc5a7734f859.ctex"] +source_file="res://addons/patchwork/public/icons/branch-icon.svg" +dest_files=["res://.godot/imported/branch-icon.svg-0718c16fd57484242e92f10e7dbcbab7.ctex"] [params] diff --git a/icons/checkmark-circle.svg b/public/icons/checkmark-circle.svg similarity index 100% rename from icons/checkmark-circle.svg rename to public/icons/checkmark-circle.svg diff --git a/icons/checkmark-circle.svg.import b/public/icons/checkmark-circle.svg.import similarity index 76% rename from icons/checkmark-circle.svg.import rename to public/icons/checkmark-circle.svg.import index 43050f15..3a3be100 100644 --- a/icons/checkmark-circle.svg.import +++ b/public/icons/checkmark-circle.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bvyspicsbicw" -path="res://.godot/imported/checkmark-circle.svg-48baed5436cd890cd7c076d9994ccd30.ctex" +path="res://.godot/imported/checkmark-circle.svg-3c3983dd9eeb70df5a17b8f2bc4b49b8.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/checkmark-circle.svg" -dest_files=["res://.godot/imported/checkmark-circle.svg-48baed5436cd890cd7c076d9994ccd30.ctex"] +source_file="res://addons/patchwork/public/icons/checkmark-circle.svg" +dest_files=["res://.godot/imported/checkmark-circle.svg-3c3983dd9eeb70df5a17b8f2bc4b49b8.ctex"] [params] diff --git a/icons/circle-alert.svg b/public/icons/circle-alert.svg similarity index 100% rename from icons/circle-alert.svg rename to public/icons/circle-alert.svg diff --git a/icons/circle-alert.svg.import b/public/icons/circle-alert.svg.import similarity index 77% rename from icons/circle-alert.svg.import rename to public/icons/circle-alert.svg.import index 5d4ce704..126f30ca 100644 --- a/icons/circle-alert.svg.import +++ b/public/icons/circle-alert.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://4c2gr0ggkl2t" -path="res://.godot/imported/circle-alert.svg-493a4856bb7f6db6be75346765df228d.ctex" +path="res://.godot/imported/circle-alert.svg-d19652897c90baabf85411cc6aafcd4a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle-alert.svg" -dest_files=["res://.godot/imported/circle-alert.svg-493a4856bb7f6db6be75346765df228d.ctex"] +source_file="res://addons/patchwork/public/icons/circle-alert.svg" +dest_files=["res://.godot/imported/circle-alert.svg-d19652897c90baabf85411cc6aafcd4a.ctex"] [params] diff --git a/icons/circle-check.svg b/public/icons/circle-check.svg similarity index 100% rename from icons/circle-check.svg rename to public/icons/circle-check.svg diff --git a/icons/circle-check.svg.import b/public/icons/circle-check.svg.import similarity index 77% rename from icons/circle-check.svg.import rename to public/icons/circle-check.svg.import index 57c00db2..a88df034 100644 --- a/icons/circle-check.svg.import +++ b/public/icons/circle-check.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://ceyam02frwm6g" -path="res://.godot/imported/circle-check.svg-d587d700b931cc253d8b3daf9d32b402.ctex" +path="res://.godot/imported/circle-check.svg-256109375ec4697ce7ff2f4983a9cecc.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle-check.svg" -dest_files=["res://.godot/imported/circle-check.svg-d587d700b931cc253d8b3daf9d32b402.ctex"] +source_file="res://addons/patchwork/public/icons/circle-check.svg" +dest_files=["res://.godot/imported/circle-check.svg-256109375ec4697ce7ff2f4983a9cecc.ctex"] [params] diff --git a/icons/circle-dashed-warning.svg b/public/icons/circle-dashed-warning.svg similarity index 100% rename from icons/circle-dashed-warning.svg rename to public/icons/circle-dashed-warning.svg diff --git a/icons/circle-dashed-warning.svg.import b/public/icons/circle-dashed-warning.svg.import similarity index 75% rename from icons/circle-dashed-warning.svg.import rename to public/icons/circle-dashed-warning.svg.import index a117634b..0f5f3a42 100644 --- a/icons/circle-dashed-warning.svg.import +++ b/public/icons/circle-dashed-warning.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dlh8cgu5tfl7l" -path="res://.godot/imported/circle-dashed-warning.svg-84655a0d0bb0ca3f9bfa1e4678eb45f4.ctex" +path="res://.godot/imported/circle-dashed-warning.svg-ba36555dae30727f2eaa0623cd652acf.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle-dashed-warning.svg" -dest_files=["res://.godot/imported/circle-dashed-warning.svg-84655a0d0bb0ca3f9bfa1e4678eb45f4.ctex"] +source_file="res://addons/patchwork/public/icons/circle-dashed-warning.svg" +dest_files=["res://.godot/imported/circle-dashed-warning.svg-ba36555dae30727f2eaa0623cd652acf.ctex"] [params] diff --git a/icons/circle-dashed.svg b/public/icons/circle-dashed.svg similarity index 100% rename from icons/circle-dashed.svg rename to public/icons/circle-dashed.svg diff --git a/icons/circle-dashed.svg.import b/public/icons/circle-dashed.svg.import similarity index 77% rename from icons/circle-dashed.svg.import rename to public/icons/circle-dashed.svg.import index 467b0de8..3bc25b26 100644 --- a/icons/circle-dashed.svg.import +++ b/public/icons/circle-dashed.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c5uuhwjbhn87w" -path="res://.godot/imported/circle-dashed.svg-9e146b5a8a9025841cdfd4f7438238a1.ctex" +path="res://.godot/imported/circle-dashed.svg-ec8ea1d514cc728a2ccfedd6248762c9.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle-dashed.svg" -dest_files=["res://.godot/imported/circle-dashed.svg-9e146b5a8a9025841cdfd4f7438238a1.ctex"] +source_file="res://addons/patchwork/public/icons/circle-dashed.svg" +dest_files=["res://.godot/imported/circle-dashed.svg-ec8ea1d514cc728a2ccfedd6248762c9.ctex"] [params] diff --git a/icons/circle-sync.svg b/public/icons/circle-sync.svg similarity index 100% rename from icons/circle-sync.svg rename to public/icons/circle-sync.svg diff --git a/icons/circle-sync.svg.import b/public/icons/circle-sync.svg.import similarity index 77% rename from icons/circle-sync.svg.import rename to public/icons/circle-sync.svg.import index 86faffe7..1762a535 100644 --- a/icons/circle-sync.svg.import +++ b/public/icons/circle-sync.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dmkg5hb5c7lhy" -path="res://.godot/imported/circle-sync.svg-38b3841d4485f1998cdd136b3efb20dc.ctex" +path="res://.godot/imported/circle-sync.svg-8c34d2a9636fbb73ee85beb12ee46a51.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle-sync.svg" -dest_files=["res://.godot/imported/circle-sync.svg-38b3841d4485f1998cdd136b3efb20dc.ctex"] +source_file="res://addons/patchwork/public/icons/circle-sync.svg" +dest_files=["res://.godot/imported/circle-sync.svg-8c34d2a9636fbb73ee85beb12ee46a51.ctex"] [params] diff --git a/icons/circle.svg b/public/icons/circle.svg similarity index 100% rename from icons/circle.svg rename to public/icons/circle.svg diff --git a/icons/circle.svg.import b/public/icons/circle.svg.import similarity index 78% rename from icons/circle.svg.import rename to public/icons/circle.svg.import index 88dc435a..8d47cd9f 100644 --- a/icons/circle.svg.import +++ b/public/icons/circle.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://k5so016nwxeq" -path="res://.godot/imported/circle.svg-9905eaa8c789b8f2b36c543505eaa039.ctex" +path="res://.godot/imported/circle.svg-4eff2576894301da8f56ef140d61ac58.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/circle.svg" -dest_files=["res://.godot/imported/circle.svg-9905eaa8c789b8f2b36c543505eaa039.ctex"] +source_file="res://addons/patchwork/public/icons/circle.svg" +dest_files=["res://.godot/imported/circle.svg-4eff2576894301da8f56ef140d61ac58.ctex"] [params] diff --git a/icons/collapsable-closed.svg b/public/icons/collapsable-closed.svg similarity index 100% rename from icons/collapsable-closed.svg rename to public/icons/collapsable-closed.svg diff --git a/icons/collapsable-closed.svg.import b/public/icons/collapsable-closed.svg.import similarity index 75% rename from icons/collapsable-closed.svg.import rename to public/icons/collapsable-closed.svg.import index eb1a90a2..bf34cea2 100644 --- a/icons/collapsable-closed.svg.import +++ b/public/icons/collapsable-closed.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://rdrm2lneo6i6" -path="res://.godot/imported/collapsable-closed.svg-64052d76a1c6c2f8ad03eaa1e15c102f.ctex" +path="res://.godot/imported/collapsable-closed.svg-7de1dacec8978333fa12ea5b8be02429.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/collapsable-closed.svg" -dest_files=["res://.godot/imported/collapsable-closed.svg-64052d76a1c6c2f8ad03eaa1e15c102f.ctex"] +source_file="res://addons/patchwork/public/icons/collapsable-closed.svg" +dest_files=["res://.godot/imported/collapsable-closed.svg-7de1dacec8978333fa12ea5b8be02429.ctex"] [params] diff --git a/icons/collapsable-open.svg b/public/icons/collapsable-open.svg similarity index 100% rename from icons/collapsable-open.svg rename to public/icons/collapsable-open.svg diff --git a/icons/collapsable-open.svg.import b/public/icons/collapsable-open.svg.import similarity index 76% rename from icons/collapsable-open.svg.import rename to public/icons/collapsable-open.svg.import index e11c283f..36128c2c 100644 --- a/icons/collapsable-open.svg.import +++ b/public/icons/collapsable-open.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://blu0iomxyyu3k" -path="res://.godot/imported/collapsable-open.svg-f62d8ef9e568a11b26f84e2f50e48546.ctex" +path="res://.godot/imported/collapsable-open.svg-ae16ea032e23aa154c4a89eb07f925cf.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/collapsable-open.svg" -dest_files=["res://.godot/imported/collapsable-open.svg-f62d8ef9e568a11b26f84e2f50e48546.ctex"] +source_file="res://addons/patchwork/public/icons/collapsable-open.svg" +dest_files=["res://.godot/imported/collapsable-open.svg-ae16ea032e23aa154c4a89eb07f925cf.ctex"] [params] diff --git a/icons/edit-two-svgrepo-com.svg b/public/icons/edit-two-svgrepo-com.svg similarity index 100% rename from icons/edit-two-svgrepo-com.svg rename to public/icons/edit-two-svgrepo-com.svg diff --git a/icons/edit-two-svgrepo-com.svg.import b/public/icons/edit-two-svgrepo-com.svg.import similarity index 75% rename from icons/edit-two-svgrepo-com.svg.import rename to public/icons/edit-two-svgrepo-com.svg.import index 9fb974ee..c83638a9 100644 --- a/icons/edit-two-svgrepo-com.svg.import +++ b/public/icons/edit-two-svgrepo-com.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://mr0rb0dbfyws" -path="res://.godot/imported/edit-two-svgrepo-com.svg-a8adb7fc52b5766128a68cb0917eb3e2.ctex" +path="res://.godot/imported/edit-two-svgrepo-com.svg-995d1c0f6ed2da764711bd8dc8a0d1cd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/edit-two-svgrepo-com.svg" -dest_files=["res://.godot/imported/edit-two-svgrepo-com.svg-a8adb7fc52b5766128a68cb0917eb3e2.ctex"] +source_file="res://addons/patchwork/public/icons/edit-two-svgrepo-com.svg" +dest_files=["res://.godot/imported/edit-two-svgrepo-com.svg-995d1c0f6ed2da764711bd8dc8a0d1cd.ctex"] [params] diff --git a/icons/person.svg b/public/icons/person.svg similarity index 100% rename from icons/person.svg rename to public/icons/person.svg diff --git a/icons/person.svg.import b/public/icons/person.svg.import similarity index 78% rename from icons/person.svg.import rename to public/icons/person.svg.import index 9888a855..90f3fef1 100644 --- a/icons/person.svg.import +++ b/public/icons/person.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://xec6o14n4y2v" -path="res://.godot/imported/person.svg-91b8e598a37a9ab804a792b64876edba.ctex" +path="res://.godot/imported/person.svg-ed8947b1b153fc61ec96665779566f46.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/person.svg" -dest_files=["res://.godot/imported/person.svg-91b8e598a37a9ab804a792b64876edba.ctex"] +source_file="res://addons/patchwork/public/icons/person.svg" +dest_files=["res://.godot/imported/person.svg-ed8947b1b153fc61ec96665779566f46.ctex"] [params] diff --git a/icons/remove-svgrepo-com.svg b/public/icons/remove-svgrepo-com.svg similarity index 100% rename from icons/remove-svgrepo-com.svg rename to public/icons/remove-svgrepo-com.svg diff --git a/icons/remove-svgrepo-com.svg.import b/public/icons/remove-svgrepo-com.svg.import similarity index 75% rename from icons/remove-svgrepo-com.svg.import rename to public/icons/remove-svgrepo-com.svg.import index 14ed1968..3a79524c 100644 --- a/icons/remove-svgrepo-com.svg.import +++ b/public/icons/remove-svgrepo-com.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cy3bt4icrwm3w" -path="res://.godot/imported/remove-svgrepo-com.svg-fc5e2e3588323682d4908ccd1cad307b.ctex" +path="res://.godot/imported/remove-svgrepo-com.svg-22b6cd1502c9a483b43cd5613c7c38cb.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/remove-svgrepo-com.svg" -dest_files=["res://.godot/imported/remove-svgrepo-com.svg-fc5e2e3588323682d4908ccd1cad307b.ctex"] +source_file="res://addons/patchwork/public/icons/remove-svgrepo-com.svg" +dest_files=["res://.godot/imported/remove-svgrepo-com.svg-22b6cd1502c9a483b43cd5613c7c38cb.ctex"] [params] diff --git a/icons/sign-add-svgrepo-com.svg b/public/icons/sign-add-svgrepo-com.svg similarity index 100% rename from icons/sign-add-svgrepo-com.svg rename to public/icons/sign-add-svgrepo-com.svg diff --git a/icons/sign-add-svgrepo-com.svg.import b/public/icons/sign-add-svgrepo-com.svg.import similarity index 75% rename from icons/sign-add-svgrepo-com.svg.import rename to public/icons/sign-add-svgrepo-com.svg.import index a954801d..298173c8 100644 --- a/icons/sign-add-svgrepo-com.svg.import +++ b/public/icons/sign-add-svgrepo-com.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bu0h5oa7aoanu" -path="res://.godot/imported/sign-add-svgrepo-com.svg-3c066eea04268b0ff031545522c94461.ctex" +path="res://.godot/imported/sign-add-svgrepo-com.svg-dfbe377cf4cc684bbd3ffb07bfa62467.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/sign-add-svgrepo-com.svg" -dest_files=["res://.godot/imported/sign-add-svgrepo-com.svg-3c066eea04268b0ff031545522c94461.ctex"] +source_file="res://addons/patchwork/public/icons/sign-add-svgrepo-com.svg" +dest_files=["res://.godot/imported/sign-add-svgrepo-com.svg-dfbe377cf4cc684bbd3ffb07bfa62467.ctex"] [params] diff --git a/icons/sync.svg b/public/icons/sync.svg similarity index 100% rename from icons/sync.svg rename to public/icons/sync.svg diff --git a/icons/sync.svg.import b/public/icons/sync.svg.import similarity index 78% rename from icons/sync.svg.import rename to public/icons/sync.svg.import index 96ded0ed..2f794aab 100644 --- a/icons/sync.svg.import +++ b/public/icons/sync.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://36nkcwgjmid2" -path="res://.godot/imported/sync.svg-924c809f9973fbfd6792ada7c2178c49.ctex" +path="res://.godot/imported/sync.svg-5b0c5acae85042e91881235662b88c4b.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/sync.svg" -dest_files=["res://.godot/imported/sync.svg-924c809f9973fbfd6792ada7c2178c49.ctex"] +source_file="res://addons/patchwork/public/icons/sync.svg" +dest_files=["res://.godot/imported/sync.svg-5b0c5acae85042e91881235662b88c4b.ctex"] [params] diff --git a/icons/undo-redo.svg b/public/icons/undo-redo.svg similarity index 100% rename from icons/undo-redo.svg rename to public/icons/undo-redo.svg diff --git a/icons/undo-redo.svg.import b/public/icons/undo-redo.svg.import similarity index 77% rename from icons/undo-redo.svg.import rename to public/icons/undo-redo.svg.import index 3b752065..19c3354c 100644 --- a/icons/undo-redo.svg.import +++ b/public/icons/undo-redo.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://3ji7pxd0i11g" -path="res://.godot/imported/undo-redo.svg-124acb6d576e0eca414858a47d4a4dab.ctex" +path="res://.godot/imported/undo-redo.svg-e70d887799d8adde83845aa17509abf3.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/undo-redo.svg" -dest_files=["res://.godot/imported/undo-redo.svg-124acb6d576e0eca414858a47d4a4dab.ctex"] +source_file="res://addons/patchwork/public/icons/undo-redo.svg" +dest_files=["res://.godot/imported/undo-redo.svg-e70d887799d8adde83845aa17509abf3.ctex"] [params] diff --git a/icons/warning-circle.svg b/public/icons/warning-circle.svg similarity index 100% rename from icons/warning-circle.svg rename to public/icons/warning-circle.svg diff --git a/icons/warning-circle.svg.import b/public/icons/warning-circle.svg.import similarity index 76% rename from icons/warning-circle.svg.import rename to public/icons/warning-circle.svg.import index 1e3be2d9..321b378f 100644 --- a/icons/warning-circle.svg.import +++ b/public/icons/warning-circle.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://b3jhx5bvcdswo" -path="res://.godot/imported/warning-circle.svg-194f34c2098e6e8db840b6ca8cd2384a.ctex" +path="res://.godot/imported/warning-circle.svg-d3a12880390d8331340eedc387da76b0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/warning-circle.svg" -dest_files=["res://.godot/imported/warning-circle.svg-194f34c2098e6e8db840b6ca8cd2384a.ctex"] +source_file="res://addons/patchwork/public/icons/warning-circle.svg" +dest_files=["res://.godot/imported/warning-circle.svg-d3a12880390d8331340eedc387da76b0.ctex"] [params] diff --git a/icons/warning.svg b/public/icons/warning.svg similarity index 100% rename from icons/warning.svg rename to public/icons/warning.svg diff --git a/icons/warning.svg.import b/public/icons/warning.svg.import similarity index 78% rename from icons/warning.svg.import rename to public/icons/warning.svg.import index 233c243a..5d05a935 100644 --- a/icons/warning.svg.import +++ b/public/icons/warning.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dkwdrqnrqqret" -path="res://.godot/imported/warning.svg-653088fa94d2491d57de7b8e8340d46d.ctex" +path="res://.godot/imported/warning.svg-0043873ff4746e34822d79bef0a83229.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://addons/patchwork/icons/warning.svg" -dest_files=["res://.godot/imported/warning.svg-653088fa94d2491d57de7b8e8340d46d.ctex"] +source_file="res://addons/patchwork/public/icons/warning.svg" +dest_files=["res://.godot/imported/warning.svg-0043873ff4746e34822d79bef0a83229.ctex"] [params] diff --git a/rust/plugin/Cargo.toml b/rust/Cargo.toml similarity index 100% rename from rust/plugin/Cargo.toml rename to rust/Cargo.toml diff --git a/rust/plugin/macos/libpatchwork_rust_core.macos.framework/Resources/Info.plist b/rust/macos/libpatchwork_rust_core.macos.framework/Resources/Info.plist similarity index 100% rename from rust/plugin/macos/libpatchwork_rust_core.macos.framework/Resources/Info.plist rename to rust/macos/libpatchwork_rust_core.macos.framework/Resources/Info.plist diff --git a/rust/plugin/build.rs b/rust/plugin/build.rs deleted file mode 100644 index 742fc681..00000000 --- a/rust/plugin/build.rs +++ /dev/null @@ -1,87 +0,0 @@ -use std::env; -use std::fs; -use std::io; -use std::io::Read; -use std::path::Path; -use std::path::PathBuf; -use std::process::Command; -mod post_build; - - -fn get_git_describe() -> String { - // run git describe --tags --abbrev=6 - let output = Command::new("git").args(&["describe", "--tags", "--abbrev=6"]).output().unwrap(); - let git_describe = String::from_utf8(output.stdout).unwrap_or_default().trim().to_string(); - return git_describe; -} - -fn get_plugin_cfg_path() -> PathBuf { - let cwd_dir = env::current_dir().unwrap(); - let plugin_cfg_dir = cwd_dir.parent().unwrap().parent().unwrap(); - let plugin_cfg_path = plugin_cfg_dir.join("plugin.cfg"); - return plugin_cfg_path; -} - -fn update_plugin_cfg(){ - let plugin_cfg_path = get_plugin_cfg_path(); - if !plugin_cfg_path.exists() { - println!("cargo:warning=plugin.cfg does not exist in the current directory"); - return; - } - let plugin_cfg = fs::read_to_string(plugin_cfg_path.clone()); - if plugin_cfg.is_err() { - println!("cargo:warning=Failed to read plugin.cfg: {}", plugin_cfg.err().unwrap()); - return; - } - let plugin_cfg = plugin_cfg.unwrap(); - let git_describe = get_git_describe(); - println!("cargo:warning=git_describe={}", git_describe); - // if it has more than two `-` in the version, replace all the subsequent `-` with `+` - let mut version = git_describe.to_string(); - let first_index = git_describe.find("-"); - if let Some(first_index) = first_index { - if first_index > 0 { - version = version[..first_index + 1].to_string() + &version[first_index + 1..].replace("-", "+"); - } - } - println!("cargo:warning=plugin_cfg=\n{}", plugin_cfg); - let lines = plugin_cfg.lines(); - let mut new_lines = Vec::new(); - for line in lines { - if line.contains("version=") { - new_lines.push(format!("version=\"{}\"", version)); - println!("cargo:warning=new_line={}", new_lines.last().unwrap()); - } else { - new_lines.push(line.to_string()); - } - } - let new_plugin_cfg = new_lines.join("\n") + "\n"; - println!("cargo:warning=new_plugin_cfg=\n{}", new_plugin_cfg); - // write the new plugin.cfg file - fs::write(plugin_cfg_path, new_plugin_cfg).unwrap(); -} - -fn write_build_info(){ - update_plugin_cfg(); - let out_dir: String = env::var("OUT_DIR").unwrap(); - let profile = env::var("PROFILE").unwrap(); - let target = env::var("TARGET").unwrap(); - // the actual args passed to cargo (it's not in an environment variable, but it's passed as an argument to the build script) - let args = env::args().collect::>(); - println!("cargo:warning=OUT_DIR={}", out_dir); - println!("cargo:warning=PROFILE={}", profile); - println!("cargo:warning=TARGET={}", target); - // write all these variables to a temporary file in the target directory - let target_dir = Path::new(&out_dir).parent().unwrap().parent().unwrap().parent().unwrap().parent().unwrap(); - let temp_file = target_dir.join(".lastbuild"); - fs::write(&temp_file, format!("OUT_DIR={}\nPROFILE={}\nTARGET={}\nARGS={:?}", out_dir, profile, target, args)).unwrap(); - println!("cargo:warning=Wrote to {:?}", &temp_file); -} - - - -fn main() { - println!("cargo:warning=Running write_build_info"); - write_build_info(); - static_vcruntime::metabuild(); -} diff --git a/rust/plugin/post_build.rs b/rust/plugin/post_build.rs deleted file mode 100644 index 11d1b36f..00000000 --- a/rust/plugin/post_build.rs +++ /dev/null @@ -1,276 +0,0 @@ -use std::collections::HashMap; -use std::env; -use std::fs; -use std::path::Path; -use std::process::Command; - -//.lastbuild file format: -// OUT_DIR=... -// PROFILE=... -// TARGET=... - -// [configuration] -// entry_symbol = "gdext_rust_init" -// compatibility_minimum = 4.3 -// reloadable = true - -// [libraries] -// linux.debug.x86_64 = "rust/plugin/linux/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" -// linux.release.x86_64 = "rust/plugin/linux/libpatchwork_rust_core.linux.x86_64-unknown-linux-gnu.so" -// linux.debug.arm64 = "rust/plugin/linux/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" -// linux.release.arm64 = "rust/plugin/linux/libpatchwork_rust_core.linux.aarch64-unknown-linux-gnu.so" -// linux.debug.arm32 = "rust/plugin/linux/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" -// linux.release.arm32 = "rust/plugin/linux/libpatchwork_rust_core.linux.armv7-unknown-linux-gnueabihf.so" -// windows.debug.x86_64 = "rust/plugin/windows/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" -// windows.release.x86_64 = "rust/plugin/windows/patchwork_rust_core.windows.x86_64-pc-windows-msvc.dll" -// windows.debug.arm64 = "rust/plugin/windows/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" -// windows.release.arm64 = "rust/plugin/windows/patchwork_rust_core.windows.aarch64-pc-windows-msvc.dll" -// macos.debug = "rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" -// macos.release = "rust/plugin/macos/libpatchwork_rust_core.macos.framework/libpatchwork_rust_core.macos.dylib" - -// parse the above file and get the - -#[allow(unused)] -fn parse_gdextension_file(cwd: String) -> HashMap { - let gdext_path = Path::new(&cwd).join("Patchwork.gdextension"); - let contents = fs::read_to_string(gdext_path).expect("Failed to read Patchwork.gdextension"); - let mut map = HashMap::new(); - let mut hit_libraries = false; - for line in contents.lines() { - let line = line.trim(); - if line.starts_with('[') && line.ends_with(']') { - if line == "[libraries]" { - hit_libraries = true; - } else { - hit_libraries = false; - } - if !hit_libraries { - continue; // skip sections other than [libraries] - } - continue; - } - if !hit_libraries { - continue; // skip sections other than [libraries] - } - - if line.is_empty() || line.starts_with('#') || line.starts_with(';') { - continue; - } - if let Some((key, value)) = line.split_once('=') { - let key = key.trim(); - let value = value.trim().trim_matches('"'); - map.insert(key.to_string(), value.to_string()); - } - } - map -} - -fn after_build(){ - println!("* Running post build script"); - // source the .lastbuild file - let target_dir = env::var("CRATE_TARGET_DIR").unwrap(); - let crate_dir = env::var("CRATE_MANIFEST_DIR").unwrap(); - println!("TARGET_DIR={}", target_dir); - println!("CWD={}", crate_dir); - let crate_dir_path = Path::new(&crate_dir); - let lastbuild = fs::read_to_string(Path::new(&target_dir).join(".lastbuild")).unwrap(); - - // is_ok and is 1 - let is_ci = env::var("CI").is_ok() && env::var("CI").unwrap() == "1"; - println!("CI={}", is_ci); - - // Parse the file contents - let out_dir = lastbuild.split("OUT_DIR=").nth(1).unwrap().split("\n").next().unwrap(); - let profile = lastbuild.split("PROFILE=").nth(1).unwrap().split("\n").next().unwrap(); - let target = lastbuild.split("TARGET=").nth(1).unwrap().split("\n").next().unwrap(); - // cargo_manifest_dir is the directory of the Cargo.toml file - println!("OUT_DIR={}", out_dir); - println!("PROFILE={}", profile); - println!("TARGET={}", target); - println!("CWD={}", crate_dir); - - // arch is x86_64 or arm64 depending on the target - let arch = if target.contains("x86_64") { - "x86_64" - } else if target.contains("arm64") || target.contains("aarch64") { - "arm64" - } else { - panic!("Unsupported target architecture: {}", target); - }; - - // Determine the platform name from the target triple - let platform_name = if target.contains("darwin") { - "macos" - } else if target.contains("windows") { - "windows" - } else if target.contains("linux") { - "linux" - } else { - panic!("Unsupported target platform: {}", target); - }; - let profile_dir = Path::new(&out_dir).parent().unwrap().parent().unwrap().parent().unwrap(); - let target_dirs = vec![profile_dir.to_path_buf()]; - let targets = vec![target]; - // Get the library name and extension based on platform - let (lib_name, lib_dll_ext, lib_a_ext) = if target.contains("windows") { - ("patchwork_rust_core", "dll", "lib") - } else if target.contains("darwin") { - ("libpatchwork_rust_core", "dylib", "a") - } else { - ("libpatchwork_rust_core", "so", "a") - }; - // if this platform_name is macos, and the target is aarch64-apple-darwin, write a file to the target directory called ".nextbuild" - // check if this exists first - // if platform_name == "macos" { - // let new_target = if target == "aarch64-apple-darwin" { - // "x86_64-apple-darwin" - // } else { - // "aarch64-apple-darwin" - // }; - // targets.push(new_target); - // // run cargo post build with all the arguments from the .lastbuild file, including the profile, except change the target to x86_64-apple-darwin - // // set the output directory to the target directory + /target triplet - // // profile_dir is set to something like "target/debug" - // // the new_Dir is gonna be "target/x86_64-apple-darwin/debug" - // // so we need to get a - // let new_dir = profile_dir.parent().unwrap().join(new_target).join(profile); - // let mut args = vec!["build", "--lib", "--target", new_target]; - // // check if it's a release build, and if so, add the --release flag - // if profile == "release" { - // args.push("--release"); - // } - // // just run `which cargo` to get the location of the cargo executable (and strip any newlines) - // let which_cargo = Command::new("which").arg("cargo").output().unwrap(); - // let stdout = which_cargo.stdout; - // // it's expecting an &[u8], but we have a `Vec`, so we need to convert it - // let cargo_location = String::from_utf8_lossy(&stdout); - // let cargo_location = cargo_location.trim(); - // println!("Cargo location: {:?}", &cargo_location); - // println!("building to {:?}", &new_dir); - // // then just run cargo with those args - // let output = Command::new(&cargo_location) - // .args(&args) - // .current_dir(crate_dir) - // .output() - // .unwrap(); - // println!("Ran cargo post build with args: {:?}", args); - // println!("Output:", ); - // print!("{}", String::from_utf8_lossy(&output.stdout)); - // println!("Error: "); - // print!("{}", String::from_utf8_lossy(&output.stderr)); - // // check the exit code - // if output.status.success() { - // println!("cargo post build succeeded"); - // } else { - // panic!("cargo post build failed"); - // } - // // push it back to the target_dirs vector - - // target_dirs.push(new_dir); - // } - // let map = parse_gdextension_file(crate_dir.clone()); - // let files = map.iter().map(|(k, v)| { - // if k.starts_with(&format!("{}.{}", platform_name.clone(), profile.to_ascii_lowercase())) { - // // e.g. linux.debug.x86_64 - // if (platform_name == "macos"){ - // return Some( v); - // } else if (k.ends_with(arch)) { - // return Some(v); - // } - // // let parts: Vec<&str> = k.split('.').collect(); - // // if parts.len() >= 3 { - // // let target_part = parts[2]; // e.g. x86_64 - // // targets.push(target_part); - // // let new_dir = profile_dir.parent().unwrap().join(target_part).join(profile); - // // target_dirs.push(new_dir); - // // } - // } - // return None; - // }); - // for all the target_dirs, copy the library to the platform-specific directory - for (i, profile_dir) in target_dirs.iter().enumerate() { - // Construct paths - let dll_lib_path = profile_dir.join(format!("{}.{}", lib_name, lib_dll_ext)); - let a_lib_path = profile_dir.join(format!("{}.{}", lib_name, lib_a_ext)); - - let platform_dir = Path::new(&crate_dir_path).join(platform_name); - - // Create platform directory if it doesn't exist - fs::create_dir_all(&platform_dir).unwrap(); - println!("profile_dir directory {:?}", profile_dir); - // Copy the library to the platform-specific directory - println!("Copying library from {:?} to {:?}", dll_lib_path, platform_dir); - println!("Copying library from {:?} to {:?}", a_lib_path, platform_dir); - - - let dll_dest_path = if platform_name == "macos" { - // it goes in the "macos/libpatchwork_rust_core.macos.framework" directory - // platform_dir.join(format!("{}.{}.{}", lib_name, targets[i], lib_dll_ext)) - // if isCI { - // platform_dir.join(format!("{}.macos.framework", &lib_name)).join(format!("{}.{}", lib_name, lib_dll_ext)) - // } else { - platform_dir.join(format!("{}.macos.framework", &lib_name)).join(format!("{}.macos.{}", lib_name, lib_dll_ext)) - // } - } else { - platform_dir.join(format!("{}.{}.{}.{}", lib_name, platform_name, targets[i], lib_dll_ext)) - }; - let a_dest_path = if platform_name == "macos" { - platform_dir.join(format!("{}.macos.framework", &lib_name)).join(format!("{}.macos.{}.{}", lib_name, arch, lib_a_ext)) - } else { - platform_dir.join(format!("{}.{}.{}.{}", lib_name, platform_name, targets[i], lib_a_ext)) - }; - // check that libpath exists - if !dll_lib_path.exists() { - panic!("Library file does not exist: {:?}", dll_lib_path); - } - if !a_lib_path.exists() { - panic!("Library file does not exist: {:?}", a_lib_path); - } - fs::copy(&dll_lib_path, &dll_dest_path).unwrap(); - fs::copy(&a_lib_path, &a_dest_path).unwrap(); - if platform_name == "windows" { - let pdb_lib_path = profile_dir.join(format!("{}.{}", lib_name, "pdb")); - let pdb_dest_path = platform_dir.join(format!("{}.{}", lib_name, "pdb")); - fs::copy(&pdb_lib_path, &pdb_dest_path).unwrap(); - } - - println!("Copied library to {:?}", dll_dest_path); - println!("Copied library to {:?}", a_dest_path); - // if on macos, run rcodesign - if platform_name == "macos" { - // framework path - //codesign --force --deep --verbose -s "Apple Development: Nikita Zatkovich (RFTZV7M2RV)" macos/libpatchwork_rust_core.macos.framework - let framework_path = platform_dir.join(format!("{}.macos.framework", &lib_name)); - let cwd = crate_dir_path.to_str().unwrap(); - // check that ".cargo/.devidentity" exists - let mut dev_identity_path = Path::new(&crate_dir_path).join(".cargo/.devidentity"); - if !dev_identity_path.exists() { - // try ../../ - dev_identity_path = Path::new(&crate_dir_path).parent().unwrap().parent().unwrap().join(".cargo/.devidentity"); - if !dev_identity_path.exists() { - println!("Developer identity file does not exist: {:?}", dev_identity_path); - println!("Put the identity (e.g. Apple Development: Nikita Zatkovich (RFTZV7M2RV)) in the .cargo/.devidentity file to enable codesigning"); - return; - } - } - // load the identity from the file - let identity = fs::read_to_string(dev_identity_path).unwrap().trim().to_string(); - // let mut args = vec!["sign", framework_path.to_str().unwrap(), "--exclude", "**/*.a"]; - // let output = Command::new("rcodesign").args(&args).current_dir(cwd).output().unwrap(); - let args = vec![ "--force", "--deep", "--verbose", "-s", &identity, framework_path.to_str().unwrap()]; - println!("codesigning with identity: {}", &identity); - let output = Command::new("codesign").args(&args).current_dir(cwd).output().unwrap(); - - println!("rcodesign output: {}", String::from_utf8_lossy(&output.stdout)); - println!("rcodesign error: {}", String::from_utf8_lossy(&output.stderr)); - } - } - println!("* Post build script completed"); -} - -fn main() { - // ensure this runs AFTER the build - // println!("Running after_build"); - // run the after_build function - after_build(); -} diff --git a/rust/plugin/test_output.txt b/rust/plugin/test_output.txt deleted file mode 100644 index 41ef061d..00000000 --- a/rust/plugin/test_output.txt +++ /dev/null @@ -1,838 +0,0 @@ -warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` -note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest -note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest -note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions -warning: patchwork_rust v0.0.1 (/Users/nikita/Workspace/godot-ws/godot/modules/patchwork_editor/rust/plugin) ignoring invalid dependency `cargo-post` which is missing a lib target -warning: unused variable: `size` - --> rust/plugin/post_build.rs:115:9 - | -115 | let size = target_dirs.len(); - | ^^^^ help: if this is intentional, prefix it with an underscore: `_size` - | - = note: `#[warn(unused_variables)]` on by default - -warning: variable does not need to be mutable - --> rust/plugin/post_build.rs:54:9 - | -54 | let mut target_dirs = vec![profile_dir.to_path_buf()]; - | ----^^^^^^^^^^^ - | | - | help: remove this `mut` - | - = note: `#[warn(unused_mut)]` on by default - -warning: variable does not need to be mutable - --> rust/plugin/post_build.rs:55:9 - | -55 | let mut targets = vec![target]; - | ----^^^^^^^ - | | - | help: remove this `mut` - -warning: variable does not need to be mutable - --> rust/plugin/post_build.rs:181:8 - | -181 | let mut args = vec![ "--force", "--deep", "--verbose", "-s", &identity, framework_path.to_str().unwrap()]; - | ----^^^^ - | | - | help: remove this `mut` - -warning: function `after_build` is never used - --> rust/plugin/post_build.rs:11:4 - | -11 | fn after_build(){ - | ^^^^^^^^^^^ - | - = note: `#[warn(dead_code)]` on by default - -warning: function `main` is never used - --> rust/plugin/post_build.rs:191:4 - | -191 | fn main() { - | ^^^^ - -warning: variable `isCI` should have a snake case name - --> rust/plugin/post_build.rs:21:9 - | -21 | let isCI = env::var("CI").is_ok() && env::var("CI").unwrap() == "1"; - | ^^^^ help: convert the identifier to snake case: `is_ci` - | - = note: `#[warn(non_snake_case)]` on by default - -warning: `patchwork_rust` (build script) generated 7 warnings - Compiling patchwork_rust v0.0.1 (/Users/nikita/Workspace/godot-ws/godot/modules/patchwork_editor/rust/plugin) -warning: patchwork_rust@0.0.1: Running write_build_info -warning: patchwork_rust@0.0.1: OUT_DIR=/Users/nikita/Workspace/godot-ws/godot/modules/patchwork_editor/target/debug/build/patchwork_rust-2f398bd0fea3f627/out -warning: patchwork_rust@0.0.1: PROFILE=debug -warning: patchwork_rust@0.0.1: TARGET=aarch64-apple-darwin -warning: patchwork_rust@0.0.1: Wrote to "/Users/nikita/Workspace/godot-ws/godot/modules/patchwork_editor/target/.lastbuild" -warning: unused import: `VariantType` - --> rust/plugin/src/patchwork_config.rs:4:31 - | -4 | use godot::builtin::{Variant, VariantType}; - | ^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default - -warning: unused imports: `ClassDb` and `meta::ParamType` - --> rust/plugin/src/lib.rs:2:23 - | -2 | use godot::{classes::{ClassDb, Engine}, init::EditorRunBehavior, meta::ParamType, prelude::*}; - | ^^^^^^^ ^^^^^^^^^^^^^^^ - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/lib.rs:9:5 - | -9 | if (Engine::singleton().has_singleton(singleton_name)) { - | ^ ^ - | - = note: `#[warn(unused_parens)]` on by default -help: remove these parentheses - | -9 - if (Engine::singleton().has_singleton(singleton_name)) { -9 + if Engine::singleton().has_singleton(singleton_name) { - | - -warning: unused import: `safer_ffi::layout::into_raw` - --> rust/plugin/src/godot_parser.rs:6:5 - | -6 | use safer_ffi::layout::into_raw; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `utils::print_doc` - --> rust/plugin/src/godot_parser.rs:11:41 - | -11 | use crate::{doc_utils::SimpleDocReader, utils::print_doc}; - | ^^^^^^^^^^^^^^^^ - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_parser.rs:924:12 - | -924 | if (self.resource_type != "PackedScene") { - | ^ ^ - | -help: remove these parentheses - | -924 - if (self.resource_type != "PackedScene") { -924 + if self.resource_type != "PackedScene" { - | - -warning: unused import: `automerge::op_tree::B` - --> rust/plugin/src/godot_project.rs:2:5 - | -2 | use automerge::op_tree::B; - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `futures::io::empty` - --> rust/plugin/src/godot_project.rs:5:5 - | -5 | use futures::io::empty; - | ^^^^^^^^^^^^^^^^^^ - -warning: unused import: `godot::meta::AsArg` - --> rust/plugin/src/godot_project.rs:9:5 - | -9 | use godot::meta::AsArg; - | ^^^^^^^^^^^^^^^^^^ - -warning: unused import: `safer_ffi::layout::OpaqueKind::T` - --> rust/plugin/src/godot_project.rs:10:5 - | -10 | use safer_ffi::layout::OpaqueKind::T; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `std::io::BufWriter` - --> rust/plugin/src/godot_project.rs:13:5 - | -13 | use std::io::BufWriter; - | ^^^^^^^^^^^^^^^^^^ - -warning: unused import: `godot::classes::EditorFileSystem` - --> rust/plugin/src/godot_project.rs:24:5 - | -24 | use godot::classes::EditorFileSystem; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `godot::classes::EditorInterface` - --> rust/plugin/src/godot_project.rs:25:5 - | -25 | use godot::classes::EditorInterface; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `godot::classes::Image` - --> rust/plugin/src/godot_project.rs:26:5 - | -26 | use godot::classes::Image; - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: unused imports: `ConfigFile` and `ResourceImporter` - --> rust/plugin/src/godot_project.rs:30:22 - | -30 | use godot::classes::{ConfigFile, DirAccess, FileAccess, ResourceImporter}; - | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^ - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:913:16 - | -913 | if (prop_value.contains("SubResource(")) { - | ^ ^ - | -help: remove these parentheses - | -913 - if (prop_value.contains("SubResource(")) { -913 + if prop_value.contains("SubResource(") { - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:915:23 - | -915 | } else if (prop_value.contains("ExtResource(")) { - | ^ ^ - | -help: remove these parentheses - | -915 - } else if (prop_value.contains("ExtResource(")) { -915 + } else if prop_value.contains("ExtResource(") { - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:1162:12 - | -1162 | if (change_type == "unchanged") { - | ^ ^ - | -help: remove these parentheses - | -1162 - if (change_type == "unchanged") { -1162 + if change_type == "unchanged" { - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:1171:12 - | -1171 | if (old_content_type != VariantType::STRING && new_content_type != VariantType::STRING) { - | ^ ^ - | -help: remove these parentheses - | -1171 - if (old_content_type != VariantType::STRING && new_content_type != VariantType::STRING) { -1171 + if old_content_type != VariantType::STRING && new_content_type != VariantType::STRING { - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:1180:19 - | -1180 | } else if (old_content_type != VariantType::PACKED_BYTE_ARRAY - | ^ -1181 | && new_content_type != VariantType::PACKED_BYTE_ARRAY) - | ^ - | -help: remove these parentheses - | -1180 ~ } else if old_content_type != VariantType::PACKED_BYTE_ARRAY -1181 ~ && new_content_type != VariantType::PACKED_BYTE_ARRAY - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:1533:24 - | -1533 | if (!loaded_ext_resources.contains_key(&path)) { - | ^ ^ - | -help: remove these parentheses - | -1533 - if (!loaded_ext_resources.contains_key(&path)) { -1533 + if !loaded_ext_resources.contains_key(&path) { - | - -warning: unnecessary parentheses around `if` condition - --> rust/plugin/src/godot_project.rs:1621:39 - | -1621 | ... } else if (resource_path != new_resource_path) { - | ^ ^ - | -help: remove these parentheses - | -1621 - } else if (resource_path != new_resource_path) { -1621 + } else if resource_path != new_resource_path { - | - -warning: unused import: `godot_parser` - --> rust/plugin/src/godot_project_driver.rs:17:5 - | -17 | godot_parser, - | ^^^^^^^^^^^^ - -warning: unused import: `Instant` - --> rust/plugin/src/utils.rs:4:12 - | -4 | time::{Instant, SystemTime}, - | ^^^^^^^ - -warning: unused import: `RepoHandle` - --> rust/plugin/src/utils.rs:12:45 - | -12 | use automerge_repo::{DocHandle, DocumentId, RepoHandle}; - | ^^^^^^^^^^ - -warning: unused import: `Array` - --> rust/plugin/src/utils.rs:13:22 - | -13 | use godot::builtin::{Array, GString, PackedStringArray}; - | ^^^^^ - -warning: unused import: `serde_json::Serializer` - --> rust/plugin/src/utils.rs:15:5 - | -15 | use serde_json::Serializer; - | ^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `std::sync::mpsc::channel` - --> rust/plugin/src/file_system_driver.rs:9:5 - | -9 | use std::sync::mpsc::channel; - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `std::time::Duration as StdDuration` - --> rust/plugin/src/file_system_driver.rs:10:5 - | -10 | use std::time::Duration as StdDuration; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `Read` - --> rust/plugin/src/file_system_driver.rs:13:15 - | -13 | use std::io::{Read, Write}; - | ^^^^ - -warning: unused imports: `Hash` and `Md5Error` - --> rust/plugin/src/file_system_driver.rs:14:25 - | -14 | use ya_md5::{Md5Hasher, Hash, Md5Error}; - | ^^^^ ^^^^^^^^ - -warning: unused import: `tokio::sync::mpsc` - --> rust/plugin/src/file_system_driver.rs:312:9 - | -312 | use tokio::sync::mpsc; - | ^^^^^^^^^^^^^^^^^ - -warning: unused variable: `old_heads` - --> rust/plugin/src/godot_project.rs:366:9 - | -366 | old_heads: PackedStringArray, - | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_old_heads` - | - = note: `#[warn(unused_variables)]` on by default - -warning: unused variable: `curr_heads` - --> rust/plugin/src/godot_project.rs:367:9 - | -367 | curr_heads: PackedStringArray, - | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_curr_heads` - -warning: unused variable: `a` - --> rust/plugin/src/godot_project.rs:384:21 - | -384 | let a = c.message(); - | ^ help: if this is intentional, prefix it with an underscore: `_a` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:847:13 - | -847 | let mut dir_access = DirAccess::open(&root); - | ----^^^^^^^^^^ - | | - | help: remove this `mut` - | - = note: `#[warn(unused_mut)]` on by default - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:880:13 - | -880 | let mut dir_access = DirAccess::open(&root); - | ----^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: unused variable: `i` - --> rust/plugin/src/godot_project.rs:979:14 - | -979 | for (i, hunk) in unified.iter_hunks().enumerate() { - | ^ help: if this is intentional, prefix it with an underscore: `_i` - -warning: unused variable: `header` - --> rust/plugin/src/godot_project.rs:981:17 - | -981 | let header = hunk.header(); - | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_header` - -warning: unused variable: `idx` - --> rust/plugin/src/godot_project.rs:988:18 - | -988 | for (idx, change) in hunk.iter_changes().enumerate() { - | ^^^ help: if this is intentional, prefix it with an underscore: `_idx` - -warning: unused variable: `added_node_ids` - --> rust/plugin/src/godot_project.rs:1318:21 - | -1318 | let mut added_node_ids: HashSet = HashSet::new(); - | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_added_node_ids` - -warning: unused variable: `deleted_node_ids` - --> rust/plugin/src/godot_project.rs:1319:21 - | -1319 | let mut deleted_node_ids: HashSet = HashSet::new(); - | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_deleted_node_ids` - -warning: unused variable: `insert_node_modification` - --> rust/plugin/src/godot_project.rs:1323:21 - | -1323 | let mut insert_node_modification = |node_id: &String, change_op: ChangeOp| { - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_insert_node_modification` - -warning: unused variable: `action` - --> rust/plugin/src/godot_project.rs:1341:45 - | -1341 | |PathWithAction { path, action }| match path.first() { - | ^^^^^^ help: try ignoring the field: `action: _` - -warning: unused variable: `action` - --> rust/plugin/src/godot_project.rs:1365:45 - | -1365 | |PathWithAction { path, action }| match path.first() { - | ^^^^^^ help: try ignoring the field: `action: _` - -warning: unused variable: `action` - --> rust/plugin/src/godot_project.rs:1380:45 - | -1380 | |PathWithAction { path, action }| match path.first() { - | ^^^^^^ help: try ignoring the field: `action: _` - -warning: unused variable: `content_key` - --> rust/plugin/src/godot_project.rs:1478:38 - | -1478 | ... content_key: &str| { - | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_content_key` - -warning: value assigned to `path` is never read - --> rust/plugin/src/godot_project.rs:1496:25 - | -1496 | let mut path: Option = None; - | ^^^^ - | - = help: maybe it is overwritten before being read? - = note: `#[warn(unused_assignments)]` on by default - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1308:17 - | -1308 | let mut all_changed_ext_resource_paths: HashSet = HashSet::new(); - | ----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1318:17 - | -1318 | let mut added_node_ids: HashSet = HashSet::new(); - | ----^^^^^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1319:17 - | -1319 | let mut deleted_node_ids: HashSet = HashSet::new(); - | ----^^^^^^^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1323:17 - | -1323 | let mut insert_node_modification = |node_id: &String, change_op: ChangeOp| { - | ----^^^^^^^^^^^^^^^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1219:13 - | -1219 | let mut changed_files = get_changed_files_vec(&patches); - | ----^^^^^^^^^^^^^ - | | - | help: remove this `mut` - -warning: unused variable: `e` - --> rust/plugin/src/godot_project.rs:1813:17 - | -1813 | Err(e) => None, - | ^ help: if this is intentional, prefix it with an underscore: `_e` - -warning: unused variable: `driver_input_rx` - --> rust/plugin/src/godot_project.rs:1851:31 - | -1851 | let (driver_input_tx, driver_input_rx) = futures::channel::mpsc::unbounded(); - | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_driver_input_rx` - -warning: unused variable: `driver_output_tx` - --> rust/plugin/src/godot_project.rs:1852:14 - | -1852 | let (driver_output_tx, driver_output_rx) = futures::channel::mpsc::unbounded(); - | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_driver_output_tx` - -warning: variable does not need to be mutable - --> rust/plugin/src/godot_project.rs:1854:13 - | -1854 | let mut ret = Self { - | ----^^^ - | | - | help: remove this `mut` - -warning: unused variable: `input_tx` - --> rust/plugin/src/file_system_driver.rs:339:14 - | -339 | let (input_tx, input_rx) = futures::channel::mpsc::unbounded(); - | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_input_tx` - -warning: unused variable: `input_tx` - --> rust/plugin/src/file_system_driver.rs:404:14 - | -404 | let (input_tx, input_rx) = futures::channel::mpsc::unbounded(); - | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_input_tx` - -warning: methods `get_bytes` and `get_float` are never used - --> rust/plugin/src/doc_utils.rs:5:8 - | -4 | pub trait SimpleDocReader { - | --------------- methods in this trait -5 | fn get_bytes, P: Into>(&self, obj: O, prop: P) -> Option>; - | ^^^^^^^^^ -... -16 | fn get_float, P: Into>(&self, obj: O, prop: P) -> Option; - | ^^^^^^^^^ - | - = note: `#[warn(dead_code)]` on by default - -warning: method `get_ext_resource_path` is never used - --> rust/plugin/src/godot_parser.rs:144:5 - | -111 | impl GodotScene { - | --------------- method in this implementation -... -144 | fn get_ext_resource_path(&self, ext_resource_id: &str) -> Option { - | ^^^^^^^^^^^^^^^^^^^^^ - -warning: struct `GodotProjectState` is never constructed - --> rust/plugin/src/godot_project.rs:123:8 - | -123 | struct GodotProjectState { - | ^^^^^^^^^^^^^^^^^ - -warning: variants `Added`, `Removed`, and `Modified` are never constructed - --> rust/plugin/src/godot_project.rs:143:5 - | -142 | enum ChangeOp { - | -------- variants in this enum -143 | Added, - | ^^^^^ -144 | Removed, - | ^^^^^^^ -145 | Modified, - | ^^^^^^^^ - -warning: method `get_class_name` is never used - --> rust/plugin/src/godot_project.rs:826:8 - | -149 | impl GodotProject { - | ----------------- method in this implementation -... -826 | fn get_class_name(&self, script_content: String) -> String { - | ^^^^^^^^^^^^^^ - -warning: static `GODOT_PROJECT` is never used - --> rust/plugin/src/godot_project.rs:1846:12 - | -1846 | static mut GODOT_PROJECT: Option = None; - | ^^^^^^^^^^^^^ - -warning: field `diff` is never read - --> rust/plugin/src/godot_project_driver.rs:109:9 - | -107 | Changed { - | ------- field in this variant -108 | doc_handle: DocHandle, -109 | diff: Vec, - | ^^^^ - -warning: field `path` is never read - --> rust/plugin/src/godot_project_driver.rs:119:5 - | -117 | pub struct BinaryDocState { - | -------------- field in this struct -118 | doc_handle: Option, // is null if the binary doc is being requested but not loaded yet -119 | path: String, - | ^^^^ - | - = note: `BinaryDocState` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis - -warning: function `print_branch_doc` is never used - --> rust/plugin/src/utils.rs:66:15 - | -66 | pub(crate) fn print_branch_doc(message: &str, doc_handle: &DocHandle) { - | ^^^^^^^^^^^^^^^^ - -warning: function `print_doc` is never used - --> rust/plugin/src/utils.rs:80:15 - | -80 | pub(crate) fn print_doc(message: &str, doc_handle: &DocHandle) { - | ^^^^^^^^^ - -warning: method `stop` is never used - --> rust/plugin/src/file_system_driver.rs:300:18 - | -52 | impl FileSystemDriver { - | --------------------- method in this implementation -... -300 | pub async fn stop(&self) { - | ^^^^ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1102:9 - | -1102 | content.insert("name", node.name.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_must_use)]` on by default -help: use `let _ = ...` to ignore the resulting value - | -1102 | let _ = content.insert("name", node.name.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1107:17 - | -1107 | content.insert("type", type_name.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1107 | let _ = content.insert("type", type_name.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1110:17 - | -1110 | content.insert("instance", instance_id.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1110 | let _ = content.insert("instance", instance_id.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1116:13 - | -1116 | content.insert("owner", owner.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1116 | let _ = content.insert("owner", owner.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1119:13 - | -1119 | content.insert("index", index); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1119 | let _ = content.insert("index", index); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1122:13 - | -1122 | content.insert("groups", groups.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1122 | let _ = content.insert("groups", groups.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1128:13 - | -1128 | properties.insert(key.clone(), property.value.clone()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1128 | let _ = properties.insert(key.clone(), property.value.clone()); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_parser.rs:1130:9 - | -1130 | content.insert("properties", properties); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1130 | let _ = content.insert("properties", properties); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1662:21 - | -1662 | node_info.insert("change_type", "removed"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1662 | let _ = node_info.insert("change_type", "removed"); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1664:25 - | -1664 | node_info.insert("node_path", scene.get_node_path(&node_id)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1664 | let _ = node_info.insert("node_path", scene.get_node_path(&node_id)); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1666:29 - | -1666 | ... node_info.insert("old_content", content); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1666 | let _ = node_info.insert("old_content", content); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1672:21 - | -1672 | node_info.insert("change_type", "added"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1672 | let _ = node_info.insert("change_type", "added"); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1674:25 - | -1674 | node_info.insert("node_path", scene.get_node_path(&node_id)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1674 | let _ = node_info.insert("node_path", scene.get_node_path(&node_id)); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1676:29 - | -1676 | ... node_info.insert("new_content", content); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1676 | let _ = node_info.insert("new_content", content); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1682:21 - | -1682 | node_info.insert("change_type", "modified"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1682 | let _ = node_info.insert("change_type", "modified"); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1685:25 - | -1685 | node_info.insert("node_path", scene.get_node_path(node_id)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1685 | let _ = node_info.insert("node_path", scene.get_node_path(node_id)); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1700:29 - | -1700 | ... node_info.insert("old_content", content); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1700 | let _ = node_info.insert("old_content", content); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1712:29 - | -1712 | ... node_info.insert("new_content", content); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1712 | let _ = node_info.insert("new_content", content); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1720:25 - | -1720 | node_info.insert("change_type", "type_changed"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1720 | let _ = node_info.insert("change_type", "type_changed"); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1747:29 - | -1747 | ... node_info.insert("changed_props", changed_props); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1747 | let _ = node_info.insert("changed_props", changed_props); - | +++++++ - -warning: unused return value of `godot::prelude::Dictionary::insert` that must be used - --> rust/plugin/src/godot_project.rs:1753:13 - | -1753 | result.insert("changed_nodes", changed_nodes); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: use `let _ = ...` to ignore the resulting value - | -1753 | let _ = result.insert("changed_nodes", changed_nodes); - | +++++++ - -warning: `patchwork_rust` (lib test) generated 91 warnings (run `cargo fix --lib -p patchwork_rust --tests` to apply 40 suggestions) - Finished `test` profile [unoptimized + debuginfo] target(s) in 0.81s - Running unittests src/lib.rs (/Users/nikita/Workspace/godot-ws/godot/modules/patchwork_editor/target/debug/deps/patchwork_rust_core-850c20cab571591c) - -running 3 tests -test file_system_driver::tests::test_file_system_update_events ... FAILED diff --git a/rust/plugin/src/diff.rs b/rust/src/diff.rs similarity index 100% rename from rust/plugin/src/diff.rs rename to rust/src/diff.rs diff --git a/rust/plugin/src/diff/differ.rs b/rust/src/diff/differ.rs similarity index 100% rename from rust/plugin/src/diff/differ.rs rename to rust/src/diff/differ.rs diff --git a/rust/plugin/src/diff/resource_differ.rs b/rust/src/diff/resource_differ.rs similarity index 100% rename from rust/plugin/src/diff/resource_differ.rs rename to rust/src/diff/resource_differ.rs diff --git a/rust/plugin/src/diff/scene_differ.rs b/rust/src/diff/scene_differ.rs similarity index 100% rename from rust/plugin/src/diff/scene_differ.rs rename to rust/src/diff/scene_differ.rs diff --git a/rust/plugin/src/diff/text_differ.rs b/rust/src/diff/text_differ.rs similarity index 100% rename from rust/plugin/src/diff/text_differ.rs rename to rust/src/diff/text_differ.rs diff --git a/rust/plugin/src/fs.rs b/rust/src/fs.rs similarity index 100% rename from rust/plugin/src/fs.rs rename to rust/src/fs.rs diff --git a/rust/plugin/src/fs/file_system_driver.rs b/rust/src/fs/file_system_driver.rs similarity index 100% rename from rust/plugin/src/fs/file_system_driver.rs rename to rust/src/fs/file_system_driver.rs diff --git a/rust/plugin/src/fs/file_system_driver/tests.rs b/rust/src/fs/file_system_driver/tests.rs similarity index 100% rename from rust/plugin/src/fs/file_system_driver/tests.rs rename to rust/src/fs/file_system_driver/tests.rs diff --git a/rust/plugin/src/fs/file_utils.rs b/rust/src/fs/file_utils.rs similarity index 100% rename from rust/plugin/src/fs/file_utils.rs rename to rust/src/fs/file_utils.rs diff --git a/rust/plugin/src/helpers.rs b/rust/src/helpers.rs similarity index 100% rename from rust/plugin/src/helpers.rs rename to rust/src/helpers.rs diff --git a/rust/plugin/src/helpers/branch.rs b/rust/src/helpers/branch.rs similarity index 100% rename from rust/plugin/src/helpers/branch.rs rename to rust/src/helpers/branch.rs diff --git a/rust/plugin/src/helpers/doc_utils.rs b/rust/src/helpers/doc_utils.rs similarity index 100% rename from rust/plugin/src/helpers/doc_utils.rs rename to rust/src/helpers/doc_utils.rs diff --git a/rust/plugin/src/helpers/tracing.rs b/rust/src/helpers/tracing.rs similarity index 100% rename from rust/plugin/src/helpers/tracing.rs rename to rust/src/helpers/tracing.rs diff --git a/rust/plugin/src/helpers/utils.rs b/rust/src/helpers/utils.rs similarity index 100% rename from rust/plugin/src/helpers/utils.rs rename to rust/src/helpers/utils.rs diff --git a/rust/plugin/src/interop.rs b/rust/src/interop.rs similarity index 100% rename from rust/plugin/src/interop.rs rename to rust/src/interop.rs diff --git a/rust/plugin/src/interop/diff_inspector_section.rs b/rust/src/interop/diff_inspector_section.rs similarity index 100% rename from rust/plugin/src/interop/diff_inspector_section.rs rename to rust/src/interop/diff_inspector_section.rs diff --git a/rust/plugin/src/interop/extension.rs b/rust/src/interop/extension.rs similarity index 100% rename from rust/plugin/src/interop/extension.rs rename to rust/src/interop/extension.rs diff --git a/rust/plugin/src/interop/godot_accessors.rs b/rust/src/interop/godot_accessors.rs similarity index 100% rename from rust/plugin/src/interop/godot_accessors.rs rename to rust/src/interop/godot_accessors.rs diff --git a/rust/plugin/src/interop/godot_diffs.rs b/rust/src/interop/godot_diffs.rs similarity index 100% rename from rust/plugin/src/interop/godot_diffs.rs rename to rust/src/interop/godot_diffs.rs diff --git a/rust/plugin/src/interop/godot_helpers.rs b/rust/src/interop/godot_helpers.rs similarity index 100% rename from rust/plugin/src/interop/godot_helpers.rs rename to rust/src/interop/godot_helpers.rs diff --git a/rust/plugin/src/interop/godot_project.rs b/rust/src/interop/godot_project.rs similarity index 99% rename from rust/plugin/src/interop/godot_project.rs rename to rust/src/interop/godot_project.rs index 5641f548..8e3423fc 100644 --- a/rust/plugin/src/interop/godot_project.rs +++ b/rust/src/interop/godot_project.rs @@ -524,7 +524,7 @@ impl GodotProjectPlugin { fn add_sidebar(&mut self) { self.sidebar_scene = Self - ::force_reload_resource("res://addons/patchwork/gdscript/sidebar.tscn") + ::force_reload_resource("res://addons/patchwork/public/gdscript/sidebar.tscn") .map(|scene| scene.try_cast::().ok()) .flatten(); self.sidebar = if let Some(Some(sidebar)) = self.sidebar_scene.as_ref().map(|scene| scene.instantiate()) { diff --git a/rust/plugin/src/interop/patchwork_config.rs b/rust/src/interop/patchwork_config.rs similarity index 100% rename from rust/plugin/src/interop/patchwork_config.rs rename to rust/src/interop/patchwork_config.rs diff --git a/rust/plugin/src/interop/text_differ_view.rs b/rust/src/interop/text_differ_view.rs similarity index 100% rename from rust/plugin/src/interop/text_differ_view.rs rename to rust/src/interop/text_differ_view.rs diff --git a/rust/plugin/src/lib.rs b/rust/src/lib.rs similarity index 100% rename from rust/plugin/src/lib.rs rename to rust/src/lib.rs diff --git a/rust/plugin/src/parser.rs b/rust/src/parser.rs similarity index 100% rename from rust/plugin/src/parser.rs rename to rust/src/parser.rs diff --git a/rust/plugin/src/parser/godot_parser.rs b/rust/src/parser/godot_parser.rs similarity index 100% rename from rust/plugin/src/parser/godot_parser.rs rename to rust/src/parser/godot_parser.rs diff --git a/rust/plugin/src/project.rs b/rust/src/project.rs similarity index 100% rename from rust/plugin/src/project.rs rename to rust/src/project.rs diff --git a/rust/plugin/src/project/project.rs b/rust/src/project/project.rs similarity index 100% rename from rust/plugin/src/project/project.rs rename to rust/src/project/project.rs diff --git a/rust/plugin/src/project/project_api.rs b/rust/src/project/project_api.rs similarity index 100% rename from rust/plugin/src/project/project_api.rs rename to rust/src/project/project_api.rs diff --git a/rust/plugin/src/project/project_api_impl.rs b/rust/src/project/project_api_impl.rs similarity index 100% rename from rust/plugin/src/project/project_api_impl.rs rename to rust/src/project/project_api_impl.rs diff --git a/rust/plugin/src/project/project_driver.rs b/rust/src/project/project_driver.rs similarity index 100% rename from rust/plugin/src/project/project_driver.rs rename to rust/src/project/project_driver.rs diff --git a/rust/plugin/tests/test.rs b/rust/tests/test.rs similarity index 100% rename from rust/plugin/tests/test.rs rename to rust/tests/test.rs diff --git a/target/.gdignore b/target/.gdignore deleted file mode 100644 index e69de29b..00000000 diff --git a/update_version.py b/update_version.py deleted file mode 100644 index 1cbaa0c2..00000000 --- a/update_version.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -import subprocess - -# open plugin.cfg, replace the line with `version=` with `version=` -with open("plugin.cfg", "r") as file: - lines = file.readlines() - -git_describe = subprocess.check_output(["git", "describe", "--tags", "--abbrev=6"]).decode("utf-8").strip() -print(git_describe) - -# if it has more than two `-` in the version, replace all the subsequent `-` with `+` -if git_describe.count("-") >= 2: - first_index = git_describe.find("-") - if first_index != -1: - git_describe = git_describe[:first_index] + "-" + git_describe[first_index + 1 :].replace("-", "+") - print(git_describe) - -new_lines: list[str] = [] -for line in lines: - if line.startswith("version="): - line = 'version="' + git_describe + '"\n' - new_lines.append(line) - -with open("plugin.cfg", "w") as file: - file.writelines(new_lines)