Skip to content

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

Open
@vmutafov

Description

@vmutafov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbuildDescribes issues related to build operationsdebugos: androidprepareDescribes issues related to prepare commandrunDescribes issues related to run commandunit testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions