開発中の一般的なツール


1.コマンドラインからディレクトリを開く
@explorer.exe %1%
           o.bat
 
        eg:         
	①o .
	②o ..

2.SVN更新
@set src_path1=C:\AAA\BBB\CCC
        @echo    …
        @TortoiseProc.exe /command:update /path:"%src_path1%" /closeonend:1
        @echo     

            SVN
        @TortoiseProc.exe /command:commit /path:"%src_path%" /closeonend:0

3.ClearCase更新
      
 @set projectPath=C:\AAAAAA
        @cleartool update %projectPath%\ libs
        @cleartool update %projectPath%\ utils
        @rem            
        @xcopy %projectPath%\ libs\o /R /S /Y /D %projectPath%\libs\dest
        @pause

4.配備されたスクリプト
  
# coding: UTF-8
import os

C_7Z_EXE = '"C:\\Program Files\\7-Zip\\7z.exe"' 
SERVER_DEPLOY_PATH = "\\\\192.168.1.111\\AAAA\\BBB\\build\\"

def main():
    copyfile = raw_input("          :")
    print u"    。。。"
    print SERVER_DEPLOY_PATH + copyfile
    #               
    os.system("@XCOPY " + SERVER_DEPLOY_PATH + copyfile + " /R /Y /D " + "C:\\env")
    print u"    "

    #           
    os.chdir("C:\\env")
    a_7z_cmd = C_7Z_EXE + ' x ' + copyfile  + ' -o' + "C:\\env" + '\\'
    os.system("@" + a_7z_cmd)
    print u"
" # os.system("@XCOPY " + "C:\\env\\" + copyfile[:-4] +"\\DPS\\cuidef" + " /R /Y /D " + "C:\\DPS\\cuidef") os.system("@XCOPY " + "C:\\env\\" + copyfile[:-4] +"\\DPS\\lib" + " /R /Y /D " + "C:\\DPS\\lib") os.system("@XCOPY " + "C:\\env\\" + copyfile[:-4] +"\\DPS\\extdef" + " /R /Y /D " + "C:\\DPS\\extdef") print u" " os.chdir("C:\\env\\" + copyfile[:-4] + "\\DPS\\ear") unzipEAR("C:\\env\\" + copyfile[:-4] + "\\DPS\\ear") def unzipEAR(path): # , if __name__ == "__main__": main()

5.検査結果の抽出
これは具体的な状況に応じて修正しなければなりません.私はただ勝手に書いただけで、労働量を軽減します.
# coding: UTF-8

import sys
import os
import time 
import keyword, token, tokenize

workpath = "\\\\192.168.1.111\\AAAAAAAAAAAAAAAAAAAA"
temppath = "C:\\functiontestlog"
exepath = os.getcwd()

def main():
    copyfile = raw_input("              ?(Y/N)")
        
    if copyfile == "Y" or copyfile == "y":
        print "    "
        os.system('RD /s /q ' + temppath)
        os.mkdir(temppath)
        os.mkdir(temppath + '\\temp')
        copyLog(0, workpath)
        print "    "
        
    time.sleep(1)
        
    checkng = raw_input("            ?(Y/N)")
    
    if checkng == "Y" or checkng == "y":
        #    
        print "    "
        epochValue   =   time.time() 
        timeString   =   time.ctime(epochValue) 
        mylogFile = open(temppath + "\\_result.html", "w")
        
        os.chdir(exepath)
        mytcfIdfile = open('tcfidlist.txt')

        #         NG   ,          
        #      
        for tcfid in mytcfIdfile.readlines():
            tcfid = tcfid.replace("
", "") tcfLog = searchfile(0, temppath, tcfid) if None != tcfLog: currentLogFile = open(tcfLog) logContent = currentLogFile.read() if logContent.find("》@COMPAREM
NG") != -1: logContent.replace("
", "<br>
"); print tcfLog[:-4] mylogFile.write('<font color=red>NG case:</font>' + "<a href=" + tcfLog[:-4] + ".html" + " target=_top >" + tcfLog[:-5] + "</a><br>" + '
') currentLogFile.close() else: # mylogFile.write("No Log:" + tcfid + '<br>
') mytcfIdfile.close() mylogFile.close() rename(temppath,".LOG",".html") print " " os.system('start file://C:\\functiontestlog\\_result.html') sys.exit() # def rename(path,old_ext,new_ext): for (path, dirs, files) in os.walk(path): for filename in files: ext=os.path.splitext(filename)[1] if (cmp(ext,old_ext)==0): newname=filename.replace(old_ext,new_ext) oldpath=path+"\\"+filename newpath=path+"\\"+newname try: os.rename(oldpath, newpath) except ValueError: print "Error when rename the file " + oldpath except NameError: print "Error when rename the file " + oldpath except OSError: print newpath + " The file is already exist!" # , def copyLog(level, path): for i in os.listdir(path): currentPath = path + '\\' + i if os.path.isdir(path + '\\' + i): copyLog(level + 1, path + '\\' + i) elif os.path.isfile(path + '\\' + i): if currentPath.find('TESTRESULT_') != -1: os.system("@XCOPY " + currentPath + " /R /Y /D " + temppath + '\\temp') os.chdir(temppath + '\\temp') try: print u'' + currentPath[-47:], u'' + currentPath[-39:] os.rename(u'' + currentPath[-47:], u'' + currentPath[-39:]) os.system("@XCOPY " + currentPath[-39:] + " /R /Y /D " + temppath) os.system("del " + temppath + '\\temp\\' + currentPath[-39:]) except: try: print u'' + currentPath[-50:], u'' + currentPath[-42:] os.rename(u'' + currentPath[-50:], u'' + currentPath[-42:]) os.system("@XCOPY " + currentPath[-42:] + " /R /Y /D " + temppath) os.system("del " + temppath + '\\temp\\' + currentPath[-42:]) except: print u'' + currentPath[-49:] print u'' + currentPath[-41:] os.rename(u'' + currentPath[-49:], u'' + currentPath[-41:]) os.system("@XCOPY " + currentPath[-41:] + " /R /Y /D " + temppath) os.system("del " + temppath + '\\temp\\' + currentPath[-41:]) def searchfile(level, path, tcfid): for i in os.listdir(path): currentPath = path + '\\' + i tcfid = tcfid.replace("
", "") # ? index = currentPath.find(tcfid) if index != -1: return currentPath if __name__ == "__main__": sys.exit(main())

6,EJBでのエンジニアリングのコンパイル、パッケージング、導入
set path=%path%;C: \apache-ant-1.7.0\bin
set path=%path%;C:\Oracle\Middleware\jdk160_18\bin

set module_name=%1%

@rem   Source  
set base_path=C:\AAAAAA\dps.%module_name%

@rem    jar   
set org_path_jar=C:\ AAAAA\ libs\dest\

@rem EJB     
set dest_path_jar=C:\FuncTest\dpsall\

cd %base_path%
@rem   ant  ,  ,  
cmd /c ant compilel pack.jar

@rem  jar         
xcopy %org_path_jar%dps.%module_name%.jar %dest_path_jar% /y

startweblogic