mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[0.3.x] changed : target catalogs, setup script
git-svn-id: https://pykd.svn.codeplex.com/svn@90344 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
6133ff57fb
commit
633d304294
@ -18,8 +18,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "um", "um", "{EEFC9510-DFA7-
|
|||||||
samples\um\ldr.py = samples\um\ldr.py
|
samples\um\ldr.py = samples\um\ldr.py
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EFB54DEF-ABE9-48E0-8EFB-73CB55B18893}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D1F1222A-A12B-4FD7-91A0-0AB6393A3169}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D1F1222A-A12B-4FD7-91A0-0AB6393A3169}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.nuget\NuGet.Config = .nuget\NuGet.Config
|
.nuget\NuGet.Config = .nuget\NuGet.Config
|
||||||
|
@ -76,22 +76,30 @@
|
|||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
|
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
|
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
|
<IntDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</IntDir>
|
||||||
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_2.7|x64'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<TargetExt>.pyd</TargetExt>
|
<TargetExt>.pyd</TargetExt>
|
||||||
<TargetName>$(ProjectName)</TargetName>
|
<TargetName>$(ProjectName)</TargetName>
|
||||||
|
<OutDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)out\$(Platform)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_2.7|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@ -108,7 +116,8 @@
|
|||||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>copy $(ProjectDir)..\Debug\targetapp.exe $(OutDir)targetapp.exe</Command>
|
<Command>
|
||||||
|
</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<CustomBuildStep>
|
<CustomBuildStep>
|
||||||
<Command>
|
<Command>
|
||||||
@ -130,7 +139,8 @@
|
|||||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
</Link>
|
</Link>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
<Command>copy $(ProjectDir)..\x64\Debug\targetapp.exe $(OutDir)targetapp.exe</Command>
|
<Command>
|
||||||
|
</Command>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
<CustomBuildStep>
|
<CustomBuildStep>
|
||||||
<Command>
|
<Command>
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
from pykd import *
|
|
||||||
__version__ = pykd.__version__
|
|
||||||
__file__ = pykd.__file__
|
|
||||||
|
|
109
setup/setup.py
109
setup/setup.py
@ -1,35 +1,118 @@
|
|||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
from setuptools.dist import Distribution
|
from setuptools.dist import Distribution
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import zipfile
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
_name = "pykd"
|
||||||
parser.add_argument('cmd', choices=['bdist_egg', 'bdist', 'bdist_wheel', 'install', 'clean'])
|
_desc = "python windbg extension"
|
||||||
parser.add_argument('--plat-name', default=pkg_resources.get_build_platform() )
|
_version = '0.3.0.21'
|
||||||
|
|
||||||
args = parser.parse_args()
|
def makeWheel(args):
|
||||||
|
|
||||||
pkg_dir = { 'win32' : 'pykd_x86', 'win-amd64' : 'pykd_x64' }.get( args.plat_name )
|
# remove build catalog
|
||||||
|
build_dir = os.path.join(os.path.curdir, 'build' )
|
||||||
|
if os.path.exists(build_dir):
|
||||||
|
shutil.rmtree(build_dir)
|
||||||
|
|
||||||
class BinaryDistribution(Distribution):
|
# make package catalog
|
||||||
|
package_dir = os.path.join(os.path.curdir, _name )
|
||||||
|
if os.path.exists(package_dir):
|
||||||
|
shutil.rmtree(package_dir)
|
||||||
|
os.mkdir(package_dir)
|
||||||
|
|
||||||
|
with open(os.path.join(package_dir, '__init__.py'),'w') as f:
|
||||||
|
f.write("from pykd import *\n")
|
||||||
|
f.write("__version__ = pykd.__version__\n")
|
||||||
|
f.write("__file__ = pykd.__file__\n")
|
||||||
|
|
||||||
|
bin_dir = os.path.join( os.path.curdir, '..', 'bin')
|
||||||
|
pykd_dir = os.path.join( os.path.curdir, '..', 'out')
|
||||||
|
if args.plat_name == 'win32':
|
||||||
|
bin_dir = os.path.join( bin_dir, 'x86')
|
||||||
|
pykd_dir = os.path.join(pykd_dir, 'Win32', 'Release_2.7')
|
||||||
|
elif args.plat_name == 'win-amd64':
|
||||||
|
bin_dir = os.path.join( bin_dir, 'x64')
|
||||||
|
pykd_dir = os.path.join(pykd_dir, 'X64', 'Release_2.7')
|
||||||
|
else:
|
||||||
|
assert(0)
|
||||||
|
|
||||||
|
assert(os.path.isdir(bin_dir))
|
||||||
|
|
||||||
|
for binFile in [ f for f in os.listdir(bin_dir) if not os.path.isdir(f) ]:
|
||||||
|
shutil.copy( os.path.join(bin_dir, binFile), os.path.join(package_dir, binFile) )
|
||||||
|
|
||||||
|
shutil.copy( os.path.join(pykd_dir, 'pykd.pyd'), os.path.join(package_dir, 'pykd.pyd') )
|
||||||
|
|
||||||
|
class BinaryDistribution(Distribution):
|
||||||
def is_pure(self):
|
def is_pure(self):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
_name = "pykd"
|
setup(
|
||||||
_version = "0.3.0.16"
|
|
||||||
_desc = "python windbg extension"
|
|
||||||
|
|
||||||
setup(
|
|
||||||
name = _name,
|
name = _name,
|
||||||
version = _version,
|
version = _version,
|
||||||
description = _desc,
|
description = _desc,
|
||||||
packages = ['pykd'],
|
packages = ['pykd'],
|
||||||
package_dir = {'pykd': pkg_dir},
|
package_dir = {'pykd': package_dir},
|
||||||
package_data = { 'pykd' :["*.pyd", "*.dll"]},
|
package_data = { 'pykd' :["*.pyd", "*.dll"]},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe = False,
|
zip_safe = False,
|
||||||
distclass = BinaryDistribution,
|
distclass = BinaryDistribution,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def makeZip(args):
|
||||||
|
|
||||||
|
# make package catalog
|
||||||
|
package_dir = os.path.join(os.path.curdir, _name )
|
||||||
|
if os.path.exists(package_dir):
|
||||||
|
shutil.rmtree(package_dir)
|
||||||
|
os.mkdir(package_dir)
|
||||||
|
|
||||||
|
bin_dir = os.path.join( os.path.curdir, '..', 'bin')
|
||||||
|
pykd_dir = os.path.join( os.path.curdir, '..', 'out')
|
||||||
|
if args.plat_name == 'win32':
|
||||||
|
bin_dir = os.path.join( bin_dir, 'x86')
|
||||||
|
pykd_dir = os.path.join(pykd_dir, 'Win32', 'Release_2.7')
|
||||||
|
elif args.plat_name == 'win-amd64':
|
||||||
|
bin_dir = os.path.join( bin_dir, 'x64')
|
||||||
|
pykd_dir = os.path.join(pykd_dir, 'X64', 'Release_2.7')
|
||||||
|
else:
|
||||||
|
assert(0)
|
||||||
|
|
||||||
|
zip_str = "pykd-%s-py27-%s.zip" % ( _version, args.plat_name )
|
||||||
|
zip_name = zip_str + ".zip"
|
||||||
|
|
||||||
|
assert(os.path.isdir(bin_dir))
|
||||||
|
|
||||||
|
for binFile in [ f for f in os.listdir(bin_dir) if not os.path.isdir(f) ]:
|
||||||
|
shutil.copy( os.path.join(bin_dir, binFile), os.path.join(package_dir, binFile) )
|
||||||
|
|
||||||
|
shutil.copy( os.path.join(pykd_dir, 'pykd.pyd'), os.path.join(package_dir, 'pykd.pyd') )
|
||||||
|
|
||||||
|
with zipfile.ZipFile(os.path.join(os.path.curdir, 'dist', zip_name), mode='w' ) as archive:
|
||||||
|
for srcFile in os.listdir(package_dir):
|
||||||
|
print "zipped %s" % (srcFile)
|
||||||
|
archive.write( os.path.join(package_dir, srcFile), compress_type = zipfile.ZIP_DEFLATED)
|
||||||
|
|
||||||
|
print "OK"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
subparsers = parser.add_subparsers()
|
||||||
|
wheelParser = subparsers.add_parser('bdist_wheel')
|
||||||
|
wheelParser.add_argument('--plat-name', choices = ['win32', 'win-amd64'], default=pkg_resources.get_build_platform() )
|
||||||
|
wheelParser.set_defaults(func=makeWheel)
|
||||||
|
|
||||||
|
zipParser = subparsers.add_parser('bdist_zip')
|
||||||
|
zipParser.add_argument('--plat-name', choices = ['win32', 'win-amd64'], default=pkg_resources.get_build_platform() )
|
||||||
|
zipParser.set_defaults(func=makeZip)
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
args.func(args)
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<Name>setup</Name>
|
<Name>setup</Name>
|
||||||
<RootNamespace>setup</RootNamespace>
|
<RootNamespace>setup</RootNamespace>
|
||||||
<LaunchProvider>Standard Python launcher</LaunchProvider>
|
<LaunchProvider>Standard Python launcher</LaunchProvider>
|
||||||
<CommandLineArguments>install</CommandLineArguments>
|
<CommandLineArguments>bdist_zip --plat-name=win32</CommandLineArguments>
|
||||||
<InterpreterPath />
|
<InterpreterPath />
|
||||||
<InterpreterArguments />
|
<InterpreterArguments />
|
||||||
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
|
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
|
||||||
|
@ -7,9 +7,7 @@ import os
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
# Dynamically append current pykd.pyd path to PYTHONPATH
|
# Dynamically append current pykd.pyd path to PYTHONPATH
|
||||||
sys.path.insert(0, os.path.dirname(sys.argv[1]))
|
sys.path.insert(0, os.path.abspath(os.curdir) )
|
||||||
|
|
||||||
print os.path.abspath(os.curdir)
|
|
||||||
|
|
||||||
import pykd
|
import pykd
|
||||||
|
|
||||||
|
@ -8,21 +8,19 @@
|
|||||||
<StartupFile>pykdtest.py</StartupFile>
|
<StartupFile>pykdtest.py</StartupFile>
|
||||||
<SearchPath>
|
<SearchPath>
|
||||||
</SearchPath>
|
</SearchPath>
|
||||||
<WorkingDirectory>..\..\Debug_2.7</WorkingDirectory>
|
<WorkingDirectory>..\..\out\Win32\Debug_2.7</WorkingDirectory>
|
||||||
<OutputPath>.</OutputPath>
|
<OutputPath>.</OutputPath>
|
||||||
<Name>pykdtest</Name>
|
<Name>pykdtest</Name>
|
||||||
<RootNamespace>pykdtest</RootNamespace>
|
<RootNamespace>pykdtest</RootNamespace>
|
||||||
<LaunchProvider>Standard Python launcher</LaunchProvider>
|
<LaunchProvider>Standard Python launcher</LaunchProvider>
|
||||||
<CommandLineArguments>targetapp.exe</CommandLineArguments>
|
<CommandLineArguments>C:\proj\pykd-rel\out\Win32\Debug\targetapp.exe</CommandLineArguments>
|
||||||
<InterpreterPath />
|
<InterpreterPath />
|
||||||
<InterpreterArguments>
|
<InterpreterArguments>
|
||||||
</InterpreterArguments>
|
</InterpreterArguments>
|
||||||
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
|
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
|
||||||
<IsWindowsApplication>False</IsWindowsApplication>
|
<IsWindowsApplication>False</IsWindowsApplication>
|
||||||
<InterpreterId>
|
<InterpreterId>{2af0f10d-7135-4994-9156-5d01c9c11b7e}</InterpreterId>
|
||||||
</InterpreterId>
|
<InterpreterVersion>2.7</InterpreterVersion>
|
||||||
<InterpreterVersion>
|
|
||||||
</InterpreterVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -59,5 +57,8 @@
|
|||||||
<Compile Include="typedvar.py" />
|
<Compile Include="typedvar.py" />
|
||||||
<Compile Include="typeinfo.py" />
|
<Compile Include="typeinfo.py" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<InterpreterReference Include="{2af0f10d-7135-4994-9156-5d01c9c11b7e}\2.7" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user