Skip to content

Commit e25a34b

Browse files
authored
Merge pull request #28 from aws/test_patches
add script for patching/copy resource/build
2 parents 34ac4c7 + 42216be commit e25a34b

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.DS_Store
1+
.DS_Store
2+
.pc

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ Whenever we create a new branch with `vscode` pointing to a specific commit, thi
88

99
## Patching Execution
1010

11-
To properly patch, please follow instructions below:
11+
To properly patch, please run script:
1212

13-
* After cloning the repo, run `git submodule init` and `git submodule update` to initialize the `vscode` submodule.
14-
* Use `quilt` to apply patches in sequence using `quilt push -a` from the root directory.
15-
- Install quilt on mac - `brew install quilt`
16-
* Copy resources with the shell script (also in the root directory) by running these commands:
17-
- `chmod +x copy-resources.sh`
18-
- `./copy-resources.sh`
13+
`sh ./scripts/install.sh`
1914

20-
The above steps will result in changes being applied to the `vscode` folder.
15+
This script will:
16+
- use `quilt` to pop any existing patches.
17+
- update the submodule to verify the local version is in parity with source
18+
- apply all patches with `quilt` from `./patches`
19+
- runs `./scripts/copy-resource.sh` that will copy patched version of code - oss from `./vscode` into `./patched-vscode` folder along with icon(s) and svg(s) from `./resources` folder
20+
- runs `yarn install` and downloads built in extensions on patched submodule
2121

2222
## Troubleshooting and Feedback
2323

patches/sagemaker-integration.diff

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Index: sagemaker-code-editor/vscode/product.json
100100
"applicationName": "code-oss",
101101
"dataFolderName": ".vscode-oss",
102102
"win32MutexName": "vscodeoss",
103-
@@ -34,53 +34,17 @@
103+
@@ -34,52 +34,16 @@
104104
"urlProtocol": "code-oss",
105105
"webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/",
106106
"builtInExtensions": [
@@ -165,9 +165,6 @@ Index: sagemaker-code-editor/vscode/product.json
165165
+ "linkProtectionTrustedDomains": [
166166
+ "https://open-vsx.org"
167167
]
168-
-}
169-
\ No newline at end of file
170-
+}
171168
Index: sagemaker-code-editor/vscode/src/vs/platform/product/common/product.ts
172169
===================================================================
173170
--- sagemaker-code-editor.orig/vscode/src/vs/platform/product/common/product.ts
File renamed without changes.

scripts/install.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Set current project root
5+
PROJ_ROOT=$(pwd)
6+
7+
# Clean out patches
8+
printf "\n======== Cleaning out patches ========\n"
9+
quilt pop -a
10+
11+
# make sure module is current
12+
printf "\n======== Updating submodule ========\n"
13+
git submodule update --init
14+
15+
# Apply patches
16+
printf "\n======== Applying patches ========\n"
17+
{
18+
quilt push -a --leave-rejects --color=auto
19+
} || {
20+
printf "\nPatching error, review logs!\n"
21+
find ./vscode -name "*.rej"
22+
exit 1
23+
}
24+
25+
# Copy resources
26+
printf "\n======== Copy resources ========\n"
27+
sh ${PROJ_ROOT}/scripts/copy-resources.sh
28+
29+
# Build the project
30+
printf "\n======== Building project in ${PROJ_ROOT}/vscode ========\n"
31+
yarn --cwd "${PROJ_ROOT}/vscode" install --pure-lockfile --verbose
32+
yarn --cwd "${PROJ_ROOT}/vscode" download-builtin-extensions

0 commit comments

Comments
 (0)