Skip to content

Commit 3faf90c

Browse files
authored
Build Server JAR Automatically (#61)
1 parent a9349b7 commit 3faf90c

5 files changed

Lines changed: 33 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,24 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v4
1515

16+
- name: Setup Java
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: 17
20+
distribution: temurin
21+
1622
- name: Setup Node.js
1723
uses: actions/setup-node@v4
1824
with:
1925
node-version: 20
2026

27+
- name: Build Server JAR
28+
working-directory: ./server
29+
run: |
30+
mvn clean package -DskipTests
31+
mkdir -p ../client/server
32+
cp target/language-server-liquidjava.jar ../client/server/
33+
2134
- name: Install dependencies and build
2235
working-directory: ./client
2336
run: |

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Java related
22
*.class
3-
# *.jar
3+
*.jar
44
*.war
55
*.ear
66
*.nar
-71 MB
Binary file not shown.

install.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/bash
22
VERSION=$1
3+
SKIP_SERVER=false
34

45
# check if version argument provided
56
if [ -z "$VERSION" ]; then
6-
echo "Usage: $0 1.2.3"
7+
echo "Usage: $0 1.2.3 [--skip-server]"
78
exit 1
89
fi
910

11+
# check for flags
12+
if [ "$2" == "--skip-server" ]; then
13+
SKIP_SERVER=true
14+
fi
15+
1016
# check valid version format
1117
if [[ ! $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
1218
echo "Version must be in format 1.2.3"
@@ -19,6 +25,16 @@ if ! grep -q "\"version\": \"$VERSION\"" ./client/package.json; then
1925
exit 1
2026
fi
2127

28+
# build server jar
29+
if [ "$SKIP_SERVER" = false ]; then
30+
cd server
31+
mvn clean package -DskipTests
32+
mkdir -p ../client/server
33+
cp target/language-server-liquidjava.jar ../client/server/
34+
cd ..
35+
fi
36+
37+
# build and install vscode extension
2238
cd client
2339
npx vsce package
2440
code --install-extension liquid-java-$VERSION.vsix

server/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</testResource>
1414
</testResources>
1515
<plugins>
16-
<plugin>
16+
<!-- <plugin>
1717
<groupId>net.revelc.code.formatter</groupId>
1818
<artifactId>formatter-maven-plugin</artifactId>
1919
<version>2.16.0</version>
@@ -31,7 +31,7 @@
3131
<compilerCompliance>20</compilerCompliance>
3232
<compilerTargetPlatform>20</compilerTargetPlatform>
3333
</configuration>
34-
</plugin>
34+
</plugin> -->
3535
<plugin>
3636
<groupId>org.apache.maven.plugins</groupId>
3737
<artifactId>maven-compiler-plugin</artifactId>

0 commit comments

Comments
 (0)