• dotnet 跨平台编译发布


    dotnet publish 命令,bash脚本如下(Windows安装git即可建议sh关联)

    publish.sh

    #!/usr/bin/env bash
    
    # one line command: 
    # array=( win-x64 linux-x64 osx-x64 ); for i in "${array[@]}"; do printf "
    >>> building $i ...
    
    "; dotnet publish -r $i -c Release -p:PublishSingleFile=true; done
    
    set +x +e
    # runtime array: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
    array=( win-x64 linux-x64 osx-x64 )
    config='Release'
    # publish args: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
    args=''
    declare -i count=${#array[*]}
    declare -i num=1
    printf '>>> 33[1;36mClean bin folder ...33[0m
    
    '
    find . -type d ( -iname 'bin' -o -iname 'obj' ) | xargs rm -rf
    printf '33[1;36mOK33[0m
    '
    for i in "${array[@]}"; do
        printf "
    >>> 33[1;36m($num/$count) Building $i ...33[0m
    
    "
        dotnet publish -r $i -c $config -p:PublishSingleFile=true $args
        if [ $? = 0 ]; then
            printf '
    33[1;32m'SUCCESS'33[0m
    '
        else
            printf '
    33[1;31m'ERROR: $?'33[0m
    '
        fi
        let num+=1
    done
    printf "
    33[1;36mAll done. 10s to exit ...33[0m
    "
    sleep 10s

  • 相关阅读:
    第6章 影响 MySQL Server 性能的相关因素
    第 5 章 MySQL 备份与恢复
    第四章:4.2MySQL 权限系统介绍
    pb中的条件语句,if else,choose case ,for
    UVA
    UVA
    UVA
    UVA
    UVA
    web前端视频收集
  • 原文地址:https://www.cnblogs.com/Bob-wei/p/10921487.html
Copyright © 2020-2023  润新知