Skip to content

Adding netbeans and netbeans-l10n as submodules #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
build/
netbeans/
netbeans-l10n/
.DS_STORE
.idea/
*.iml
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
32 changes: 22 additions & 10 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <branch_name>
```
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 <commit_hash>
cd ..
# Committing the submodule version
git add netbeans
git commit -m "Updated netbeans"
```
1 change: 1 addition & 0 deletions netbeans
Submodule netbeans added at 2985f1
1 change: 1 addition & 0 deletions netbeans-l10n
Submodule netbeans-l10n added at ece002