Skip to content

Commit

Permalink
Improve release system
Browse files Browse the repository at this point in the history
  • Loading branch information
touilleMan committed Jan 1, 2018
1 parent c0bc8df commit 0adcf8b
Show file tree
Hide file tree
Showing 9 changed files with 954 additions and 2 deletions.
23 changes: 22 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import print_function
import os, glob, shutil
import os, shutil
from datetime import datetime
from functools import partial
from SCons.Errors import UserError

Expand Down Expand Up @@ -164,6 +165,26 @@ libpythonscript = env.SharedLibrary('pythonscript/pythonscript', sources)[0]
### Generate build dir ###


def extract_version():
with open('pythonscript/embedded/godot/__init__.py') as fd:
versionline = next(l for l in fd.readlines() if l.startswith('__version__ = '))
return eval(versionline[14:])


def generate_build_dir_hook(path):
shutil.copy('extras/pythonscript.gdnlib', os.path.join(path, 'pythonscript.gdnlib'))
shutil.copy('extras/release_LICENSE.txt', os.path.join(path, 'LICENSE.txt'))
with open('extras/release_README.txt') as fd:
readme = fd.read().format(
version=extract_version(),
date=datetime.utcnow().strftime('%Y-%m-%d')
)
with open(os.path.join(path, 'README.txt'), 'w') as fd:
fd.write(readme)

env['generate_build_dir_hook'] = generate_build_dir_hook


def do_or_die(func, *args, **kwargs):
try:
return func(*args, **kwargs)
Expand Down
21 changes: 21 additions & 0 deletions extras/pythonscript.gdnlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[general]

singleton=true
load_once=true
symbol_prefix="godot_"

[entry]

X11.64="res://pythonscript/libpythonscript.so"
X11.32="res://pythonscript/libpythonscript.so"
Windows.64="res://pythonscript/pythonscript.dll"
Windows.32="res://pythonscript/pythonscript.dll"
OSX.64="res://pythonscript/libpythonscript.dylib"

[dependencies]

X11.64=[]
X11.32=[]
Windows.64=[]
Windows.32=[]
OSX.64=[]
Loading

0 comments on commit 0adcf8b

Please sign in to comment.