zoukankan      html  css  js  c++  java
  • 使用批处理打包C#开发程序

    最近项目接近尾声,测试比较频繁,每天需要发布多个版本

    @echo off
    set zip=C:Program Files7-Zip7z.exe
    set timestamp=%date:~6,4%-%date:~0,2%-%date:~3,2%
    set timestamp=%date:-=%
    set tardir=%cd%Car.SMIS.Appbin
    set src=%cd%Car.SMIS.AppinRelease
    set src1=%src%Facility
    set src2=%src%appsettings.json
    set src3=%src%unity.config
    set src4=%src%Car.*
    set src5=%src%log4net.config
    
    cls
    echo 7z.exe "%zip%" 
    echo "%src4%"
    echo tardir "%tardir%\%timestamp%.zip"
    
    echo [%date% %time%] Start creating zip files -- mq > "%tardir%ipDescription.txt"
    "%zip%" a "%tardir%Car.SMIS.App_Release_%timestamp%_00_update.zip" "%src1%" "%src2%" "%src3%" "%src4%" "%src5%"
    ::"%zip%" a "%tardir%Car.SMIS.App_Release_%timestamp%_00_SDK.zip" "%src%*" -x!"%src1%" -x!"%src2%" -x!"%src3%" -x!"%src4%" -x!"%src5%"
    
    
    rem Add zip description file
    echo [%date% %time%] End creating zip file -- mq >> "%tardir%ipDescription.txt"
    if exist "%tardir%Car.SMIS.App_Release_%timestamp%_00_update.zip" (
    "%zip%" u "%tardir%Car.SMIS.App_Release_%timestamp%_00_update.zip" "%tardir%ipDescription.txt"
    ) else ( echo ----------------------------------------------------------------------------
    echo [Error] file does not exist : "%tardir%Car.SMIS.App_Release_%timestamp%_00_update.zip" )
    if exist "%tardir%Car.SMIS.App_Release_%timestamp%_00_SDK.zip" (
    "%zip%" u "%tardir%Car.SMIS.App_Release_%timestamp%_00_SDK.zip" "%tardir%ipDescription.txt"
    ) else ( echo ----------------------------------------------------------------------------
    echo [Error] file does not exist : "%tardir%Car.SMIS.App_Release_%timestamp%_00_SDK.zip" )
    del "%tardir%ipDescription.txt"
    
    
    
    pause
    explorer "%tardir%"
    goto :eof

    测试Debug的打包

    @echo off
    set zip=C:Program Files7-Zip7z.exe
    set timestamp=%date:~6,4%-%date:~0,2%-%date:~3,2%
    set timestamp=%date:-=%
    set src=%cd%Debug
    
    echo 7z.exe : "%zip%" 
    echo src : "%src%"
    echo tardir : "%timestamp%.zip"
    echo cd : %cd%
    
    echo.
    set fCount=0
    for /f "delims=" %%i in ('dir /b /a-d "%cd%Debug_%timestamp%_*.zip"') do (set /a fCount+=1)
    set /a fCount+=1
    
    ::"%zip%" a "%cd%Debug_%timestamp%_%fCount%.zip" "%src%"
    
    pause
  • 相关阅读:
    实例!使用Idea创建SSM框架的Maven项目
    springboot开发中的领域模型pojo
    JDK源码阅读:Object类阅读笔记
    DevSecOps: JIRA、Confluence工具、JIRA插件-Xray、eazybi、FishEye、Crucible、jenkins
    MySQL监控及优化
    二叉树 红黑树 B树 B+树 理解
    mysql高性能分页语句_如何优化Mysql千万级快速分页
    使用.Net MinIO SDK 踩的坑
    Windows下Minio介绍、安装及使用、密码修改
    使用docker mediawiki,搭建网页wiki
  • 原文地址:https://www.cnblogs.com/mq0036/p/11351311.html
Copyright © 2011-2022 走看看