NativeScript / NativeScript/nativescript-cli

CLI does not handle deleted files from App_Resources/Android/src

未關閉
#5,083 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug build debug os: android prepare run unit testing
主要語言
JavaScript
星號
1.1k
分支
204
平均合併
1 天 9 小時
30 天內合併 PR
8

描述

If a user adds some Java/Kotlin files in the App_Resources/Android/src folder and runs a build, the files are copied into the platforms/android/app/src folder.
If the user, however, deletes some file in App_Resources/Android/src and triggers a second build, this does not change the state of the platforms/android/app/src directory.

Issue seems to be due to this logic: https://github.com/NativeScript/nativescript-cli/blob/master/lib/services/android-project-service.ts#L294

The whole implementation of the prepareAppResources method could probably be improved with setting an additional value provided to srcDir in the build.gradle

sourceSets {
    main {
        java {
            srcDir 'src/src'
        }
    }
}

As for the libs folder, it's probably a good idea to attach it as an implementation filetree(<libs_path>) in the dependencies block in the build.gradle

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 lib/services/android-project-service.ts 中的 prepareAppResources 開始,檢查相關的 build.gradle sourceSets 和 dependencies 處理邏輯。透過執行建置、刪除 App_Resources/Android/src 下的一個檔案,然後再次建置來重現問題;當產生的 platforms/android/app/src 狀態同時反映刪除和新增時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, java, javascript, kotlin
領域
build-system, cli, mobile
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。