-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch-project.bat
More file actions
66 lines (58 loc) · 2.23 KB
/
switch-project.bat
File metadata and controls
66 lines (58 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
@echo off
REM MochaMix Project and Adapter Switcher
REM Usage: switch-project.bat [project] [adapter]
REM Example: switch-project.bat mochamix v1_21_1
if "%1"=="" (
echo Current project settings:
findstr "mochamix.project=" gradle.properties 2>nul || echo mochamix.project=not set
findstr "mochamix.adapter=" gradle.properties 2>nul || echo mochamix.adapter=not set
echo.
echo Available projects: mochamix, logical-loadouts, voidloom, loot-sparkle
echo Available adapters: v1_21_1, v1_21_5
echo Usage: switch-project.bat [project] [adapter]
echo Example: switch-project.bat mochamix v1_21_1
goto :eof
)
if "%2"=="" (
echo Error: Both project and adapter must be specified
echo Usage: switch-project.bat [project] [adapter]
echo Available projects: mochamix, logical-loadouts, voidloom, loot-sparkle
echo Available adapters: v1_21_1, v1_21_5
goto :eof
)
REM Validate project
if "%1"=="mochamix" goto :checkAdapter
if "%1"=="logical-loadouts" goto :checkAdapter
if "%1"=="voidloom" goto :checkAdapter
if "%1"=="loot-sparkle" goto :checkAdapter
echo Invalid project: %1
echo Valid options: mochamix, logical-loadouts, voidloom, loot-sparkle
goto :eof
:checkAdapter
REM Validate adapter
if "%2"=="v1_21_1" goto :switch
if "%2"=="v1_21_5" goto :switch
echo Invalid adapter: %2
echo Valid options: v1_21_1, v1_21_5
goto :eof
:switch
REM Update both project and adapter settings
powershell -Command "(Get-Content gradle.properties) -replace '^mochamix\.project=.*', 'mochamix.project=%1' | Set-Content gradle.properties"
powershell -Command "(Get-Content gradle.properties) -replace '^mochamix\.adapter=.*', 'mochamix.adapter=%2' | Set-Content gradle.properties"
echo Switched to project: %1, adapter: %2
echo.
REM Verify the project/adapter directory exists
if exist "projects\%1\%2" (
echo Project directory verified: projects\%1\%2
) else (
echo WARNING: Project directory not found: projects\%1\%2
echo Please ensure the directory exists before building
)
echo.
echo Generating IDE context...
gradlew -b ide-context.gradle generateContext --quiet
echo.
echo Next steps:
echo 1. Reload/refresh your IDE project
echo 2. Verify that project classes are now recognized
echo 3. Build with: gradlew clean build