<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      [Cake] 3. dotnet 本地工具 cake & dotnet format

      在上一篇[Cake] 2. dotnet 全局工具 cake中介紹了通過.Net Core 2.1 的全局工具dotnet tool命令來簡化cake的安裝和使用。因?yàn)槭侨职惭b,則無法適應(yīng)每個(gè)項(xiàng)目對(duì)特定版本的要求。隨著.Net Core 3.0中增加的對(duì)本地工具(項(xiàng)目級(jí)別)的支持,使得這一問題得以解決。

      1. cake的安裝和還原

      # 創(chuàng)建一個(gè)本地的工具清單文件
      dotnet new tool-manifest
      
      # 安裝本地工具 
      dotnet tool install cake.tool --version 0.35.0
      

      dotnet new tool-manifest命令會(huì)在當(dāng)前目錄下創(chuàng)建一個(gè).config/dotnet-tools.json的文件。當(dāng)我們執(zhí)行dotnet tool install cake.tool時(shí),就會(huì)把cake.tool的相關(guān)信息寫入到這個(gè)文件。

      {
        "version": 1,
        "isRoot": true,
        "tools": {
          "cake.tool": {
            "version": "0.35.0",
            "commands": [
              "dotnet-cake"
            ]
          },
          "dotnet-format": {
            "version": "3.1.37601",
            "commands": [
              "dotnet-format"
            ]
          }
        }
      }
      

      之后就可以執(zhí)行dotnet cake(或者dotnet tool run dotnet-cake)命令了。

      $ dotnet cake --help
      
      Usage: Cake.exe [script] [--target=value] [--verbosity=value]
                      [--showdescription] [--dryrun] [..]
      
      Example: Cake.exe
      Example: Cake.exe build.cake --verbosity=quiet
      Example: Cake.exe build.cake --showdescription
      
      Options:
          --target <TARGET>    Target task to invoke. Script must support this explicitly.
          --verbosity=value    Specifies the amount of information to be displayed.
                               (Quiet, Minimal, Normal, Verbose, Diagnostic)
          --debug              Performs a debug.
          --showdescription    Shows description about tasks.
          --showtree           Shows the task dependency tree.
          --dryrun             Performs a dry run.
          --exclusive          Execute a single task without any dependencies.
          --bootstrap          Download/install modules defined by #module directives
          --version            Displays version information.
          --info               Displays additional information about Cake execution.
          --help               Displays usage information.
      

      當(dāng)我們?cè)贑I/CD或者另外一個(gè)環(huán)境上時(shí),只需要執(zhí)行

      dotnet tool restore
      

      就可以把.config/dotnet-tools.json文件中配置的相關(guān)工具安裝在本地了。

      2. dotnet format 格式化

      介紹一下另外一個(gè)非常有用的工具dotnet-format。看下官方介紹:

      dotnet-format is a code formatter for dotnet that applies style preferences to a project or solution. Preferences will be read from an .editorconfig file, if present, otherwise a default set of preferences will be used. At this time dotnet-format is able to format C# and Visual Basic projects with a subset of supported .editorconfig options.

      它會(huì)使用.editorconfig中的格式化配置,來統(tǒng)一項(xiàng)目的文件編碼和格式。 安裝方式同上面的cake一樣。

      # 安裝
      dotnet tool install dotnet-format
      
      # 檢查并保存
      dotnet format
      
      # 只檢查不保存,檢查失敗則返回非0的exit code
      dotnet format --check --dry-run
      

      結(jié)合CI使用非常方便,當(dāng)你push的代碼不符合格式要求時(shí)就直接失敗了(一個(gè)失敗的示例:https://github.com/linianhui/cake.example/commit/471f58754c390cb9946a5282c6d73275b90549d9/checks?check_suite_id=361927437)。

      示例,它會(huì)提示出那些地方不符合.editorconfig的要求:

      $ dotnet format --check --dry-run
        1-src/Cake.Example/Animals/Cat.cs(17,2): Add final newline.
        1-src/Cake.Example/Animals/Dog.cs(17,2): Add final newline.
        1-src/Cake.Example/IAnimal.cs(14,2): Add final newline.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(18,2): Add final newline.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(18,2): Add final newline.
        1-src/Cake.Example/Animals/Cat.cs(1,31): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(2,2): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(3,18): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(4,12): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(5,19): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(6,38): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(7,6): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(8,22): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(9,15): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(10,23): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(11,32): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(12,29): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(13,10): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(14,25): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(15,10): Fix end of line marker.
        1-src/Cake.Example/Animals/Cat.cs(16,6): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(1,31): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(2,2): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(3,18): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(4,11): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(5,19): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(6,38): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(7,6): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(8,22): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(9,15): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(10,23): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(11,32): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(12,29): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(13,10): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(14,25): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(15,10): Fix end of line marker.
        1-src/Cake.Example/Animals/Dog.cs(16,6): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(1,23): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(2,2): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(3,18): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(4,13): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(5,19): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(6,29): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(7,6): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(8,22): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(9,16): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(10,23): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(11,32): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(12,23): Fix end of line marker.
        1-src/Cake.Example/IAnimal.cs(13,6): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(1,28): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(2,13): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(2,13): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(4,42): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(5,2): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(6,32): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(7,6): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(8,15): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(9,39): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(10,10): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(11,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(11,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(13,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(13,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(15,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(16,10): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/CatTest.cs(17,6): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(1,28): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(2,13): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(2,13): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(4,42): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(5,2): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(6,32): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(7,6): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(8,15): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(9,39): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(10,10): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(11,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(11,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(13,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(13,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(15,40): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(16,10): Fix end of line marker.
        2-test/Cake.Example.Tests/AnimalsTests/DotTest.cs(17,6): Fix end of line marker.
        Formatted code file 'Cat.cs'.
        Formatted code file 'Dog.cs'.
        Formatted code file 'IAnimal.cs'.
        Formatted code file 'CatTest.cs'.
        Formatted code file 'DotTest.cs'.
        Format complete in 3529ms.
      

      dotnet-foramt支持的.editorconfig信息比較豐富,具體的參考 https://github.com/dotnet/format/wiki/Supported-.editorconfig-options 的說明,這里也貼一個(gè)我在使用的.editorconfig
      https://github.com/linianhui/code.guide/blob/master/csharp/.editorconfig

      3. 參考

      源碼: https://github.com/linianhui/cake.example

      我的.editorconfig : https://github.com/linianhui/code.guide/blob/master/csharp/.editorconfig

      https://editorconfig.org/

      https://github.com/dotnet/format/wiki/Supported-.editorconfig-options

      https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#local-tools

      https://github.com/dotnet/format

      posted @ 2019-12-17 14:56  Timetombs  閱讀(1518)  評(píng)論(0)    收藏  舉報(bào)
      主站蜘蛛池模板: 蜜桃无码一区二区三区| 久久国产免费观看精品3| 国内精品无码一区二区三区| 国产午夜福利不卡在线观看 | 欧美老熟妇乱子伦牲交视频| 亚洲第一综合天堂另类专| 久久日韩在线观看视频| 好吊视频在线一区二区三区| 55夜色66夜色国产精品视频| 国产精品视频一区二区噜| 日韩精品一区二区三区人| 成人午夜视频在线| 国产精品白浆在线观看免费 | 熟女一区二区中文字幕| 国产极品美女高潮抽搐免费网站| 日韩成av在线免费观看| 国产亚洲精品成人aa片新蒲金| 免费无码黄动漫在线观看| 成人午夜大片免费看爽爽爽| 国产中文字幕一区二区| 国产丝袜视频一区二区三区| 九九色这里只有精品国产| 亚洲色最新高清AV网站| 沧源| 国产在线国偷精品免费看| A毛片毛片看免费| 亚洲www永久成人网站| 亚洲最大天堂在线看视频| 欧美疯狂三p群体交乱视频| 久久国产成人av蜜臀| 99re6这里有精品热视频 | 色爱av综合网国产精品| 精品国产中文字幕av| 国产视频一区二区三区四区视频| 中文字幕有码高清日韩| 7m精品福利视频导航| 日本道不卡一二三区视频| 国产一区二区日韩经典| 额尔古纳市| 厨房与子乱在线观看| 亚洲另类无码专区国内精品|