Skip to content

Commit a0e0153

Browse files
committed
Update github mcp.
1 parent c1c624d commit a0e0153

File tree

8 files changed

+752
-788
lines changed

8 files changed

+752
-788
lines changed

github/bin/dispatcher.cmd

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@rem ***************************************************************************
2+
@rem Copyright (c) 2025 James M. Zhou
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem http://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem ***************************************************************************
16+
@echo off
17+
18+
@REM Set the local Maven repository path for tinystruct.jar
19+
set "MAVEN_REPO=%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct"
20+
@REM Consolidate classpath entries, initialize ROOT and VERSION
21+
set "ROOT=%~dp0.."
22+
set "VERSION=1.6.6"
23+
24+
@REM Define the paths for tinystruct jars in the Maven repository
25+
set "DEFAULT_JAR_FILE=%MAVEN_REPO%\%VERSION%\tinystruct-%VERSION%.jar"
26+
set "DEFAULT_JAR_FILE_WITH_DEPENDENCIES=%MAVEN_REPO%\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar"
27+
28+
REM Check which jar to use for extracting Maven Wrapper
29+
if exist "%DEFAULT_JAR_FILE_WITH_DEPENDENCIES%" (
30+
set "JAR_PATH=%DEFAULT_JAR_FILE_WITH_DEPENDENCIES%"
31+
) else (
32+
set "JAR_PATH=%DEFAULT_JAR_FILE%"
33+
)
34+
35+
@REM Check if JAVA_HOME is set and valid
36+
if "%JAVA_HOME%" == "" (
37+
echo Error: JAVA_HOME not found in your environment. >&2
38+
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
39+
exit /B 1
40+
)
41+
42+
if not exist "%JAVA_HOME%\bin\java.exe" (
43+
echo Error: JAVA_HOME is set to an invalid directory. >&2
44+
echo JAVA_HOME = "%JAVA_HOME%" >&2
45+
echo Please set the JAVA_HOME variable in your environment to match the location of your Java installation. >&2
46+
exit /B 1
47+
)
48+
49+
set "JAVA_CMD=%JAVA_HOME%\bin\java.exe"
50+
51+
@REM Check if the Maven Wrapper is already available
52+
if not exist "mvnw" (
53+
echo Maven Wrapper not found. Extracting from JAR...
54+
55+
@REM Run Java code to extract the ZIP file from the JAR
56+
%JAVA_CMD% -cp "%JAR_PATH%" org.tinystruct.system.Dispatcher maven-wrapper --jar-file-path "%JAR_PATH%" --destination-dir "%ROOT%"
57+
58+
if exist "%ROOT%\maven-wrapper.zip" (
59+
@REM Now unzip the Maven Wrapper files
60+
powershell -Command "Expand-Archive -Path '%ROOT%\maven-wrapper.zip' -DestinationPath '%ROOT%'"
61+
@REM Delete the ZIP file after extraction
62+
del /F /Q "%ROOT%\maven-wrapper.zip"
63+
echo Maven wrapper setup completed.
64+
) else (
65+
echo Error: Maven wrapper ZIP file not found in JAR.
66+
exit /B 1
67+
)
68+
)
69+
70+
set "classpath=%ROOT%\target\classes;%ROOT%\lib\tinystruct-%VERSION%-jar-with-dependencies.jar;%ROOT%\lib\tinystruct-%VERSION%.jar;%ROOT%\lib\*;%ROOT%\WEB-INF\lib\*;%ROOT%\WEB-INF\classes;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%-jar-with-dependencies.jar;%USERPROFILE%\.m2\repository\org\tinystruct\tinystruct\%VERSION%\tinystruct-%VERSION%.jar"
71+
72+
@REM Run Java application
73+
%JAVA_CMD% -cp "%classpath%" org.tinystruct.system.Dispatcher %*

github/pom.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@
2222
<artifactId>maven-compiler-plugin</artifactId>
2323
<version>3.10.1</version>
2424
<configuration>
25-
<source>10</source>
26-
<target>10</target>
25+
<source>17</source>
26+
<target>17</target>
27+
</configuration>
28+
</plugin>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-surefire-plugin</artifactId>
32+
<version>3.0.0</version>
33+
<configuration>
34+
<includes>
35+
<include>**/*Test.java</include>
36+
</includes>
2737
</configuration>
2838
</plugin>
2939
<plugin>

github/run-integration-tests.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@echo off
2+
echo Running GitHub integration tests...
3+
cd %~dp0
4+
mvn test -Dtest=GitHubIntegrationTest
5+
pause

github/run-integration-tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
echo "Running GitHub integration tests..."
3+
cd "$(dirname "$0")"
4+
mvn test -Dtest=GitHubIntegrationTest

0 commit comments

Comments
 (0)