Преглед на файлове

refactor: reorganize files (#2185)

Baptiste Augrain преди 4 месеца
родител
ревизия
fef4a9aa03

+ 3 - 3
.github/workflows/insider-linux.yml

@@ -232,7 +232,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_linux_bin.sh
+        run: ./build/linux/package_bin.sh
         if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
 
       - name: Prepare assets
@@ -362,7 +362,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_linux_reh.sh
+        run: ./build/linux/package_reh.sh
         if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
@@ -444,7 +444,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_alpine_reh.sh
+        run: ./build/alpine/package_reh.sh
         if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
 
       - name: Release

+ 2 - 2
.github/workflows/insider-spearhead.yml

@@ -56,8 +56,8 @@ jobs:
         run: ./build.sh
         if: env.SHOULD_BUILD == 'yes'
 
-      - name: Update <quality>.json
-        run: ./update_qualityjson.sh
+      - name: Update upstream version
+        run: ./update_upstream.sh
         env:
           GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
           GITHUB_USERNAME: ${{ github.repository_owner }}

+ 1 - 1
.github/workflows/insider-windows.yml

@@ -214,7 +214,7 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.vscode_arch }}
           npm_config_target_arch: ${{ matrix.vscode_arch }}
-        run: ./package_windows.sh
+        run: ./build/windows/package.sh
         if: env.SHOULD_BUILD == 'yes'
 
       - name: Prepare assets

+ 3 - 3
.github/workflows/stable-linux.yml

@@ -231,7 +231,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_linux_bin.sh
+        run: ./build/linux/package_bin.sh
         if: env.DISABLED != 'yes' && env.SHOULD_BUILD == 'yes'
 
       - name: Prepare assets
@@ -361,7 +361,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_linux_reh.sh
+        run: ./build/linux/package_reh.sh
         if: env.DISABLED != 'yes' && (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true')
 
       - name: Release
@@ -443,7 +443,7 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.npm_arch }}
-        run: ./package_alpine_reh.sh
+        run: ./build/alpine/package_reh.sh
         if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true'
 
       - name: Release

+ 2 - 2
.github/workflows/stable-spearhead.yml

@@ -51,8 +51,8 @@ jobs:
         run: ./build.sh
         if: env.SHOULD_BUILD == 'yes'
 
-      - name: Update <quality>.json
-        run: ./update_qualityjson.sh
+      - name: Update upstream version
+        run: ./update_upstream.sh
         env:
           GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
           GITHUB_USERNAME: ${{ github.repository_owner }}

+ 1 - 1
.github/workflows/stable-windows.yml

@@ -213,7 +213,7 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           npm_config_arch: ${{ matrix.vscode_arch }}
           npm_config_target_arch: ${{ matrix.vscode_arch }}
-        run: ./package_windows.sh
+        run: ./build/windows/package.sh
         if: env.SHOULD_BUILD == 'yes'
 
       - name: Prepare assets

+ 1 - 1
CONTRIBUTING.md

