diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c323755b..4b6967b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,21 +55,7 @@ jobs: uses: actions/checkout@v4 with: persist-credentials: false - submodules: false - - - name: Checkout NetBeans - uses: actions/checkout@v4 - with: - repository: apache/netbeans - path: netbeans - ref: 23 - - - name: Checkout NetBeans l10n - uses: actions/checkout@v4 - with: - repository: apache/netbeans-l10n - path: netbeans-l10n - ref: ece00239dc7a208fba60703c2256ffd818da1646 + submodules: true - name: Apply NetBeans patches run: ant apply-patches diff --git a/.gitignore b/.gitignore index 58548e20..643416e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ build/ -netbeans/ -netbeans-l10n/ .DS_STORE .idea/ *.iml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..a04938ae --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "netbeans-l10n"] + path = netbeans-l10n + url = https://github.com/apache/netbeans-l10n.git +[submodule "netbeans"] + path = netbeans + url = https://github.com/apache/netbeans.git diff --git a/BUILD.md b/BUILD.md index 82f88857..3d9490fb 100644 --- a/BUILD.md +++ b/BUILD.md @@ -35,16 +35,7 @@ ## Fetching and building the code ```bash -$ git clone https://github.com/oracle/javavscode.git -$ cd javavscode/ -$ git clone https://github.com/apache/netbeans.git -$ cd netbeans/ -$ git checkout 23 -$ cd .. -$ git clone https://github.com/apache/netbeans-l10n.git -$ cd netbeans-l10n -$ git checkout ece00239dc7a208fba60703c2256ffd818da1646 # head commit in master -$ cd .. +$ git clone --recurse-submodules https://github.com/oracle/javavscode.git # the following target requires git executable to be on PATH: $ ant apply-patches $ ant build-netbeans @@ -107,3 +98,24 @@ $ npm_config_https_proxy=http://your.proxy.com:port ant test-vscode-ext when executing the tests for the first time. That shall overcome the proxy and download an instance of `code` to execute the tests with. + +## Working with submodules +This project uses [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) . In particular netbeans and netbeans-l10n are submodules pointing to specific commits in their respective repositories . +### Switching Branches +Add the --recurse-submodules flag to the git checkout command to update the submodules during the checkout. +```bash +git checkout --recurse-submodules +``` +Note:- Merging branches with submodules pointing to different commits can be tricky. Refer the [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) for more details on the same. +### Changing submodules versions +```bash +# Fetching changes from remote submodule repositories +git submodule update --remote +# Changing the submodule version +cd netbeans +git checkout +cd .. +# Committing the submodule version +git add netbeans +git commit -m "Updated netbeans" +``` \ No newline at end of file diff --git a/netbeans b/netbeans new file mode 160000 index 00000000..2985f1fa --- /dev/null +++ b/netbeans @@ -0,0 +1 @@ +Subproject commit 2985f1fa57ce0c1877bad0f86d5e5504d65f9286 diff --git a/netbeans-l10n b/netbeans-l10n new file mode 160000 index 00000000..ece00239 --- /dev/null +++ b/netbeans-l10n @@ -0,0 +1 @@ +Subproject commit ece00239dc7a208fba60703c2256ffd818da1646