Skip to content

Commit ee2f22c

Browse files
committed
[IMP] attach additional stubs
1 parent b2da84a commit ee2f22c

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/build_plugin.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@ jobs:
2626
run: |
2727
wget ${{ steps.version.outputs.changelog_url }} -O CHANGELOG.md
2828
29+
- name: Checkout additional stubs from OdooLS
30+
uses: actions/checkout@v4
31+
with:
32+
repository: odoo/odoo-ls
33+
ref: ${{ steps.version.outputs.version }}
34+
path: additional_stubs
35+
sparse-checkout: server/additional_stubs
36+
sparse-checkout-cone-mode: false
37+
38+
- name: Flatten additional_stubs and clean
39+
run: |
40+
# Move the stubs to the root of additional_stubs
41+
mv additional_stubs/server/additional_stubs/* additional_stubs/
42+
rm -rf additional_stubs/server
43+
2944
- name: Download language server binaries
3045
run: |
3146
VERSION=${{ steps.version.outputs.version }}

gradle/copyBinary.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ tasks.register<Copy>("copyTypeshed") {
1414
}
1515

1616
from("typeshed")
17+
from("additional_stubs") {
18+
into("additional_stubs") // places inside typeshed/
19+
}
1720
into("src/main/resources/typeshed")
1821
}

src/main/kotlin/com/odoo/odools/OdooLSInstallationProjectActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class OdooLSInstallationProjectActivity : ProjectActivity, DumbAware {
8282
}
8383
}
8484

85-
fun ressourceToInstallPath(resourcePath: String, targetPath: Path) {
85+
fun resourceToInstallPath(resourcePath: String, targetPath: Path) {
8686
javaClass.classLoader.getResourceAsStream(resourcePath).use { input ->
8787
requireNotNull(input) { "Resource not found: $resourcePath" }
8888
try {
@@ -192,11 +192,11 @@ class OdooLSInstallationProjectActivity : ProjectActivity, DumbAware {
192192

193193
installedVersionOlder(Paths.get(targetLocation, exeName)) { isOlder ->
194194
if (isOlder) {
195-
ressourceToInstallPath("odools-binaries/${targetOs}/$exeName", Paths.get(targetLocation, exeName))
195+
resourceToInstallPath("odools-binaries/${targetOs}/$exeName", Paths.get(targetLocation, exeName))
196196

197197
if (SystemInfo.isWindows &&
198198
(!Files.exists(Paths.get(targetLocation, "odoo_ls_server.pdb")))) {
199-
ressourceToInstallPath("odools-binaries/${targetOs}/odoo_ls_server.pdb", Paths.get(targetLocation, "odoo_ls_server.pdb"))
199+
resourceToInstallPath("odools-binaries/${targetOs}/odoo_ls_server.pdb", Paths.get(targetLocation, "odoo_ls_server.pdb"))
200200
}
201201
if (!SystemInfo.isWindows) {
202202
Paths.get(targetLocation, exeName).toFile().setExecutable(true, false)

0 commit comments

Comments
 (0)