mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
Support for automated build bot scripts, add PandaSystem::get_git_commit()
This commit is contained in:
parent
cd8c6ee37f
commit
f189290dfe
@ -4,7 +4,7 @@ compiler:
|
|||||||
- clang
|
- clang
|
||||||
before_script:
|
before_script:
|
||||||
- sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit
|
- sudo apt-get install python-dev libpng-dev zlib1g-dev libssl-dev libx11-dev libgl1-mesa-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libfreetype6-dev libvorbis-dev libjpeg-dev libopenal-dev libode-dev nvidia-cg-toolkit
|
||||||
script: python makepanda/makepanda.py --everything
|
script: python makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
|
@ -292,6 +292,22 @@ get_build_date() {
|
|||||||
return __DATE__ " " __TIME__;
|
return __DATE__ " " __TIME__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: PandaSystem::get_git_commit
|
||||||
|
// Access: Published, Static
|
||||||
|
// Description: Returns a string representing the git commit hash
|
||||||
|
// that this source tree is based on, or the empty
|
||||||
|
// string if it has not been specified at build time.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
string PandaSystem::
|
||||||
|
get_git_commit() {
|
||||||
|
#ifdef PANDA_GIT_COMMIT_STR
|
||||||
|
return PANDA_GIT_COMMIT_STR;
|
||||||
|
#else
|
||||||
|
return string();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: PandaSystem::get_platform
|
// Function: PandaSystem::get_platform
|
||||||
// Access: Published, Static
|
// Access: Published, Static
|
||||||
|
@ -45,6 +45,7 @@ PUBLISHED:
|
|||||||
static string get_distributor();
|
static string get_distributor();
|
||||||
static string get_compiler();
|
static string get_compiler();
|
||||||
static string get_build_date();
|
static string get_build_date();
|
||||||
|
static string get_git_commit();
|
||||||
|
|
||||||
static string get_platform();
|
static string get_platform();
|
||||||
|
|
||||||
|
17
makepanda/getversion.py
Executable file
17
makepanda/getversion.py
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# This script parses the version number in dtool/PandaVersion.pp
|
||||||
|
# and returns it on the command-line. This is useful for the
|
||||||
|
# automated scripts that build the Panda3D releases.
|
||||||
|
|
||||||
|
from makepandacore import ParsePandaVersion, ParsePluginVersion
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if '--runtime' in sys.argv:
|
||||||
|
version = ParsePluginVersion("dtool/PandaVersion.pp")
|
||||||
|
else:
|
||||||
|
version = ParsePandaVersion("dtool/PandaVersion.pp")
|
||||||
|
|
||||||
|
version = version.strip()
|
||||||
|
sys.stdout.write(version)
|
||||||
|
sys.stdout.flush()
|
@ -61,6 +61,7 @@ DISTRIBUTOR=""
|
|||||||
VERSION=None
|
VERSION=None
|
||||||
DEBVERSION=None
|
DEBVERSION=None
|
||||||
RPMRELEASE="1"
|
RPMRELEASE="1"
|
||||||
|
GIT_COMMIT=None
|
||||||
P3DSUFFIX=None
|
P3DSUFFIX=None
|
||||||
MAJOR_VERSION=None
|
MAJOR_VERSION=None
|
||||||
COREAPI_VERSION=None
|
COREAPI_VERSION=None
|
||||||
@ -121,7 +122,7 @@ signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
|||||||
def usage(problem):
|
def usage(problem):
|
||||||
if (problem):
|
if (problem):
|
||||||
print("")
|
print("")
|
||||||
print("Error parsing commandline input", problem)
|
print("Error parsing command-line input: %s" % (problem))
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
print("Makepanda generates a 'built' subdirectory containing a")
|
print("Makepanda generates a 'built' subdirectory containing a")
|
||||||
@ -164,7 +165,7 @@ def usage(problem):
|
|||||||
def parseopts(args):
|
def parseopts(args):
|
||||||
global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
|
global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
|
||||||
global COMPRESSOR,THREADCOUNT,OSXTARGET,UNIVERSAL,HOST_URL
|
global COMPRESSOR,THREADCOUNT,OSXTARGET,UNIVERSAL,HOST_URL
|
||||||
global DEBVERSION,RPMRELEASE,P3DSUFFIX
|
global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX
|
||||||
global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
|
||||||
longopts = [
|
longopts = [
|
||||||
"help","distributor=","verbose","runtime","osxtarget=",
|
"help","distributor=","verbose","runtime","osxtarget=",
|
||||||
@ -172,7 +173,7 @@ def parseopts(args):
|
|||||||
"version=","lzma","no-python","threads=","outputdir=","override=",
|
"version=","lzma","no-python","threads=","outputdir=","override=",
|
||||||
"static","host=","debversion=","rpmrelease=","p3dsuffix=",
|
"static","host=","debversion=","rpmrelease=","p3dsuffix=",
|
||||||
"directx-sdk=", "platform-sdk=", "use-icl",
|
"directx-sdk=", "platform-sdk=", "use-icl",
|
||||||
"universal", "target=", "arch="]
|
"universal", "target=", "arch=", "git-commit="]
|
||||||
anything = 0
|
anything = 0
|
||||||
optimize = ""
|
optimize = ""
|
||||||
target = None
|
target = None
|
||||||
@ -208,6 +209,7 @@ def parseopts(args):
|
|||||||
elif (option=="--host"): HOST_URL=value
|
elif (option=="--host"): HOST_URL=value
|
||||||
elif (option=="--debversion"): DEBVERSION=value
|
elif (option=="--debversion"): DEBVERSION=value
|
||||||
elif (option=="--rpmrelease"): RPMRELEASE=value
|
elif (option=="--rpmrelease"): RPMRELEASE=value
|
||||||
|
elif (option=="--git-commit"): GIT_COMMIT=value
|
||||||
elif (option=="--p3dsuffix"): P3DSUFFIX=value
|
elif (option=="--p3dsuffix"): P3DSUFFIX=value
|
||||||
# Backward compatibility, OPENGL was renamed to GL
|
# Backward compatibility, OPENGL was renamed to GL
|
||||||
elif (option=="--use-opengl"): PkgEnable("GL")
|
elif (option=="--use-opengl"): PkgEnable("GL")
|
||||||
@ -259,6 +261,9 @@ def parseopts(args):
|
|||||||
except:
|
except:
|
||||||
usage("Invalid setting for OPTIMIZE")
|
usage("Invalid setting for OPTIMIZE")
|
||||||
|
|
||||||
|
if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
|
||||||
|
usage("Invalid SHA-1 hash given for --git-commit option!")
|
||||||
|
|
||||||
if target is not None or target_arch is not None:
|
if target is not None or target_arch is not None:
|
||||||
SetTarget(target, target_arch)
|
SetTarget(target, target_arch)
|
||||||
|
|
||||||
@ -2399,6 +2404,9 @@ def CreatePandaVersionFiles():
|
|||||||
else:
|
else:
|
||||||
pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
|
pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
|
||||||
|
|
||||||
|
if GIT_COMMIT:
|
||||||
|
pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
|
||||||
|
|
||||||
if not RUNTIME:
|
if not RUNTIME:
|
||||||
checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
|
checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
|
||||||
checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
|
checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user