Atitit 研发体系 codelib 代码库的建设 目录 1. 概念与组成 2 1.1. Java代码 2 1.2. Js代码 2 1.3. H5 代码 js+css+htm+txt 2 1.4.

Atitit 研发体系 codelib 代码库的建设

目录

1. 概念与组成 2

1.1. Java代码 2

1.2. Js代码 2

1.3. H5 代码 js+css+htm+txt 2

1.4. All   java+js+txt+ahk+bat+sql json  etc 2

2. 代码库的分类 2

2.1. 项目级别 2

2.2. 模块级别 2

2.3. 功能级别 2

2.4. 按照语言来分类 java php js net ahk 2

2.5. 按照前后端来分 h5  VS java 2

2.6. 按照code  txt json来分 2

3. Fulltxt search 3

4. Tool 3

4.1. 代码块抽取根据winrar 按照扩展名 3

4.2. Codelib.bat 3

5. Bp 5

6. Qa prob 5

6.1. 代码库的备份 5

6.2. 全文检索 5

6.3. 标题检索placehold模式 5

6.4. 压缩包内的搜索 5

7. 代码库的全恩搜索codescanner 5

8. Resulzt 7

1.  概念与组成

1.1. Java代码

1.2. Js代码

1.3. H5 代码 js+css+htm+txt

1.4. All   java+js+txt+ahk+bat+sql json  etc

2. 代码库的分类

2.1. 项目级别

2.2. 模块级别

2.3. 功能级别

2.4. 按照语言来分类 java php js net ahk

2.5. 按照前后端来分 h5  VS java

2.6. 按照code  txt json来分

3. Fulltxt search

4. Tool

4.1. 代码块抽取根据winrar 按照扩展名

吧一个wkspsc全部出去

4.2. Codelib.bat

set pathx="%~dp0"

set nameMain=codelibprj

set uuid=%~dp0%nameMain%_%date:/=-% %time::=-%

 set  time=2010-11-01-01:01:01

set zipname_java="%uuid%_java_codelib.zip"

set zipname_js="%uuid%_js_codelib.zip"

rem coresrc

set zipname_all="%uuid%_all_codelib.zip"

 --echo %date:/=-%   

  

 set java_home="C:\Program Files\WinRAR\WinRAR.exe"

if not exist %java_home% ( set java_home=c:\WinRAR\WinRAR.exe)

if not exist %java_home% ( set java_home=d:\WinRAR\WinRAR.exe )

if not exist %java_home% (

 set java_home="C:\Program Files (x86)\WinRAR\WinRAR.exe"

 echo aaa

 )

%java_home% a   -x*\build\ -x*\.svn\ -x*\dist\ -x*\nbproject\ -x*\.git\ -x*.jar   -ep1 -m1 -r -n*.java      -ta%time%  %zipname_java%   %pathx%

 %java_home% a   -x*\build\ -x*\.svn\ -x*\dist\ -x*\nbproject\ -x*\.git\ -x*.jar  -ep1 -m1 -r -n*.js   %zipname_js%   %pathx%

%java_home% a   -x*\build\ -x*\.svn\ -x*\dist\ -x*\nbproject\ -x*\.git\ -x*.jar  -ep1 -m1 -r -n*.bsh  -n*.properties -n*.csv -n*.classpath  -n*.project -n*.ini -n*.ahk  -n*.bat  -n*.dmp   -n*.jsp -n*.vm -n*.css -n*.java  -n*.xml -n*.dwt -n*.php -n*.txt -n*.doc -n*.cs -n*.aspx -n*.ascx -n*.htm -n*.html -n*.js -n*.csproj -n*.sln -n*.resx -n*.sql -n*.config -n*.xsd -n*.settings  -n*.bat -n*.txt -n*.tld  -n*.tag -n*.properties   -n*.buildpath  -n*.classpath  -n*.myhibernatedata  -n*.mymetadata  -n*.project  -n*.jsdtscope  -n*.prefs  -n*.component  -n*.xml  -n*.container  -n*.name  -n*.sql  -n*.bat  -n*.hql  -n*.  -n*.log  -n*.txt  -n*.java  -n*.html  -n*.groovy  -n*.p12  -n*.properties  -n*.jsp  -n*.js  -n*.htaccess  -n*.pack  -n*.css  -n*.htm  -n*.xsd  -n*.htc  -n*.php  -n*.json  -n*.example-php  -n*.as  -n*.svg  -n*.sh  -n*.template  -n*.smd  -n*.fla  -n*.tld  -n*.asp  -n*.aspx  -n*.ashx  -n*.MF  -n*.scc  -n*.eot  -n*.ttf  -n*.woff  -n*.application  -n*.page  -n*.smap   %zipname_all%   %pathx%

