Work on scripts.

master
Dominik Deák 5 years ago
parent 5e8b7468a4
commit 787c3ff073
No known key found for this signature in database
GPG Key ID: 85514EC0CCE7007C
  1. 1
      Scripts/Build/BuildDarwin.sh
  2. 15
      Scripts/Build/BuildLinux.sh
  3. 14
      Scripts/Build/BuildWindows.cmd
  4. 5
      Scripts/Detail/Config.py
  5. 12
      Scripts/build.py

@ -8,6 +8,7 @@ configureCMake() {
-D CMAKE_OSX_DEPLOYMENT_TARGET=10.12 \ -D CMAKE_OSX_DEPLOYMENT_TARGET=10.12 \
-D CMAKE_OSX_ARCHITECTURES=x86_64 \ -D CMAKE_OSX_ARCHITECTURES=x86_64 \
-D SYNERGY_ENTERPRISE=ON \ -D SYNERGY_ENTERPRISE=ON \
-D SYNERGY_REVISION="${productRevision}" \
|| exit 1 || exit 1
} }

@ -5,6 +5,7 @@ configureCMake() {
cmake -S "${productRepoPath}" -B "${productBuildPath}" \ cmake -S "${productRepoPath}" -B "${productBuildPath}" \
-D CMAKE_BUILD_TYPE=Release \ -D CMAKE_BUILD_TYPE=Release \
-D SYNERGY_ENTERPRISE=ON \ -D SYNERGY_ENTERPRISE=ON \
-D SYNERGY_REVISION="${productRevision}" \
|| exit 1 || exit 1
} }
@ -81,8 +82,8 @@ buildDeb() {
buildRPM() { buildRPM() {
# rpmbuild is very flaky with paths containing spaces, # rpmbuild is very flaky with paths containing spaces,
# so we set up a temporary build path and make sure no spaces # so we set up a temporary build path and make sure no spaces
# are present in any paths. # are present in any paths.
temporaryPath=$( mktemp -d -t "${productPackageName}-XXXXXXXX" ) temporaryPath=$( mktemp -d -t "${productPackageName}-XXXXXXXX" )
@ -95,7 +96,7 @@ buildRPM() {
printf "Created temporary path:\n\t${temporaryPath}\n" printf "Created temporary path:\n\t${temporaryPath}\n"
# We will symlink RPM build paths to our temporary location # We will symlink RPM build paths to our temporary location
# and we'll do work in there. # and we'll do work in there.
rpmToplevelPath="${temporaryPath}/rpm" rpmToplevelPath="${temporaryPath}/rpm"
@ -105,17 +106,19 @@ buildRPM() {
installPath="${rpmBuildrootPath}/usr" installPath="${rpmBuildrootPath}/usr"
if [[ ${rpmToplevelPath} = *" "* ]]; then if [[ ${rpmToplevelPath} = *" "* ]]; then
printf "error: RPM top-level path contained spaces:\n\t${rpmToplevelPath}\n" printf "error: RPM top-level path contained spaces:\n\t${rpmToplevelPath}\n"
exit 1
fi fi
# Reconfigure with new intall path # Reconfigure with new install path
cmake -S "${productRepoPath}" -B "${productBuildPath}" \ cmake -S "${productRepoPath}" -B "${productBuildPath}" \
-D CMAKE_BUILD_TYPE=Release \ -D CMAKE_BUILD_TYPE=Release \
-D SYNERGY_ENTERPRISE=ON \ -D SYNERGY_ENTERPRISE=ON \
-D SYNERGY_REVISION="${productRevision}" \
-D CMAKE_INSTALL_PREFIX:PATH="${installPath}" \ -D CMAKE_INSTALL_PREFIX:PATH="${installPath}" \
|| exit 1 || exit 1
# Rebuild and deploy to intall path # Rebuild and deploy to install path
pushd "${productBuildPath}" || exit 1 pushd "${productBuildPath}" || exit 1
make -j || exit 1 make -j || exit 1

@ -2,7 +2,9 @@
:main :main
if [%isConfigured] equ [] ( setlocal enableextensions
if [%vcvarsallPath] equ [] (
echo error: The required environment variables were not configured. echo error: The required environment variables were not configured.
exit 1 exit 1
) )
@ -14,11 +16,19 @@
call :buildMSI call :buildMSI
call :buildZIP call :buildZIP
endlocal
exit 0 exit 0
:configureCMake :configureCMake
cmake -S "%productRepoPath%" -B "%productBuildPath%" -G "%cmakeGenerator%" -D CMAKE_PREFIX_PATH="%libQtPath%" -D CMAKE_BUILD_TYPE=MINSIZEREL -D SYNERGY_ENTERPRISE=ON || exit 1 cmake -S "%productRepoPath%" -B "%productBuildPath%"^
-G "%cmakeGenerator%"^
-D CMAKE_PREFIX_PATH="%libQtPath%"^
-D CMAKE_BUILD_TYPE=Release^
-D SYNERGY_ENTERPRISE=ON^
-D SYNERGY_REVISION="%productRevision%"^
|| exit 1
exit /b 0 exit /b 0

@ -23,6 +23,7 @@ class Configuration():
productName = "Synergy" productName = "Synergy"
productVersion = "unknown-version" productVersion = "unknown-version"
productStage = "snapshot" productStage = "snapshot"
productRevision = "0"
productPackageName = "-".join( [ productName, productVersion, productStage ] ).lower() productPackageName = "-".join( [ productName, productVersion, productStage ] ).lower()
productRepoPath = "" productRepoPath = ""
productBuildPath = "" productBuildPath = ""
@ -135,7 +136,7 @@ class Configuration():
def updateProductVersion( self ): def updateProductVersion( self ):
if not os.path.exists( self.productVersionPath ): if not os.path.exists( self.productVersionPath ):
utility.printWarning( "Unable to determine product version at this time; version file was missing:\n\t", self.productVersionPath ) utility.printWarning( "Unable to determine product version at this time; version file was missing:\n\t", self.productVersionPath )
else: else:
@ -152,11 +153,13 @@ class Configuration():
self.productVersion = ".".join( versionParts[ 0:3 ] ) self.productVersion = ".".join( versionParts[ 0:3 ] )
self.productStage = versionParts[ 3 ] self.productStage = versionParts[ 3 ]
self.productRevision = utility.captureCommandOutput( "git rev-parse --short=8 HEAD" )
self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower() self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower()
utility.printItem( "productVersion: ", self.productVersion ) utility.printItem( "productVersion: ", self.productVersion )
utility.printItem( "productStage: ", self.productStage ) utility.printItem( "productStage: ", self.productStage )
utility.printItem( "productRevision: ", self.productRevision )
utility.printItem( "productPackageName: ", self.productPackageName ) utility.printItem( "productPackageName: ", self.productPackageName )
def variableList( self ): def variableList( self ):

@ -25,15 +25,13 @@ def configureSubmodules():
utility.printHeading( "Updating product version..." ) utility.printHeading( "Updating product version..." )
config.updateProductVersion() config.updateProductVersion()
utility.printSuccess( "Git submodules are now up to date." )
def configureEnvironment(): def configureEnvironment():
utility.printHeading( "Configuring environment..." ) utility.printHeading( "Configuring environment..." )
variables = config.variableList() for name, value in config.variableList().items():
variables[ "isConfigured" ] = "1"
for name, value in variables.items():
if value: if value:
print( "\tSetting: ${" + utility.style.bold + name + utility.style.none + "}" ) print( "\tSetting: ${" + utility.style.bold + name + utility.style.none + "}" )
@ -41,6 +39,8 @@ def configureEnvironment():
else: else:
print( "\tUnused: " + utility.style.error + name + utility.style.none ) print( "\tUnused: " + utility.style.error + name + utility.style.none )
utility.printSuccess( "Build environment variables are now set." )
def buildProducts(): def buildProducts():
utility.printHeading( "Building products..." ) utility.printHeading( "Building products..." )
@ -55,6 +55,8 @@ def buildProducts():
utility.runCommand( '"' + scriptPath + '"' ) utility.runCommand( '"' + scriptPath + '"' )
utility.printSuccess( "Build completed successfully." )
configureSubmodules() configureSubmodules()
configureEnvironment() configureEnvironment()

Loading…
Cancel
Save