@@ -34,7 +34,7 @@ If you want to update the existing patches, please follow the section [`Patch Up
 ### Add a new patch
 
 - first, you need to build VSCodium
-- then use the command `patch.sh <your patch name>`, to initiate a new patch
+- then use the command `./dev/patch.sh <your patch name>`, to initiate a new patch
 - when the script pauses at `Press any key when the conflict have been resolved...`, open `vscode` directory in **VSCodium**
 - run `yarn watch`
 - run `./script/code.sh`

+ 0 - 0
package_alpine_reh.sh → build/alpine/package_reh.sh


+ 0 - 0
electron_linux_loong64.sh → build/linux/loong64/electron.sh


+ 0 - 0
electron_linux_loong64.sha256sums → build/linux/loong64/electron.sha256sums


+ 0 - 0
ripgrep_linux_loong64.sh → build/linux/loong64/ripgrep.sh


+ 6 - 6
package_linux_bin.sh → build/linux/package_bin.sh

@@ -41,16 +41,16 @@ elif [[ "${VSCODE_ARCH}" == "loong64" ]]; then
   export VSCODE_SKIP_SETUPENV=1
 fi
 
-if [[ -f "../electron_linux_${VSCODE_ARCH}.sh" ]]; then
+if [[ -f "../build/linux/${VSCODE_ARCH}/electron.sh" ]]; then
   # add newline at the end of the file
   echo "" >> build/checksums/electron.txt
 
-  if [[ -f "../electron_linux_${VSCODE_ARCH}.sha256sums" ]]; then
-    cat "../electron_linux_${VSCODE_ARCH}.sha256sums" >> build/checksums/electron.txt
+  if [[ -f "../build/linux/${VSCODE_ARCH}/electron.sha256sums" ]]; then
+    cat "../build/linux/${VSCODE_ARCH}/electron.sha256sums" >> build/checksums/electron.txt
   fi
 
   # shellcheck disable=SC1090
-  source "../electron_linux_${VSCODE_ARCH}.sh"
+  source "../build/linux/${VSCODE_ARCH}/electron.sh"
 
   if [[ "${ELECTRON_VERSION}" != "$( yarn config get target )" ]]; then
     # Fail the pipeline if electron target doesn't match what is used.
@@ -124,8 +124,8 @@ node build/azure-pipelines/distro/mixin-npm
 
 yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
 
-if [[ -f "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh" ]]; then
-  bash "../ripgrep_${VSCODE_PLATFORM}_${VSCODE_ARCH}.sh" "../VSCode-linux-${VSCODE_ARCH}/resources/app/node_modules"
+if [[ -f "../build/linux/${VSCODE_ARCH}/ripgrep.sh" ]]; then
+  bash "../build/linux/${VSCODE_ARCH}/ripgrep.sh" "../VSCode-linux-${VSCODE_ARCH}/resources/app/node_modules"
 fi
 
 find "../VSCode-linux-${VSCODE_ARCH}" -print0 | xargs -0 touch -c

+ 0 - 0
package_linux_reh.sh → build/linux/package_reh.sh


+ 0 - 0
electron_linux_ppc64le.sh → build/linux/ppc64le/electron.sh


+ 0 - 0
electron_linux_ppc64le.sha256sums → build/linux/ppc64le/electron.sha256sums


+ 0 - 0
electron_linux_riscv64.sh → build/linux/riscv64/electron.sh


+ 0 - 0
electron_linux_riscv64.sha256sums → build/linux/riscv64/electron.sha256sums


+ 0 - 0
ripgrep_linux_riscv64.sh → build/linux/riscv64/ripgrep.sh


+ 0 - 0
include_osx.gypi → build/osx/include.gypi


+ 0 - 0
package_windows.sh → build/windows/package.sh


+ 0 - 0
prepare_assets.sh → build/windows/prepare_assets.sh


+ 1 - 1
build/build.ps1 → dev/build.ps1

@@ -3,4 +3,4 @@
 # first so `bash` is the one installed with `git`, avoid conflict with WSL
 $env:Path = "C:\Program Files\Git\bin;" + $env:Path
 
-bash ./build/build.sh
+bash ./dev/build.sh

+ 4 - 4
build/build.sh → dev/build.sh

@@ -2,7 +2,7 @@
 # shellcheck disable=SC1091,SC2129
 
 ### Windows
-# to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./build/build.sh
+# to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./dev/build.sh
 ###
 
 export APP_NAME="VSCodium"
@@ -124,7 +124,7 @@ if [[ "${SKIP_BUILD}" == "no" ]]; then
       echo "{}" > ~/.gyp/include.gypi.pre-vscodium
     fi
 
-    cp ./include_osx.gypi ~/.gyp/include.gypi
+    cp ./build/osx/include.gypi ~/.gyp/include.gypi
   fi
 
   . build.sh
@@ -134,8 +134,8 @@ if [[ "${SKIP_BUILD}" == "no" ]]; then
   fi
 
   if [[ "${VSCODE_LATEST}" == "yes" ]]; then
-    jsonTmp=$( cat "${VSCODE_QUALITY}.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )
-    echo "${jsonTmp}" > "${VSCODE_QUALITY}.json" && unset jsonTmp
+    jsonTmp=$( cat "./upstream/${VSCODE_QUALITY}.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )
+    echo "${jsonTmp}" > "./upstream/${VSCODE_QUALITY}.json" && unset jsonTmp
   fi
 fi
 

+ 0 - 0
build/build_docker.sh → dev/build_docker.sh


+ 0 - 0
patch.sh → dev/patch.sh


+ 0 - 0
build/update_api.sh → dev/update_api.sh


+ 0 - 0
build/update_patches.sh → dev/update_patches.sh


+ 10 - 10
docs/howto-build.md

@@ -51,21 +51,21 @@ see [the common dependencies](#dependencies)
 
 ## <a id="build-scripts"></a>Build Scripts
 
-A build helper script can be found at `build/build.sh`.
+A build helper script can be found at `dev/build.sh`.
 
-- Linux: `./build/build.sh`
-- MacOS: `./build/build.sh`
-- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build.ps1` or `"C:\Program Files\Git\bin\bash.exe" ./build/build.sh`
+- Linux: `./dev/build.sh`
+- MacOS: `./dev/build.sh`
+- Windows: `powershell -ExecutionPolicy ByPass -File .\dev\build.ps1` or `"C:\Program Files\Git\bin\bash.exe" ./dev/build.sh`
 
 ### Insider
 
-The `insider` version can be built with `./build/build.sh -i` on the `insider` branch.
+The `insider` version can be built with `./dev/build.sh -i` on the `insider` branch.
 
-You can try the latest version with the command `./build/build.sh -il` but the patches might not be up to date.
+You can try the latest version with the command `./dev/build.sh -il` but the patches might not be up to date.
 
 ### Flags
 
-The script `build/build.sh` provides several flags:
+The script `dev/build.sh` provides several flags:
 
 - `-i`: build the Insiders version
 - `-l`: build with latest version of Visual Studio Code
@@ -93,8 +93,8 @@ review-tools.snap-review --allow-classic codium*.snap
 
 ## <a id="patch-update-process-semiauto"></a>Semi-Automated
 
-- run `./build/build_<os>.sh`, if a patch is failing then,
-- run `./build/update_patches.sh`
+- run `./dev/build.sh`, if a patch is failing then,
+- run `./dev/update_patches.sh`
 - when the script pauses at `Press any key when the conflict have been resolved...`, open `vscode` directory in **VSCodium**
 - fix all the `*.rej` files
 - run `yarn watch`
@@ -103,7 +103,7 @@ review-tools.snap-review --allow-classic codium*.snap
 
 ## <a id="patch-update-process-manual"></a>Manual
 
-- run `./build/build_<os>.sh`, if a patch is failing then,
+- run `./dev/build.sh`, if a patch is failing then,
 - open `vscode` directory in **VSCodium**
 - revert all changes
 - run `git apply --reject ../patches/<name>.patch`

+ 5 - 5
get_repo.sh

@@ -9,13 +9,13 @@ if [[ "${CI_BUILD}" != "no" ]]; then
 fi
 
 if [[ -z "${RELEASE_VERSION}" ]]; then
-  if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "${VSCODE_QUALITY}.json" ]]; then
+  if [[ "${VSCODE_LATEST}" == "yes" ]] || [[ ! -f "./upstream/${VSCODE_QUALITY}.json" ]]; then
     echo "Retrieve lastest version"
     UPDATE_INFO=$( curl --silent --fail "https://update.code.visualstudio.com/api/update/darwin/${VSCODE_QUALITY}/0000000000000000000000000000000000000000" )
   else
     echo "Get version from ${VSCODE_QUALITY}.json"
