小编dsf*_*dsf的帖子

在Android Studio Arctic Fox Canary 8 中,app 级别的build.gradle 不会生成`allprojects` 部分并在手动添加时导致错误

在 Android Studio Arctic Fox Canary 8 中创建新项目时,这是应用级别的 build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.0-alpha08"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Run Code Online (Sandbox Code Playgroud)

在Android Studio 4.1.2中创建相同的新项目时,app级的build.gradle文件是这样的:

// Top-level build file where you can add configuration options common to all sub-projects/modules. …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio

24
推荐指数
5
解决办法
8106
查看次数

如何对 git 分支输出进行版本排序(与通常的字母/字典排序相比)

我使用 git branch -a 来显示分支。

我假设 git branch -a 没有按字母顺序排序。

需要git branch -a按数字排序,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11而不是10, 11, 1, 2, 3, 4, 5, 6, 7, 8, 9

考虑一下,我没有能力重命名像前缀0这样的分支Part-02,例如作为一种解决方法。

我对第三方命令行 git 客户端以及最后的手段持开放态度。

在做 git branch -a

电流输出

  remotes/origin/Part-10_LoadStateListener
  remotes/origin/Part-11_Navigating-to-the-Detail-Screen
  remotes/origin/Part-12_Implementing-the-DetailsFragment
  remotes/origin/Part-13_Handling-Process-Death
  remotes/origin/Part-1_Project-Setup
  remotes/origin/Part-2_Layouts-&-Model-Class
  remotes/origin/Part-3_Navigation-Component
  remotes/origin/Part-4_API-Interface
  remotes/origin/Part-5_Dependency-Injection-with-Hilt
  remotes/origin/Part-6_PagingSource-&-PagingData
  remotes/origin/Part-7_PagingDataAdapter
  remotes/origin/Part-8_Header-&-Footer
  remotes/origin/Part-9_Search-Functionality

Run Code Online (Sandbox Code Playgroud)

预期输出

  remotes/origin/Part-1_Project-Setup
  remotes/origin/Part-2_Layouts-&-Model-Class
  remotes/origin/Part-3_Navigation-Component
  remotes/origin/Part-4_API-Interface
  remotes/origin/Part-5_Dependency-Injection-with-Hilt
  remotes/origin/Part-6_PagingSource-&-PagingData
  remotes/origin/Part-7_PagingDataAdapter
  remotes/origin/Part-8_Header-&-Footer
  remotes/origin/Part-9_Search-Functionality
  remotes/origin/Part-10_LoadStateListener
  remotes/origin/Part-11_Navigating-to-the-Detail-Screen
  remotes/origin/Part-12_Implementing-the-DetailsFragment
  remotes/origin/Part-13_Handling-Process-Death …
Run Code Online (Sandbox Code Playgroud)

git sorting command-line git-branch

3
推荐指数
2
解决办法
71
查看次数