def init(): aceutils.cdToScript() aceutils.cd(r'../') if aceutils.isWin(): aceutils.call(r'python Dev/generate_swig.py') elif aceutils.isMac(): # generate header(C#) aceutils.call(r'python Dev/generate_swig.py') aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ../') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.copytree(r'Dev/bin/Data',r'Dev/cmake/bin/Data') else: # generate header(C#) aceutils.call(r'python Dev/generate_swig.py') aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ ../') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.copytree(r'Dev/bin/Data',r'Dev/cmake/bin/Data')
def init(): aceutils.cdToScript() aceutils.cd(r'../') if aceutils.isWin(): aceutils.call(r'python Dev/generate_swig.py') elif aceutils.isMac(): # generate header(C#) aceutils.call(r'python Dev/generate_swig.py') aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ "-DCMAKE_OSX_ARCHITECTURES=x86_64' + (';i386' if aceutils.Isi386() else '') + r'" ../') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.copytree(r'Dev/bin/Data',r'Dev/cmake/bin/Data') else: # generate header(C#) aceutils.call(r'python Dev/generate_swig.py') aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ ../') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.copytree(r'Dev/bin/Data',r'Dev/cmake/bin/Data')
def genCPP(): targetDir = r'NuGetPackage/Cpp/' aceutils.cdToScript() aceutils.cd(r'../') aceutils.call(aceutils.cmd_compile + r'Dev/asd_cpp.sln /p:configuration=Debug') aceutils.call(aceutils.cmd_compile + r'Dev/asd_cpp.sln /p:configuration=Release') if not os.path.exists(targetDir): aceutils.mkdir(targetDir) aceutils.mkdir(targetDir+'build/native/bin/') aceutils.mkdir(targetDir+'build/native/include/') aceutils.mkdir(targetDir+'build/native/lib/') aceutils.mkdir(targetDir+'build/native/lib/Debug') aceutils.mkdir(targetDir+'build/native/lib/Release') aceutils.copy(r'Dev/bin/Altseed_core.dll', targetDir+'build/native/bin/') aceutils.copy(r'Dev/bin/Altseed_core_Debug.dll', targetDir+'build/native/bin/') aceutils.copy(r'Dev/include/Altseed.h', targetDir+'build/native/include/') aceutils.copy(r'Dev/lib/x86/Debug/Altseed.lib', targetDir+'build/native/lib/Debug/') aceutils.copy(r'Dev/lib/x86/Release/Altseed.lib', targetDir+'build/native/lib/Release/') aceutils.cd(targetDir) aceutils.call(r'nuget pack AltseedCpp.nuspec -Version ' + version)
def release_common(): aceutils.cdToScript() aceutils.cd(r'../') # generate makefiles using cmake if aceutils.isMac(): aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_TOOL=ON -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ../') aceutils.cd(r'../../')
def release_common(): aceutils.cdToScript() aceutils.cd(r'../') # generate makefiles using cmake if aceutils.isMac(): aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') aceutils.call(r'cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Release -D BUILD_TOOL=ON -D BUILD_SHARED_LIBS:BOOL=OFF -D CMAKE_INSTALL_PREFIX:PATH=../ "-DCMAKE_OSX_ARCHITECTURES=x86_64' + (';i386' if aceutils.Isi386() else '') + '" ../') aceutils.cd(r'../../')
def make_webpage(): exclude_ext = [".txt", ".psd", ".BAK", ".pptx"] aceutils.cdToScript() aceutils.cd('../') aceutils.copytree('./Document', './Doc/', True) aceutils.cd('./Doc') img_dir = 'img/' ss_dir = 'img/ss/' files = aceutils.get_files('.') for file in files: if os.path.splitext(file)[1] in exclude_ext: aceutils.rm(file) continue if os.path.splitext(file)[1] != ".md": continue ls = [] # 読み込み with open(file, mode='r', encoding='utf-8-sig') as f: ls = f.readlines() #includeの実装 relPath = '' ls = makeMarkdownUtils.include_basic_sample_web(ls,relPath,ss_dir,'all') ls = makeMarkdownUtils.include_application_sample_web(ls,relPath,ss_dir,'all') # リンクを修正 ls = [s.replace('.md', '.html') for s in ls] ls = [s.replace('\r\n', '\n') for s in ls] # 出力 with open(file, mode='wb') as f: for l in ls: f.write(l.encode('utf-8')) aceutils.mkdir(img_dir) aceutils.mkdir(ss_dir) # SSのコピー for ssfile in makeMarkdownUtils.included_ss_paths: aceutils.copy(ssfile,ss_dir) aceutils.cd('../')
def make_webpage(): exclude_ext = [".txt", ".psd", ".BAK", ".pptx"] aceutils.cdToScript() aceutils.cd("../") aceutils.copytree("./Document", "./Doc/", True) aceutils.cd("./Doc") img_dir = "img/" ss_dir = "img/ss/" files = aceutils.get_files(".") for file in files: if os.path.splitext(file)[1] in exclude_ext: aceutils.rm(file) continue if os.path.splitext(file)[1] != ".md": continue ls = [] # 読み込み with open(file, mode="r", encoding="utf-8-sig") as f: ls = f.readlines() # includeの実装 relPath = "" ls = makeMarkdownUtils.include_basic_sample_web(ls, relPath, ss_dir, "all") ls = makeMarkdownUtils.include_application_sample_web(ls, relPath, ss_dir, "all") # リンクを修正 ls = [s.replace(".md", ".html") for s in ls] ls = [s.replace("\r\n", "\n") for s in ls] # 出力 with open(file, mode="wb") as f: for l in ls: f.write(l.encode("utf-8")) aceutils.mkdir(img_dir) aceutils.mkdir(ss_dir) # SSのコピー for ssfile in makeMarkdownUtils.included_ss_paths: aceutils.copy(ssfile, ss_dir) aceutils.cd("../")
def compile(type): aceutils.cdToScript() if type=='cpp': aceutils.call(r'python ../Dev/generate_swig.py') if type=='cs': aceutils.call(r'python ../Dev/generate_swig.py') if type=='java': aceutils.call(r'python ../Dev/generate_swig.py java') aceutils.call('.\CSharpTranslator\LanguageTranslator.exe ../Dev/asd_cs/ ../Dev/asd_java/') aceutils.cd(r'../') if aceutils.isWin(): if type=='cpp': aceutils.call(aceutils.cmd_compile + r'Dev/unitTest_Engine_cpp.sln /p:configuration=Debug') aceutils.call(aceutils.cmd_compile + r'Dev/unitTest_Engine_cpp.sln /p:configuration=Release') if type=='cs': aceutils.call(aceutils.cmd_compile + r'Dev/unitTest_Engine_cs.sln /p:configuration=Release') if type=='java': aceutils.call(aceutils.cmd_compile + r'Dev/unitTest_Engine_cpp.sln /p:configuration=Release /p:platform=x64') aceutils.cd(r'Dev/asd_java') aceutils.call(r'ant') aceutils.cd(r'../../') elif aceutils.isMac(): if type=='cpp': aceutils.cd(r'Dev/cmake') aceutils.call(r'make install') aceutils.cd(r'../../') elif type=='cs': aceutils.cd(r'Dev') aceutils.call(r'xbuild /p:Configuration=Release unitTest_Engine_cs.sln') aceutils.cd(r'../') elif type=='java': aceutils.cd(r'Dev/cmake') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.cd(r'Dev/asd_java') aceutils.call(r'ant') aceutils.cd(r'../../')
def genCS(): targetDir = r'NuGetPackage/CSharp/' aceutils.cdToScript() aceutils.cd(r'../') # GenerateHeader aceutils.call(r'python Dev/generate_swig.py') aceutils.call(aceutils.cmd_compile + r'Dev/asd_cs.sln /p:configuration=Release') if not os.path.exists(targetDir): aceutils.mkdir(targetDir) aceutils.copy(r'Dev/bin/Altseed.dll', targetDir) aceutils.copy(r'Dev/bin/Altseed.xml', targetDir) aceutils.copy(r'Dev/bin/Altseed_core.dll', targetDir) aceutils.cd(targetDir) aceutils.call(r'nuget pack AltseedDotNet.nuspec -Version ' + version)
def store_tools(): aceutils.cdToScript() aceutils.cd(r'../') aceutils.call(sys.executable + r' Dev/generate_swig.py') compile('cs') compile_tool() toolDir = 'Altseed_Tool' aceutils.rmdir(toolDir) aceutils.mkdir(toolDir) aceutils.copy(r'Dev/bin/System.Reactive.dll', toolDir) # aceutils.copy(r'Dev/bin/System.Windows.Interactivity.dll', toolDir) aceutils.copy(r'Dev/bin/ReactiveProperty.dll', toolDir) aceutils.copy(r'Dev/bin/ReactiveProperty.NET46.dll', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.exe', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.Model.dll', toolDir) aceutils.copy(r'Dev/bin/ImagePackageGenerator.exe', toolDir) aceutils.copy(r'Dev/bin/ImagePackageGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FilePackageGenerator.exe', toolDir) # aceutils.copy(r'Dev/bin/FilePackageGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FilePackageGeneratorCore.dll', toolDir) aceutils.copy(r'Dev/bin/Altseed.dll', toolDir) if aceutils.isWin(): aceutils.copy(r'Dev/bin/Altseed_core.dll', toolDir) aceutils.copy(r'Dev/bin/FontGeneratorCore.dll', toolDir) aceutils.copy(r'Dev/bin/PSDParser.dll', toolDir) elif aceutils.isMac(): aceutils.copy(r'Dev/bin/libAltseed_core.dylib', toolDir) aceutils.copy(r'Dev/bin/libFontGeneratorCore.dylib', toolDir) aceutils.copy( r'Dev/cmake/ImagePackageGenerator/bin/libPSDParser.dylib', toolDir)
def store_tools(): aceutils.cdToScript() aceutils.cd(r'../') aceutils.call(sys.executable + r' Dev/generate_swig.py') compile('cs') compile_tool() toolDir = 'Altseed_Tool' aceutils.rmdir(toolDir) aceutils.mkdir(toolDir) aceutils.copy(r'Dev/bin/System.Reactive.dll', toolDir) #aceutils.copy(r'Dev/bin/System.Windows.Interactivity.dll', toolDir) aceutils.copy(r'Dev/bin/ReactiveProperty.dll', toolDir) aceutils.copy(r'Dev/bin/ReactiveProperty.NET46.dll', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.exe', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FontGenerator.Model.dll', toolDir) aceutils.copy(r'Dev/bin/ImagePackageGenerator.exe', toolDir) aceutils.copy(r'Dev/bin/ImagePackageGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FilePackageGenerator.exe', toolDir) #aceutils.copy(r'Dev/bin/FilePackageGenerator.exe.config', toolDir) aceutils.copy(r'Dev/bin/FilePackageGeneratorCore.dll', toolDir) aceutils.copy(r'Dev/bin/Altseed.dll', toolDir) if aceutils.isWin(): aceutils.copy(r'Dev/bin/Altseed_core.dll', toolDir) aceutils.copy(r'Dev/bin/FontGeneratorCore.dll', toolDir) aceutils.copy(r'Dev/bin/PSDParser.dll', toolDir) elif aceutils.isMac(): aceutils.copy(r'Dev/bin/libAltseed_core.dylib', toolDir) aceutils.copy(r'Dev/bin/libFontGeneratorCore.dylib', toolDir) aceutils.copy(r'Dev/cmake/ImagePackageGenerator/bin/libPSDParser.dylib', toolDir)
import aceutils aceutils.cdToScript() aceutils.cd(r'../') aceutils.rm(r'bullet-2.82-r2704.zip') aceutils.rmdir(r'bullet-2.82-r2704') aceutils.wget(r'https://bullet.googlecode.com/files/bullet-2.82-r2704.zip') aceutils.unzip(r'bullet-2.82-r2704.zip') aceutils.editCmakeForACE(r'bullet-2.82-r2704/CMakeLists.txt','cp932') aceutils.rmdir(r"bullet_bin") aceutils.rmdir(r"bullet_bin_x64") aceutils.mkdir(r"bullet_bin") aceutils.mkdir(r"bullet_bin_x64") aceutils.cd(r"bullet_bin") if aceutils.isWin(): aceutils.call(r'cmake -G "Visual Studio 12" -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D BUILD_DEMOS:BOOL=OFF ../bullet-2.82-r2704/') aceutils.call(r'"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild" BULLET_PHYSICS.sln /p:configuration=Debug') aceutils.call(r'"C:\Program Files (x86)\MSBuild\12.0\Bin\msbuild" BULLET_PHYSICS.sln /p:configuration=Release') elif aceutils.isMac(): aceutils.call(r'cmake -G "Unix Makefiles" -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF -D USE_INTERNAL_LOADER:BOOL=OFF "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ../bullet-2.82-r2704/') aceutils.call(r'make') else: aceutils.call(r'cmake -G "Unix Makefiles" -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF ../bullet-2.82-r2704/')
import os.path import aceutils aceutils.cdToScript() aceutils.cd(r'../') aceutils.rmdir(r'Dev/cmake') aceutils.mkdir(r'Dev/cmake') aceutils.cd(r'Dev/cmake') if aceutils.isWin(): aceutils.call( r'cmake -G "Visual Studio 12" -D BUILD_SHARED_LIBS:BOOL=OFF -D USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=OFF ../' ) else: aceutils.call( r'cmake -G "Unix Makefiles" -D BUILD_SHARED_LIBS:BOOL=OFF ../') aceutils.call(r'make install') aceutils.cd(r'../../') aceutils.copytree(r'Dev/bin/Data', r'Dev/cmake/bin/Data')
def init(type, targetDir): aceutils.cdToScript() aceutils.cd(r'../') aceutils.rmdir(targetDir) aceutils.rmdir(r'Sample/BasicSample/sample_cs/obj')
def make_document_html(mode): exclude_ext = [".txt", ".psd", ".BAK", ".pptx"] template="""<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <STYLE type="text/css"> <!-- @charset "utf-8"; body { line-height: 1.5em; } *::selection { background-color: rgba(255, 210, 130, 0.5); /* background-color: rgba(160, 220, 150, 0.5);*/ } h1, h2, h3, h4 { font-family: "Meiryo UI"; display: block; } h1, h2, h3 { padding: 0.2em 0.3em; } h1 { font-size: 2em; background-color: #ddeeee; border-bottom: 1px solid #999999; line-height: 1.2em; } h2 { font-size: 1.5em; background-color: #eef3f3; border-bottom: 1px solid #999999; line-height: 1.2em; } h3{ font-size: 1.3em; background-color: #eeeeee; } h4 { font-size: 1.1em; margin-top: 0.3em; margin-bottom: 0em; } p { margin-bottom: 0.9em; } p code { border: 1px solid #ccc; border-radius: 3px; background-color: #f9f9f9; padding: 1px 5px; display: inline-block; } pre { margin-top: 0.1em; margin-left: 1em; border: 1px solid #ccc; background-color: #f9f9f9; padding: 3px 5px; display: block; font: 1em "Consolas"; } pre code { font: 0.9em "Consolas"; } code { color: #52595d; font: 0.95em "Consolas"; margin: 0em 0.3em; } hr { border: 0; border-bottom: 2px dashed #acc; background-color: #fff; } ul { list-style-type: none; } li { border-left: 2px solid #cdd; margin-bottom: 2px; padding-left: 0.5em; } em { display: none; } table { border-collapse: collapse; } td, th { border: 1px solid #8bb; padding: 2px 5px; vertical-align: middle; } --> </STYLE> <title>$title$</title> </head> <body> $body$ </body> </html> """ aceutils.cdToScript() aceutils.cd('../') aceutils.copytree('./Document', './DocumentHtml', True) aceutils.cd('./DocumentHtml') img_dir = 'img/' ss_dir = 'img/ss/' files = aceutils.get_files('.') with open('template.html', mode='w', encoding='utf-8') as f: f.write(template) for file in files: if os.path.splitext(file)[1] in exclude_ext: aceutils.rm(file) continue if os.path.splitext(file)[1] != ".md": continue ls = [] # 読み込み with open(file, mode='r', encoding='utf-8') as f: ls = f.readlines() #includeの実装 relPath = file ls = makeMarkdownUtils.include_basic_sample(ls,relPath,ss_dir,mode) ls = makeMarkdownUtils.include_application_sample(ls,relPath,ss_dir,mode) # リンクを修正 ls = [s.replace('.md', '.html') for s in ls] # 出力 with open(file, mode='w', encoding='utf-8') as f: f.writelines(ls) # pandocによる出力 aceutils.call('pandoc -f markdown_github -t html5 -s --template=template.html -o {0}.html {0}.md'.format(os.path.splitext(file)[0])) aceutils.rm(file) aceutils.mkdir(img_dir) aceutils.mkdir(ss_dir) # SSのコピー for ssfile in makeMarkdownUtils.included_ss_paths: aceutils.copy(ssfile,ss_dir) aceutils.rm('template.html') aceutils.cd('../')