Commit c5e50fb1 authored by cvet's avatar cvet

Linux and macOS builds now packed in tar/tar.gz files with correct chmod (777).

git-svn-id: https://xp-dev.com/svn/fonline_sdk@781 71b6ff52-6597-447a-9a87-58edf7a03249
parent 68dbe0a6
......@@ -2,29 +2,26 @@
void ProcessAll( string gameName, string sdkPath, string jdkPath, string androidSdkPath, string emscriptenPath )
{
Log( "Build client distributives." );
int r = 0;
r |= BuildTarget( "Windows", gameName, sdkPath, jdkPath, androidSdkPath, emscriptenPath );
r |= BuildTarget( "Linux", gameName, sdkPath, jdkPath, androidSdkPath, emscriptenPath );
r |= BuildTarget( "Mac", gameName, sdkPath, jdkPath, androidSdkPath, emscriptenPath );
r |= BuildTarget( "Android", gameName, sdkPath, jdkPath, androidSdkPath, emscriptenPath );
r |= BuildTarget( "Web", gameName, sdkPath, jdkPath, androidSdkPath, emscriptenPath );
Assert( r == 0, "Not all builds generated" );
}
int BuildTarget( string target, string gameName, string sdkPath, string jdkPath, string androidSdkPath, string emscriptenPath )
{
Log( "Build " + target + " distributives." );
string scriptCommand = "python -u \"" + sdkPath + "/Modules/BuildSystem/PyBuild.py\" " + gameName +
" \"" + sdkPath + "/Binaries/Client\" ./Update ../FOnline.cfg ../Client " +
"\"" + jdkPath + "\" \"" + androidSdkPath + "\" \"" + emscriptenPath + "\" ";
int r = SystemCall( scriptCommand + "Windows" );
if( r != 0 )
Log( "Build Windows distributive failed." );
r = SystemCall( scriptCommand + "Linux" );
if( r != 0 )
Log( "Build Linux distributive failed." );
r = SystemCall( scriptCommand + "Mac" );
if( r != 0 )
Log( "Build Mac distributive failed." );
r = SystemCall( scriptCommand + "Android" );
if( r != 0 )
Log( "Build Android distributive failed." );
r = SystemCall( scriptCommand + "Web" );
string output = "";
int r = SystemCall( scriptCommand + target, output );
if( r != 0 )
Log( "Build Web distributive failed." );
Log( "Failed, output:\n" + output );
return r;
}
......@@ -6,6 +6,7 @@ try:
import shutil
import zipfile
import subprocess
import tarfile
for a in sys.argv:
print a
......@@ -49,6 +50,18 @@ try:
zip.write(os.path.join(root, file), os.path.join(os.path.relpath(root, path), file))
zip.close()
def makeTar(name, path, mode):
def filter(tarinfo):
tarinfo.mode = 0777
return tarinfo
tar = tarfile.open(name, mode)
dir = os.getcwd()
newDir, folder = os.path.split(path)
os.chdir(newDir)
tar.add(folder, filter = filter)
os.chdir(dir)
tar.close()
def build():
gameOutputPath = targetOutputPath + '/' + gameName
......@@ -88,8 +101,9 @@ try:
patchConfig(gameOutputPath + '/' + gameName + '32')
patchConfig(gameOutputPath + '/' + gameName + '64')
# Zip
makeZip(targetOutputPath + '/' + gameName + '.zip', gameOutputPath)
# Tar
makeTar(targetOutputPath + '/' + gameName + '.tar', gameOutputPath, 'w')
makeTar(targetOutputPath + '/' + gameName + '.tar.gz', gameOutputPath, 'w:gz')
elif buildTarget == 'Mac':
# Raw files
......@@ -98,8 +112,9 @@ try:
shutil.copy(binariesPath + '/Mac/FOnline', gameOutputPath + '/' + gameName)
patchConfig(gameOutputPath + '/' + gameName)
# Zip
makeZip(targetOutputPath + '/' + gameName + '.zip', gameOutputPath)
# Tar
makeTar(targetOutputPath + '/' + gameName + '.tar', gameOutputPath, 'w')
makeTar(targetOutputPath + '/' + gameName + '.tar.gz', gameOutputPath, 'w:gz')
elif buildTarget == 'Android':
shutil.copytree(binariesPath + '/Android', gameOutputPath)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment