使用SenchaCMD创建包,我将源代码(我计划在我的应用程序之间共享的一些全局方法)放在src文件夹中并尝试构建。
我得到以下输出:
Sencha Cmd v6.0.2.14
[INF] Processing Build Descriptor : default
[INF] Starting server on port : 1841
[INF] Mapping http://localhost:1841/~cmd to /home/spsimmons/bin/Sencha/Cmd/6.0.2.14...
[INF] Mapping http://localhost:1841/ to /var/www/CpsWebApp/apps...
[INF] Package web server available at http://localhost:1841
[INF] Writing concatenated output to file /var/www/CpsWebApp/apps/packages/local/global/build/global-debug.js
[INF] Compressing data with YuiJavascriptCompressor
[INF] Writing concatenated output to file /var/www/CpsWebApp/apps/packages/local/global/build/global.js
[INF] merging 1 input resources into /var/www/CpsWebApp/apps/packages/local/global/build/resources
[INF] merged 1 resources into /var/www/CpsWebApp/apps/packages/local/global/build/resources
[INF] merging 10 input resources into /var/www/CpsWebApp/apps/packages/local/global/build
[INF] merged 0 resources into /var/www/CpsWebApp/apps/packages/local/global/build
[ERR]
[ERR] BUILD FAILED
[ERR] java.lang.NullPointerException
[ERR]
[ERR] Total time: 2 seconds
[ERR] The following error occurred while executing this line:
/var/www/CpsWebApp/apps/packages/local/global/.sencha/package/build-impl.xml:188: The following error occurred while executing this line:
/var/www/CpsWebApp/apps/packages/local/global/.sencha/package/slice-impl.xml:35: java.lang.NullPointerException
GlobalLib.js:
Ext.define('global.GlobalLib', {
statics: {
trim: function(input) {
return input.replace(/^\s+|\s+$/g, '');
},
toUpperCase: function(input) {
return input.toUpperCase();
},
toLowerCase: function(input) {
return input.toLowerCase();
},
toTitleCase: function(input) {
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i;
return input.replace(/([^\W_]+[^\s-]*) */g, function(match, p1, index, title) {
if (index > 0 && index + p1.length !== title.length &&
p1.search(smallWords) > -1 && title.charAt(index - 2) !== ":" &&
title.charAt(index - 1).search(/[^\s-]/) < 0) {
return match.toLowerCase();
}
if (p1.substr(1).search(/[A-Z]|\../) > -1) {
return match;
}
return match.charAt(0).toUpperCase() + match.substr(1);
});
},
...
}
});
的package.json:
{
"name": "global",
"namespace": "global",
"type": "code",
"creator": "Shawn P. Simmons",
"summary": "Global Methods for the CpsWebApp Application",
"detailedDescription": "Global Methods for the CpsWebApp Application",
"version": "1.0.0",
"compatVersion": "1.0.0",
"format": "1",
"output": "${package.dir}/build",
"local": true,
"sass" : {
"namespace": "global",
"etc": "${package.dir}/sass/etc/all.scss,${package.dir}/${toolkit.name}/sass/etc/all.scss",
"var": "${package.dir}/sass/var,${package.dir}/${toolkit.name}/sass/var",
"src": "${package.dir}/sass/src,${package.dir}/${toolkit.name}/sass/src"
},
"classpath": "${package.dir}/src,${package.dir}/${toolkit.name}/src",
"overrides": "${package.dir}/overrides,${package.dir}/${toolkit.name}/overrides"
}
sencha.cfg:
# The folder that contains sub-packages of this package. Only valid for "framework"
# package type.
#
package.subpkgs.dir=${package.dir}/packages
#==============================================================================
# Custom Properties - Place customizations below this line to avoid merge
# conflicts with newer versions
package.cmd.version=6.0.2.14
package.framework = ext
当我不断遇到像这样的show-stoppers时,编写代码变得越来越困难。我没有看到配置有什么问题,我按照文档但我无法完成此任务。有没有人知道为什么这不会建立?
答案 0 :(得分:1)
在执行“切片”时看起来像Sencha Cmd中的内部错误。
作为解决方法,您可以尝试跳过build.properties
中的“切片”构建阶段:
skip.slice=1
请参阅https://docs.sencha.com/cmd/6.x/advanced_cmd/cmd_build.html#Build_Targets