-    MS_COMMIT=$( jq -r '.commit' "${VSCODE_QUALITY}.json" )
-    MS_TAG=$( jq -r '.tag' "${VSCODE_QUALITY}.json" )
+    MS_COMMIT=$( jq -r '.commit' "./upstream/${VSCODE_QUALITY}.json" )
+    MS_TAG=$( jq -r '.tag' "./upstream/${VSCODE_QUALITY}.json" )
   fi
 
   if [[ -z "${MS_COMMIT}" ]]; then
@@ -53,8 +53,8 @@ else
     fi
   fi
 
-  if [[ "${MS_TAG}" == "$( jq -r '.tag' "${VSCODE_QUALITY}".json )" ]]; then
-    MS_COMMIT=$( jq -r '.commit' "${VSCODE_QUALITY}".json )
+  if [[ "${MS_TAG}" == "$( jq -r '.tag' "./upstream/${VSCODE_QUALITY}.json" )" ]]; then
+    MS_COMMIT=$( jq -r '.commit' "./upstream/${VSCODE_QUALITY}.json" )
   else
     echo "Error: No MS_COMMIT for ${RELEASE_VERSION}"
     exit 1

+ 2 - 2
update_qualityjson.sh → update_upstream.sh

@@ -12,8 +12,8 @@ if [[ -z "${GH_TOKEN}" ]] && [[ -z "${GITHUB_TOKEN}" ]] && [[ -z "${GH_ENTERPRIS
   exit 0
 fi
 
-jsonTmp=$( cat "${VSCODE_QUALITY}.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )
-echo "${jsonTmp}" > "${VSCODE_QUALITY}.json" && unset jsonTmp
+jsonTmp=$( cat "./upstream/${VSCODE_QUALITY}.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )
+echo "${jsonTmp}" > "./upstream/${VSCODE_QUALITY}.json" && unset jsonTmp
 
 git config user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
 git config user.name "${GITHUB_USERNAME} CI"

+ 0 - 0
insider.json → upstream/insider.json


+ 0 - 0
stable.json → upstream/stable.json