Skip to content

Commit 0adcf8b

Browse files
committed
Improve release system
1 parent c0bc8df commit 0adcf8b

File tree

9 files changed

+954
-2
lines changed

9 files changed

+954
-2
lines changed

SConstruct

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import print_function
2-
import os, glob, shutil
2+
import os, shutil
3+
from datetime import datetime
34
from functools import partial
45
from SCons.Errors import UserError
56

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

166167

168+
def extract_version():
169+
with open('pythonscript/embedded/godot/__init__.py') as fd:
170+
versionline = next(l for l in fd.readlines() if l.startswith('__version__ = '))
171+
return eval(versionline[14:])
172+
173+
174+
def generate_build_dir_hook(path):
175+
shutil.copy('extras/pythonscript.gdnlib', os.path.join(path, 'pythonscript.gdnlib'))
176+
shutil.copy('extras/release_LICENSE.txt', os.path.join(path, 'LICENSE.txt'))
177+
with open('extras/release_README.txt') as fd:
178+
readme = fd.read().format(
179+
version=extract_version(),
180+
date=datetime.utcnow().strftime('%Y-%m-%d')
181+
)
182+
with open(os.path.join(path, 'README.txt'), 'w') as fd:
183+
fd.write(readme)
184+
185+
env['generate_build_dir_hook'] = generate_build_dir_hook
186+
187+
167188
def do_or_die(func, *args, **kwargs):
168189
try:
169190
return func(*args, **kwargs)

extras/pythonscript.gdnlib

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[general]
2+
3+
singleton=true
4+
load_once=true
5+
symbol_prefix="godot_"
6+
7+
[entry]
8+
9+
X11.64="res://pythonscript/libpythonscript.so"
10+
X11.32="res://pythonscript/libpythonscript.so"
11+
Windows.64="res://pythonscript/pythonscript.dll"
12+
Windows.32="res://pythonscript/pythonscript.dll"
13+
OSX.64="res://pythonscript/libpythonscript.dylib"
14+
15+
[dependencies]
16+
17+
X11.64=[]
18+
X11.32=[]
19+
Windows.64=[]
20+
Windows.32=[]
21+
OSX.64=[]

0 commit comments

Comments
 (0)