def _get_version(): from xml.etree import ElementTree nuspec = ElementTree.parse(os.path.join(THIS_DIR, '%s.nuspec' % package_name)) nuspec_version = nuspec.find('metadata/version').text _version = vc_info.update_version(nuspec_version, vc_info.last_mdl2mga_rev()) return _version
def _get_version(): version = ".".join( map( str, _get_version_number( os.path.join( THIS_DIR, r"..\x64\Release\CADCreoParametricMetaLink.exe")))) return vc_info.update_version(version, vc_info.last_cad_rev())
def _get_version(): version = ".".join( map( str, _get_version_number( os.path.join( THIS_DIR, r"..\x64\Release\ExtractACM-XMLfromCreoModels.exe")))) return vc_info.update_version(version, vc_info.last_cad_rev())
def _get_version(): from xml.etree import ElementTree nuspec = ElementTree.parse( os.path.join(THIS_DIR, '%s.nuspec' % package_name)) nuspec_version = nuspec.find('metadata/version').text _version = vc_info.update_version(nuspec_version, vc_info.last_mdl2mga_rev()) return _version
def get_nuget_packages(): import vc_info from xml.etree import ElementTree cad_packages = ElementTree.parse(r'CAD_Installs\packages.config') destination_files = [ r'..\bin\CAD\Creo\bin\CADCreoParametricCreateAssembly.exe', r'..\bin\CAD\Creo\0Readme - CreateAssembly.txt', r'..\bin\CAD\Creo\bin\ExtractACM-XMLfromCreoModels.exe', r'..\bin\CAD\Creo\bin\CADCreoParametricMetaLink.exe', 'WixStdBA.dll', ] for filename in destination_files: if os.path.isfile(filename): os.unlink(filename) for package in cad_packages.findall('package'): svnversion = { "META.CadCreoParametricCreateAssembly": vc_info.last_cad_rev, "META.ExtractACM-XMLfromCreoModels": vc_info.last_cad_rev, "META.MDL2MGACyber": vc_info.last_mdl2mga_rev, "META.CADCreoParametricMetaLink": vc_info.last_cad_rev, "Wix.WixStdBAMod": None }[package.get('id')] version = package.get('version') if svnversion is not None: version = vc_info.update_version(version, svnversion()) print "NuGet install " + package.get('id') + " " + version # n.b. don't specify -ConfigFile, as it makes nuget.exe ignore %APPDATA%\NuGet\NuGet.config system([ r'..\src\.nuget\nuget.exe', 'install', '-PreRelease', '-Version', version, package.get('id') ], os.path.join(this_dir, 'CAD_Installs')) package_dir = r'CAD_Installs\%s.%s' % (package.get('id'), version) for filename in itertools.chain(glob.glob(package_dir + '/*'), glob.glob(package_dir + '/lib/*')): #if os.path.basename(filename) == 'svnversion': # with open(os.path.join(this_dir, filename), 'rb') as svnversion: # print filename + ': ' + svnversion.read() destination_file = [ fn for fn in destination_files if os.path.basename(fn) == os.path.basename(filename) ] if not destination_file: continue destination_file = destination_file[0] from win32file import CreateHardLink print "Linking %s to %s" % (os.path.join( this_dir, filename), os.path.join(this_dir, destination_file)) CreateHardLink(os.path.join(this_dir, destination_file), os.path.join(this_dir, filename)) destination_files.remove(destination_file) if destination_files: raise Exception('Could not find files %s in NuGet packages' % repr(destination_files))
def get_nuget_packages(): import vc_info packages = None from xml.etree import ElementTree cad_packages = ElementTree.parse(r'CAD_Installs\packages.config') destination_files = [ r'CAD_Installs\Proe ISIS Extensions\bin\CADCreoParametricCreateAssembly.exe', r'CAD_Installs\Proe ISIS Extensions\0Readme - CreateAssembly.txt', r'CAD_Installs\Proe ISIS Extensions\bin\ExtractACM-XMLfromCreoModels.exe', r'CAD_Installs\Proe ISIS Extensions\bin\CADCreoParametricMetaLink.exe', ] for filename in destination_files: if os.path.isfile(filename): os.unlink(filename) for package in cad_packages.findall('package'): svnversion = { "META.CadCreoParametricCreateAssembly": vc_info.last_cad_rev, "META.ExtractACM-XMLfromCreoModels": vc_info.last_cad_rev, "META.MDL2MGACyber": vc_info.last_mdl2mga_rev, "META.CADCreoParametricMetaLink": vc_info.last_cad_rev, }[package.get('id')]() version = package.get('version') version = vc_info.update_version(version, svnversion) print "NuGet install " + package.get('id') + " " + version # n.b. don't specify -ConfigFile, as it makes nuget.exe ignore %APPDATA%\NuGet\NuGet.config system([r'..\src\.nuget\nuget.exe', 'install', '-PreRelease', '-Version', version, package.get('id')], os.path.join(this_dir, 'CAD_Installs')) package_dir = r'CAD_Installs\%s.%s' % (package.get('id'), version) for filename in glob.glob(package_dir + '/*'): #if os.path.basename(filename) == 'svnversion': # with open(os.path.join(this_dir, filename), 'rb') as svnversion: # print filename + ': ' + svnversion.read() destination_file = [fn for fn in destination_files if os.path.basename(fn) == os.path.basename(filename)] if not destination_file: continue destination_file = destination_file[0] from win32file import CreateHardLink print "Linking %s to %s" % (os.path.join(this_dir, filename), os.path.join(this_dir, destination_file)) CreateHardLink(os.path.join(this_dir, destination_file), os.path.join(this_dir, filename)) destination_files.remove(destination_file) if destination_files: raise Exception('Could not find files %s in NuGet packages' % repr(destination_files))
def _get_version(): version = ".".join(map(str, _get_version_number(os.path.join(THIS_DIR, r"..\x64\Release\CADCreoParametricMetaLink.exe")))) return vc_info.update_version(version, vc_info.last_cad_rev())
def _get_version(): version = ".".join(map(str, _get_version_number(os.path.join(THIS_DIR, r"..\x64\Release\ExtractACM-XMLfromCreoModels.exe")))) return vc_info.update_version(version, vc_info.last_cad_rev())