Streamlined the Setup, Build and Package scripts:
On windows they no longer need the user to press enter every step Moved version info out to version.txt, This will only effect the svn. If you update the version do it in version.txt not in ForgeHooks.java. Introduced the build number into the version string. Cleaned up some extra echos in scripts.
This commit is contained in:
parent
fa564fb3c5
commit
08195cfc03
10 changed files with 78 additions and 27 deletions
|
@ -1,11 +1,15 @@
|
|||
cd ..
|
||||
@cd ..
|
||||
|
||||
rmdir /S /Q src
|
||||
mkdir src
|
||||
@rmdir /S /Q src
|
||||
@mkdir src
|
||||
xcopy /Y /E src_work\* src\
|
||||
|
||||
xcopy /Y /E forge\forge_client\src\net\* src\minecraft\net
|
||||
xcopy /Y /E forge\forge_common\net\* src\minecraft\net
|
||||
xcopy /Y /E forge\forge_common\net\* src\minecraft_server\net
|
||||
|
||||
cmd /C recompile.bat
|
||||
@cd forge
|
||||
@cmd /C inject_version.bat ../src/minecraft/net/minecraft/src/forge/ForgeHooks.java
|
||||
@cmd /C inject_version.bat ../src/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
|
||||
@cd ..
|
||||
|
||||
@echo | call recompile.bat
|
||||
|
|
|
@ -10,6 +10,11 @@ cp -a forge/forge_client/src/net/* src_forge/minecraft/net/
|
|||
cp -a forge/forge_common/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft_server/net/
|
||||
|
||||
cd forge
|
||||
./inject_version.sh ../src_forge/minecraft/net/minecraft/src/forge/ForgeHooks.java
|
||||
./inject_version.sh ../src_forge/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
|
||||
cd ..
|
||||
|
||||
cp -a src_forge src
|
||||
|
||||
./recompile.sh
|
||||
|
|
|
@ -300,12 +300,13 @@ public class ForgeHooks {
|
|||
|
||||
}
|
||||
|
||||
public static final int majorVersion=1;
|
||||
public static final int minorVersion=3;
|
||||
public static final int revisionVersion=1;
|
||||
public static final int majorVersion=0;
|
||||
public static final int minorVersion=0;
|
||||
public static final int revisionVersion=0;
|
||||
public static final int buildVersion=0;
|
||||
static {
|
||||
System.out.printf("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion);
|
||||
ModLoader.getLogger().info(String.format("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion));
|
||||
System.out.printf("MinecraftForge v%d.%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion, buildVersion);
|
||||
ModLoader.getLogger().info(String.format("MinecraftForge v%d.%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion, buildVersion));
|
||||
}
|
||||
|
||||
static boolean toolInit=false;
|
||||
|
|
20
forge/inject_version.bat
Normal file
20
forge/inject_version.bat
Normal file
|
@ -0,0 +1,20 @@
|
|||
@echo off
|
||||
setlocal enableextensions enabledelayedexpansion
|
||||
FOR /F "tokens=1-4" %%A IN (version.txt) DO (
|
||||
set major=%%A
|
||||
set minor=%%B
|
||||
set revision=%%C
|
||||
set build=%%D
|
||||
)
|
||||
set file=%*
|
||||
|
||||
echo Injecting Revision !major!.!minor!.!revision!.!build! %file%
|
||||
|
||||
set PATH=.\bin;%PATH%
|
||||
sed s/majorVersion=0/majorVersion=!major!/ <!file! | ^
|
||||
sed s/minorVersion=0/minorVersion=!minor!/ | ^
|
||||
sed s/revisionVersion=0/revisionVersion=!revision!/ | ^
|
||||
sed s/buildVersion=0/buildVersion=!build!/ | ^
|
||||
tr -d '\r' >!file!.tmp
|
||||
|
||||
mv "!file!.tmp" "!file!"
|
14
forge/inject_version.sh
Normal file
14
forge/inject_version.sh
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
target=$1
|
||||
read major minor rev build <version.txt
|
||||
|
||||
echo Injecting Revision $major.$minor.$rev.$build $target
|
||||
|
||||
sed s/majorVersion=0/majorVersion=$major/ <$target | \
|
||||
sed s/minorVersion=0/minorVersion=$minor/ | \
|
||||
sed s/revisionVersion=0/revisionVersion=$rev/ | \
|
||||
sed s/buildVersion=0/buildVersion=$build/ | \
|
||||
tr -d '\r' > $target.tmp
|
||||
|
||||
mv $target.tmp $target
|
|
@ -3,7 +3,7 @@ echo off
|
|||
echo MinecraftForge Windows Setup Program
|
||||
echo:
|
||||
|
||||
set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32
|
||||
@set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32
|
||||
|
||||
pushd .. >nul
|
||||
|
||||
|
@ -11,8 +11,8 @@ xcopy /Y /E /I forge\conf\* conf
|
|||
|
||||
if exist runtime\bin\fernflower.jar move runtime\bin\fernflower.jar runtime\bin\fernflower.jar-backup
|
||||
|
||||
cmd /C cleanup.bat
|
||||
cmd /C decompile.bat
|
||||
echo | call cleanup.bat
|
||||
echo | call decompile.bat
|
||||
|
||||
if exist runtime\bin\fernflower.jar-backup move runtime\bin\fernflower.jar-backup runtime\bin\fernflower.jar
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
version=$1
|
||||
read major minor revision build <version.txt
|
||||
version=$major.$minor.$revision.$build
|
||||
build_dir=`pwd`
|
||||
dir=`pwd`/../forge-$version
|
||||
|
||||
function remove_svn () {
|
||||
(
|
||||
cd $1
|
||||
cd "$1"
|
||||
|
||||
if [ -d .svn ]; then
|
||||
rm -rf .svn
|
||||
|
@ -24,7 +25,7 @@ function package_all () {
|
|||
|
||||
cp $build_dir/minecraftforge_credits.txt .
|
||||
|
||||
zip -r $dir/minecraftforge$qual-$version.zip \
|
||||
zip -r "$dir/minecraftforge$qual-$version.zip" \
|
||||
minecraftforge_credits.txt \
|
||||
*.class \
|
||||
forge
|
||||
|
@ -34,8 +35,8 @@ cd ../reobf
|
|||
|
||||
remove_svn .
|
||||
|
||||
rm -rf $dir
|
||||
mkdir $dir
|
||||
rm -rf "$dir"
|
||||
mkdir "$dir"
|
||||
|
||||
cd minecraft
|
||||
package_all "-client"
|
||||
|
@ -71,6 +72,11 @@ cp ../install/README.txt .
|
|||
cp ../minecraftforge_credits.txt .
|
||||
cp -r ../doc .
|
||||
|
||||
cd ..
|
||||
sh inject_version.sh forge/src/minecraft/net/minecraft/src/forge/ForgeHooks.java
|
||||
sh inject_version.sh forge/src/minecraft_server/net/minecraft/src/forge/ForgeHooks.java
|
||||
cd forge
|
||||
|
||||
cd src
|
||||
remove_svn .
|
||||
cd ../patches
|
||||
|
@ -81,5 +87,5 @@ cd ..
|
|||
|
||||
cd ..
|
||||
|
||||
zip -r $dir/minecraftforge-src-$version.zip forge
|
||||
zip -r "$dir/minecraftforge-src-$version.zip" forge
|
||||
rm -rf forge
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
cmd /C build.bat
|
||||
@cmd /C build.bat
|
||||
|
||||
cd ..
|
||||
@cd ..
|
||||
|
||||
cmd /C reobfuscate.bat
|
||||
@echo | cmd /C reobfuscate.bat
|
||||
|
||||
set PATH=E:\cygwin\bin;%PATH%
|
||||
@set PATH=E:\cygwin\bin;%PATH%
|
||||
|
||||
cd forge
|
||||
@cd forge
|
||||
|
||||
sh package.sh 1.3.1
|
||||
@sh package.sh
|
||||
|
||||
pause
|
||||
|
|
|
@ -5,7 +5,7 @@ pushd .. >nul
|
|||
rmdir /S /Q src_base
|
||||
rmdir /S /Q src_work
|
||||
|
||||
cmd /C decompile.bat
|
||||
@echo | cmd /C decompile.bat
|
||||
|
||||
pushd src >nul
|
||||
del minecraft\net\minecraft\src\MLProp.java
|
||||
|
@ -17,7 +17,7 @@ pushd .. >nul
|
|||
del ..\forge\modLoaderMP-win.patch
|
||||
popd >nul
|
||||
|
||||
cmd /C updatemd5.bat
|
||||
@echo | cmd /C updatemd5.bat
|
||||
|
||||
mkdir src_base
|
||||
mkdir src_work
|
||||
|
|
1
forge/version.txt
Normal file
1
forge/version.txt
Normal file
|
@ -0,0 +1 @@
|
|||
1 3 1 0
|
Loading…
Reference in a new issue