Skip to content

Commit

Permalink
refactor: reorganize files (#2185)
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam authored Jan 6, 2025
1 parent 31f2fa2 commit fef4a9a
Show file tree
Hide file tree
Showing 32 changed files with 41 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/insider-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/insider-spearhead.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/insider-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/stable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stable-spearhead.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions package_linux_bin.sh → build/linux/package_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build/build.ps1 → dev/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions build/build.sh → dev/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 10 additions & 10 deletions docs/howto-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand All @@ -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`
Expand Down
10 changes: 5 additions & 5 deletions get_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions update_qualityjson.sh → update_upstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)}' )[email protected]"
git config user.name "${GITHUB_USERNAME} CI"
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit fef4a9a

Please sign in to comment.