Skip to content

[@next] CLI does not handle platform specific files #2586

Closed

Description

@dtopuzov

Steps to reproduce:

tns create TestApp
tns prepare android --path TestApp -> everything is ok
edit some file, for example TestApp/app/main-view-model.js (repalace 42 with 50).
tns prepare android --path TestApp -> platform specific files are there.

Files like <modules folder>/application/application.android.js and <modules folder>/application/application.ios.js are not processed.

Caused by this commit:
a008db1

Activity

  1. rosen-vladimirov commented on Mar 7, 2017

    @rosen-vladimirov
    Contributor

    @dtopuzov please provide more information as I'm unable to reproduce the issue with both latest master and @next version of CLI:

    $ ../bin/tns create TestApp
    Installing  tns-template-hello-world
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- tns-template-hello-world@2.5.0
      `-- nativescript-theme-core@1.0.3
    
    
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- tns-core-modules@2.5.1
      `-- tns-core-modules-widgets@2.5.0
    
    
    
    > nativescript-dev-android-snapshot@0.0.7 postinstall D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp\node_modules\nativescript-dev-android-snapshot
    > node postinstall.js
    
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- nativescript-dev-android-snapshot@0.0.7
      +-- adm-zip@0.4.7
      +-- nativescript-hook@0.2.1
      | +-- glob@6.0.4
      | | +-- inflight@1.0.6
      | | | `-- wrappy@1.0.2
      | | +-- inherits@2.0.3
      | | +-- minimatch@3.0.3
      | | | `-- brace-expansion@1.1.6
      | | |   +-- balanced-match@0.4.2
      | | |   `-- concat-map@0.0.1
      | | +-- once@1.4.0
      | | `-- path-is-absolute@1.0.1
      | `-- mkdirp@0.5.1
      |   `-- minimist@0.0.8
      +-- semver@5.3.0
      `-- shelljs@0.6.1
    
    
    Project TestApp was successfully created.
    
    $ ../bin/tns prepare android --path TestApp
    Copying template files...
      - Installing tns-androidInstalling  tns-android
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- tns-android@2.5.0 roid
    
    
      extract:babel-types -> gu | |#####################################################################################################################################################################--------------------------------------------Installing tns-androidextract:babel-traverse -> - |#####################################################################################################################################################################------------------------- extract:babel-runtime ->  | |########################################################################################################################################################################-----------------------------------------
      - Installing tns-androidD:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- babel-traverse@6.4.5 d
      +-- babel-code-frame@6.22.0
      | +-- chalk@1.1.3
      | | +-- ansi-styles@2.2.1
      | | +-- escape-string-regexp@1.0.5
      | | +-- has-ansi@2.0.0
      | | | `-- ansi-regex@2.1.1
      | | +-- strip-ansi@3.0.1
      | | `-- supports-color@2.0.0
      | +-- esutils@2.0.2
      | `-- js-tokens@3.0.1
      +-- babel-messages@6.23.0
      | `-- babel-runtime@6.23.0
      |   +-- core-js@2.4.1
      |   `-- regenerator-runtime@0.10.3
      +-- babel-runtime@5.8.38
      | `-- core-js@1.2.7
      +-- babel-types@6.23.0
      | +-- babel-runtime@6.23.0
      | +-- lodash@4.17.4
      | `-- to-fast-properties@1.0.2
      +-- babylon@6.16.1
      +-- debug@2.6.1
      | `-- ms@0.7.2
      +-- globals@8.18.0
      +-- invariant@2.2.2
      | `-- loose-envify@1.3.1
      +-- lodash@3.10.1
      `-- repeating@1.1.3
        `-- is-finite@1.0.2
          `-- number-is-nan@1.0.1
    
    
      regenerator-runtime@0.10.3 node_modules\regenerator-runtime -> node_modules\babel-messages\node_modules\babel-runtime\node_modules\regenerator-runtime
    \ Installing tns-android- babel-runtime@6.23.0 node_modules\babel-types\node_modules\babel-runtime
    - lodash@4.17.4 node_modules\babel-types\node_modules\lodash
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- babel-types@6.4.5
    
    
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- babylon@6.4.5 -android
    
    
    D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp
    `-- lazy@1.0.11 ns-android
    
    
    Project successfully created.
    Executing before-prepare hook from D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp\hooks\before-prepare\nativescript-dev-android-snapshot.js
    Preparing project...
    
    :config phase:  createDefaultIncludeFiles
    
    :config phase:  copyAarDependencies
    
    :config phase:  addAarDependencies
            +adding dependency: D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp\platforms\android\libs\aar\widgets-release.aar
    Incremental java compilation is an incubating feature.
    :asbg:clean UP-TO-DATE
    :deleteMetadata
    :deleteFlavors
    :deleteConfigurations UP-TO-DATE
    :clean
    
    BUILD SUCCESSFUL
    
    Total time: 9.404 secs
    Successfully prepared plugin nativescript-theme-core for android.
    Successfully prepared plugin tns-core-modules for android.
    Successfully prepared plugin tns-core-modules-widgets for android.
    process platform specific files will be called for directoryPath:  D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp\platforms\android\src\main\assets\app   platform:  android   excludedDirs:  [ 'App_Resources', 'tns_modules' ]
    Project successfully prepared (android)
    Executing after-prepare hook from D:\Rosen\Work\temp\nativescript-cli\scratch\TestApp\hooks\after-prepare\nativescript-dev-android-snapshot.js
    
    $ ls -l TestApp/platforms/android/src/main/assets/app/tns_modules/tns-core-modules/application/
    total 17
    -rw-r--r-- 1 rosen 197609  3642 Mar  7 23:15 application-common.js
    -rw-r--r-- 1 rosen 197609 11203 Mar  7 23:15 application.js
    -rw-r--r-- 1 rosen 197609    74 Mar  7 23:15 package.json
    

    As you can see, I've tried the steps you've provided and there's not application.android.js on my side.

  2. Plamen5kov commented on Mar 8, 2017

    @Plamen5kov
    Contributor

    steps to reproduce:
    cli -> 3.0.0 master

    tns create cliapp && cd cliapp
    tns platform add android@next
    tns build android
    modify "app/App_Resources/Android/AndroidManifest.xml" minSdkVersion or whatever
    tns prepare android
    

    after the last prepare:
    ls -la platforms/android/src/main/assets/app/tns_modules/tns-core-modules/application
    result:

    -rw-r--r--.  1 plamen5kov plamen5kov 11211 Mar  8 17:02 application.android.js
    -rw-r--r--.  1 plamen5kov plamen5kov  3642 Mar  8 17:02 application-common.js
    -rw-r--r--.  1 plamen5kov plamen5kov 10994 Mar  8 17:02 application.ios.js
    -rw-r--r--.  1 plamen5kov plamen5kov 11203 Mar  8 17:01 application.js
    -rw-r--r--.  1 plamen5kov plamen5kov    74 Mar  8 17:02 package.json
    
  3. self-assigned this
    on Mar 9, 2017
  4. added a commit that references this issue on Mar 9, 2017
  5. added this to the 3.0.0-RC milestone on Mar 9, 2017
  6. added a commit that references this issue on Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions