VS2015 Build Not Executing 节点挂钩并且没有错误
VS2015 Build Not Executing node hooks and no errors
我在 Windows 10 家庭版上使用 VS2015 社区版更新 3、最新的 TACO 和 Ionic 框架。
我在 config.xml 中定义了一些 before_prepare Cordova 挂钩,用于将一些文件复制到 www/lib。
我注意到,如果我从命令行调用 cordova prepare 或 cordova build,我的挂钩会按预期调用,但是当我执行 Visual Studio 构建时,它不会调用它们。
有一段时间,它实际上是在我的文本编辑器中打开 .js 文件而不是执行。我发现一篇文章讨论了文件编码中的 BOM 如何被丢弃 Visual Studio,所以我确保所有这些 .js 文件都是 ASCII 编码。现在这些文件不会在 Notepad++ 中自动打开,但它们仍然不会执行并且没有错误。
我试过在顶部有和没有 #!/usr/bin/env 节点行。
当我为 Android 进行调试构建时,我得到的结果与我在进行 Cordova CLI 构建时看到的完全不同:
>------ Build started: Project: Wenzaa, Configuration: Debug Android ------
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
1> ------ Name from source package.json: vs-tac
1> ------ Version from source package.json: 1.0.42
1> ------ Package already installed globally at correct version.
1> ------ Cordova tools 6.1.1 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa\bld\Android\Debug
1> ------ platformConfigurationBinDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa\bin\Android\Debug
1> ------ buildCommand: prepare
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: Wenzaa
1> ------ projectSourceDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa
1> ------ npmInstallDir: C:\Users\Jesse\AppData\Roaming\npm
1> ------ language: en-US
1> ------ Platform android already exists
1> ------ Updating plugins
1> ------ Currently installed plugins: cordova-plugin-console@1.0.5,cordova-plugin-device@1.1.4,cordova-plugin-splashscreen@4.0.1,cordova-plugin-statusbar@2.2.1,ionic-plugin-keyboard@2.2.1
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
我尝试通过程序和功能面板 ("Repair option") 修复 Apache Tools for Cordova。不知道为什么,但看起来我已经将它作为一个单独的包安装,就像通过 Visual Studio 组件安装的选项一样。难道是这个?
在查看 Cordova Hooks Guide 时,我似乎已经分配了 before_prepare 挂钩,但在编译期间实际上不应该 运行。通过将它们移动到 before_compile,它们将 运行。但是,我拥有的依赖包不经常更改,所以我可以将它们保留在 before_prepare 中,只需使用 cordova prepare CLI 命令 when/if 我更新依赖包。
我和类似的东西打了一段时间,刚刚找到了一个解决方案,我想知道它是否也适用于你。
为了让构建在 "Currently configured plugins:" 之后不停止,我不得不 select "Device" 而不是其中的任何内容。我也将项目设置为启动项目。
现在它通过构建,运行 我的钩子并输出一个包!
希望对您有所帮助
我在 Windows 10 家庭版上使用 VS2015 社区版更新 3、最新的 TACO 和 Ionic 框架。
我在 config.xml 中定义了一些 before_prepare Cordova 挂钩,用于将一些文件复制到 www/lib。
我注意到,如果我从命令行调用 cordova prepare 或 cordova build,我的挂钩会按预期调用,但是当我执行 Visual Studio 构建时,它不会调用它们。
有一段时间,它实际上是在我的文本编辑器中打开 .js 文件而不是执行。我发现一篇文章讨论了文件编码中的 BOM 如何被丢弃 Visual Studio,所以我确保所有这些 .js 文件都是 ASCII 编码。现在这些文件不会在 Notepad++ 中自动打开,但它们仍然不会执行并且没有错误。
我试过在顶部有和没有 #!/usr/bin/env 节点行。
当我为 Android 进行调试构建时,我得到的结果与我在进行 Cordova CLI 构建时看到的完全不同:
>------ Build started: Project: Wenzaa, Configuration: Debug Android ------
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
1> ------ Name from source package.json: vs-tac
1> ------ Version from source package.json: 1.0.42
1> ------ Package already installed globally at correct version.
1> ------ Cordova tools 6.1.1 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa\bld\Android\Debug
1> ------ platformConfigurationBinDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa\bin\Android\Debug
1> ------ buildCommand: prepare
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: Wenzaa
1> ------ projectSourceDir: D:\MOBILEDEV\ionic\Wenzaa\Wenzaa
1> ------ npmInstallDir: C:\Users\Jesse\AppData\Roaming\npm
1> ------ language: en-US
1> ------ Platform android already exists
1> ------ Updating plugins
1> ------ Currently installed plugins: cordova-plugin-console@1.0.5,cordova-plugin-device@1.1.4,cordova-plugin-splashscreen@4.0.1,cordova-plugin-statusbar@2.2.1,ionic-plugin-keyboard@2.2.1
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins:
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
我尝试通过程序和功能面板 ("Repair option") 修复 Apache Tools for Cordova。不知道为什么,但看起来我已经将它作为一个单独的包安装,就像通过 Visual Studio 组件安装的选项一样。难道是这个?
在查看 Cordova Hooks Guide 时,我似乎已经分配了 before_prepare 挂钩,但在编译期间实际上不应该 运行。通过将它们移动到 before_compile,它们将 运行。但是,我拥有的依赖包不经常更改,所以我可以将它们保留在 before_prepare 中,只需使用 cordova prepare CLI 命令 when/if 我更新依赖包。
我和类似的东西打了一段时间,刚刚找到了一个解决方案,我想知道它是否也适用于你。
为了让构建在 "Currently configured plugins:" 之后不停止,我不得不 select "Device" 而不是其中的任何内容。我也将项目设置为启动项目。
现在它通过构建,运行 我的钩子并输出一个包!
希望对您有所帮助