rem set sql_bakName="%uuid%.sql"

rem set sql_zip="%uuid%.sql.zip"

rem C:\wamp\mysql\bin\mysqldump.exe -uroot -proot --set-charset=utf8 wxb_srv_mir --result-file=%sql_bakName%

rem D:\wamp\bin\mysql\mysql5.5.20\bin\mysqldump.exe -uroot -proot --set-charset=utf8 wxb_site_new --result-file=%sql_bakName%

%java_home% a -m1  %sql_zip% %sql_bakName%

pause

说明:

pathx为工程目录,目录如有空格中文要用双引号括起来……目录结尾不要有反斜杠……

zipname 为要打包的文件名

time  这个指明什么时间以后修改的文件。根据文件修改时间来打包呵。

 -n*.jsp  这个参数表明,打包JSP文件……如果打包文本文件,可增加 -n*.txt..其它类似可。

5. Bp

6. Qa prob

6.1. 代码库的备份

6.2. 全文检索

6.3. 标题检索placehold模式

6.4. 压缩包内的搜索

7. 代码库的全恩搜索codescanner

/FulltxtLucenePrj/src/fulltxt/codescanner.java

package fulltxt;

import java.io.File;

import java.util.Map;

import org.apache.log4j.Logger;

import com.alibaba.fastjson.JSON;

import com.attilax.core.ForeachFunctionV2;

import com.attilax.io.DirTraveService;

import com.attilax.io.FileService;

import com.attilax.io.FileUtilsAti;

import com.attilax.io.filex;

import com.attilax.web.es.esUtil;

import com.cnhis.cloudhealth.module.log.Cls1;

import com.google.common.collect.Maps;

public class codescanner {

static final Logger logger = Logger.getLogger(codescanner.class);

// "http://192.168.1.18:9200/index_db_codelib/type1" "C:\codelibcaptch"  "c:\codeProcessedMoveDir"

public static void main(String[] args) throws InterruptedException {

String url = args[0];

;// "http://192.168.1.18:9200/index_db_codelib/type1";

String codedir = args[1];

String codeProcessedMoveDir = args[2];

while (true) {

DirTraveService.traveV6_vS531(new File(codedir), new ForeachFunctionV2() {

@Override

public void each(int count, File strFileName, int deep) throws Exception {

if (!strFileName.getAbsolutePath().trim().endsWith(".java")) {

FileService.move(strFileName.getAbsolutePath(), codeProcessedMoveDir, codedir);

return;

}

String t = FileUtilsAti.readFileToStringAutoDetectEncode(strFileName);

logger.info(strFileName);

Map  m=Maps.newLinkedHashMap();m.put("txt", t);

String r = esUtil.addData_post(url, JSON.toJSONString(m));

//String r = esUtil.addData_post(url, t);

logger.info(r);

FileService.move(strFileName.getAbsolutePath(), codeProcessedMoveDir, codedir);

}

});

Thread.sleep(5000);

logger.info("--hreat   break");

}

}

}

8. Resulzt

codelibprj_2018-05-31 周四 15-01-39.74 _java_codelib    19m

codelibprj_2018-05-31 周四 15-01-39.74 _js_codelib.zip   25M

All      130M

原文地址:https://www.cnblogs.com/attilax/p/15197589.html