Added options to checkout and build specific tags for Synergy-Core.

master
DominikDeak 4 years ago
parent 5e45686338
commit 9e1be97a51
No known key found for this signature in database
GPG Key ID: 85514EC0CCE7007C
  1. 6
      Documentation/BuildingOnDarwin.md
  2. 6
      Documentation/BuildingOnLinux.md
  3. 6
      Documentation/BuildingOnWindows.md
  4. 41
      Scripts/Detail/Config.py
  5. 5
      Scripts/build.py
  6. 1
      Scripts/config.txt
  7. 2
      Synergy-Core

@ -35,6 +35,12 @@ Build the project with the following Python script. Packages will be copied into
./Scripts/build.py
```
To build a specific version of the product, supply the appropriate tag name (or commit hash) as an argument:
```sh
./Scripts/build.py --checkout 1.13.1.3-snapshot
```
Similarly, one can clean the project, which resets Git repositories to a clean state:
```sh

@ -28,6 +28,12 @@ Build the project with the following Python script. Packages will be copied into
./Scripts/build.py
```
To build a specific version of the product, supply the appropriate tag name (or commit hash) as an argument:
```sh
./Scripts/build.py --checkout 1.13.1.3-snapshot
```
Similarly, one can clean the project, which resets Git repositories to a clean state:
```sh

@ -42,6 +42,12 @@ Build the project with the following Python script. Packages will be copied into
python.exe Scripts\build.py
```
To build a specific version of the product, supply the appropriate tag name (or commit hash) as an argument:
```sh
python.exe Scripts\build.py --checkout 1.13.1.3-snapshot
```
Similarly, one can clean the project, which resets Git repositories to a clean state:
```bat

@ -1,6 +1,6 @@
#!/bin/echo "This module must be imported by other Python scripts."
import configparser, os, platform, re, sys
import argparse, configparser, os, platform, re, sys
import Detail.Utility as utility
@ -27,12 +27,23 @@ class Configuration():
productPackageName = "-".join( [ productName, productVersion, productStage ] ).lower()
productRepoPath = ""
productBuildPath = ""
productVersionPath = ""
productCheckout = ""
# Constructor
def __init__( self, configPath ):
def programOptions( self ):
parser = argparse.ArgumentParser( description =
"This utility builds the Synergy-Core binaries. The product version is extracted from the most recent Git tag. One can also build older versions "
"by checking out specific git tags, see options below." )
parser.add_argument( "--checkout", dest = "productCheckout", help = "Checkout and build a specific Git tag (or commit hash) for the Synergy-Core submodule." )
for key, value in vars( parser.parse_args() ).items():
setattr( self, key, value )
def loadConfiguration( self, configPath ):
utility.printItem( "configPath: ", configPath )
@ -87,7 +98,6 @@ class Configuration():
resolvePath( self, "productRepoPath" )
resolvePath( self, "productBuildPath", mustExist = False )
resolvePath( self, "productVersionPath", mustExist = False )
resolvePath( self, "binariesPath" )
resolvePath( self, "toolsPath" )
resolvePath( self, "libQtPath" )
@ -116,6 +126,8 @@ class Configuration():
self.updateProductVersion()
programOptions( self )
utility.printHeading( "Loading configuration..." )
loadConfiguration( self, configPath )
@ -135,26 +147,19 @@ class Configuration():
def updateProductVersion( self ):
if not os.path.exists( self.productVersionPath ):
os.chdir( self.productRepoPath )
utility.printWarning( "Unable to determine product version at this time; version file was missing:\n\t", self.productVersionPath )
lastTag = utility.captureCommandOutput( "git describe --tags --abbrev=0" )
else:
versionFile = open( self.productVersionPath, "r" )
versionData = versionFile.read()
versionFile.close()
versionParts = re.findall( r'set \(SYNERGY_VERSION_\w+ "?(\w+)"?\)', versionData )
matches = re.search( "v?(\d+(?:\.\d+)+)-(\w+)", lastTag )
if len( versionParts ) == 0:
utility.printError( "Failed to extract version information." )
if not matches:
utility.printError( "Unable to extract version information from Git tags." )
raise SystemExit( 1 )
self.productVersion = ".".join( versionParts[ 0:-1 ] )
self.productStage = versionParts[ -1 ]
self.productVersion = matches.group( 1 )
self.productStage = matches.group( 2 )
self.productRevision = utility.captureCommandOutput( "git rev-parse --short=8 HEAD" )
self.productPackageName = "-".join( [ self.productName, self.productVersion, self.productStage, self.platformVersion ] ).lower()
utility.printItem( "productVersion: ", self.productVersion )
@ -162,6 +167,8 @@ class Configuration():
utility.printItem( "productRevision: ", self.productRevision )
utility.printItem( "productPackageName: ", self.productPackageName )
os.chdir( self.toplevelPath )
# Property list
def propertyList( self ):

@ -18,6 +18,11 @@ def configureSubmodules():
utility.runCommand( "git submodule update --init --remote --recursive" )
if config.productCheckoutTag:
os.chdir( config.productRepoPath )
utility.runCommand( "git checkout " + config.productCheckoutTag )
os.chdir( config.toplevelPath )
statusAfter = utility.captureCommandOutput( "git submodule status" )
print( statusAfter )

@ -7,7 +7,6 @@
productName = Synergy
productRepoPath = ./Synergy-Core
productBuildPath = ./Synergy-Core/build
productVersionPath = ./Synergy-Core/cmake/Version.cmake
[Windows]

@ -1 +1 @@
Subproject commit ede272185d5acae6466bfd19edeb8efed95ac429
Subproject commit 9c8a1c1e3d2c66ea535f6d91ce59f99c588ff2fc
Loading…
Cancel
Save