├── .editorconfig ├── .gitattributes ├── .gitignore ├── .gitmodules ├── .idea ├── .name ├── codeStyleSettings.xml ├── encodings.xml ├── icenium-cli.iml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── jsLibraryMappings.xml ├── jsLinters │ └── jshint.xml ├── libraries │ ├── Generated_files.xml │ └── Node_js_Dependencies_for_icenium_cli.xml ├── modules.xml ├── scopes │ ├── Ice_CLI_TypeScript.xml │ └── scope_settings.xml ├── vcs.xml └── watcherTasks.xml ├── .jshintignore ├── .jshintrc ├── .npmignore ├── .travis.yml ├── .vscode ├── launch.json └── settings.json ├── ABIGNORE.md ├── BuildPackage.cmd ├── CONTRIBUTING.md ├── Gruntfile.js ├── LICENSE ├── README.md ├── ab-logo.png ├── bin ├── appbuilder ├── appbuilder.cmd └── appbuilder.js ├── for-developers.md ├── icenium-cli.sublime-project ├── lib ├── declarations.d.ts └── version-validator.ts ├── package.json ├── prepublish.js ├── publish.cmd ├── test.cmd ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Manage common editor configurations 2 | # set for example indentation tab and space 3 | # VS Extension: https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328 4 | # more extensions and plugins for your favorite editor here: http://editorconfig.org/#download 5 | 6 | ; Top-most EditorConfig file 7 | root = true 8 | 9 | ; 4-column space indentation 10 | [*] 11 | indent_style = tab 12 | indent_size = 4 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Ensure that the shebang of our start script can be correctly interpreted 2 | 3 | bin/appbuilder.js eol=lf 4 | 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !/*.js 3 | !bin/appbuilder.js 4 | !vendor/*.js 5 | *.js.map 6 | 7 | coverage 8 | lib-cov 9 | *.seed 10 | *.log 11 | *.csv 12 | *.dat 13 | *.out 14 | *.pid 15 | *.gz 16 | *.tgz 17 | *.tmp 18 | *.sublime-workspace 19 | tscommand*.tmp.txt 20 | .tscache/ 21 | /lib/.d.ts 22 | /config/config.json 23 | 24 | pids 25 | logs 26 | results 27 | scratch/ 28 | .idea/workspace.xml 29 | .idea/tasks.xml 30 | .idea/watcherTasks.xml 31 | 32 | test-reports.xml 33 | xunit.xml 34 | 35 | npm-debug.log 36 | node_modules 37 | resources/App_Resources 38 | resources/Cordova 39 | resources/NativeScript 40 | resources/ItemTemplates 41 | resources/ProjectTemplates 42 | resources/json-schemas 43 | resources/image-definitions.json 44 | docs/html 45 | **/obj 46 | **/bin/Microsoft.NodejsTools.WebRole.dll 47 | **/.vs 48 | **/.vscode 49 | **/.ntvs_analysis.dat 50 | !lib/hooks/before-*.js 51 | !lib/hooks/after-*.js 52 | .DS_Store 53 | 54 | !test-scripts/*.js -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Icenium/icenium-cli/9c5e03632989e58dfc0a67c4f201210d9b50c7a3/.gitmodules -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | icenium-cli -------------------------------------------------------------------------------- /.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/icenium-cli.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/jsLinters/jshint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/Generated_files.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /.idea/libraries/Node_js_Dependencies_for_icenium_cli.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/scopes/Ice_CLI_TypeScript.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 22 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | lib/resources/jquery-*.min.js -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "camelcase": false, 4 | "curly": true, 5 | "eqeqeq": true, 6 | "eqnull": true, 7 | "forin": true, 8 | "immed": true, 9 | "indent": 4, 10 | "latedef": "nofunc", 11 | "newcap": true, 12 | "noarg": true, 13 | "noempty": true, 14 | "nonew": false, 15 | "plusplus": false, 16 | "quotmark": "double", 17 | "strict": true, 18 | "trailing": true, 19 | "undef": true, 20 | "unused": true, 21 | 22 | "expr": true, 23 | "smarttabs": true, 24 | "globalstrict": true, 25 | 26 | "maxcomplexity": 8, 27 | "maxdepth": 6, 28 | "maxparams": 10, 29 | "maxstatements": 50, 30 | 31 | "browser": false, 32 | "node": true, 33 | 34 | "globals": 35 | { 36 | "process": true, 37 | "setTimeout": true, 38 | "require": true, 39 | "console": true, 40 | "module": true, 41 | "GLOBAL": true, 42 | "describe": true, 43 | "before": true, 44 | "it": true, 45 | "clientSockets": true, 46 | "__dirname": true 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gitattributes 3 | *.sublime-project 4 | lint.* 5 | .jshint* 6 | .npmignore 7 | *.tgz 8 | test-reports.xml 9 | for-developers.md 10 | prepublish.js 11 | Gruntfile.js 12 | *.cmd 13 | tscommand*.tmp.txt 14 | .tscache/ 15 | bin/*.cmd 16 | **/bin/Microsoft.NodejsTools.WebRole.dll 17 | 18 | config/config-* 19 | 20 | lib/**/*.ts 21 | lib/**/*.js.map 22 | 23 | scratch/ 24 | test/ 25 | **/docs/html 26 | **/obj 27 | **/.vs 28 | **/.ntvs_analysis.dat 29 | **/*.njsproj 30 | **/*.sln 31 | **/*.suo 32 | npm-debug.log 33 | node_modules 34 | 35 | test-scripts/ 36 | .vscode 37 | .gitmodules 38 | xunit.xml 39 | .travis.yml 40 | ab-logo.png 41 | ABIGNORE.md 42 | CONTRIBUTING.md 43 | tsconfig.json 44 | tslint.json 45 | .editorconfig -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | global: 3 | - APPBUILDER_SKIP_POSTINSTALL_TASKS=1 4 | - ResourceDownloadEnvironment=LIVE 5 | - DeploymentEnvironment=SIT 6 | language: node_js 7 | node_js: 8 | - '6' 9 | git: 10 | submodules: true 11 | install: 12 | - npm install --ignore-scripts 13 | before_script: 14 | - npm install grunt 15 | script: 16 | - node_modules/.bin/grunt lint 17 | - node_modules/.bin/grunt pack --no-color 18 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible Node.js debug attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program (Node 6+)", 11 | "program": "${workspaceRoot}/lib/appbuilder-cli.js", 12 | "cwd": "${workspaceRoot}", 13 | "sourceMaps": true, 14 | // define the arguments that you would like to pass to CLI, for example 15 | // "args": [ "build", "android", "--justlaunch" ] 16 | "args": [ 17 | 18 | ] 19 | }, 20 | 21 | { 22 | // in case you want to debug a single test, modify it's code to be `it.only(...` instead of `it(...` 23 | "type": "node", 24 | "request": "launch", 25 | "name": "Launch Tests (Node 6+)", 26 | "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", 27 | "cwd": "${workspaceRoot}", 28 | "sourceMaps": true 29 | }, 30 | 31 | { 32 | "type": "node", 33 | "runtimeArgs": [ 34 | "--harmony" 35 | ], 36 | "request": "launch", 37 | "name": "Launch Program (Node 4, Node 5)", 38 | "program": "${workspaceRoot}/lib/appbuilder-cli.js", 39 | "cwd": "${workspaceRoot}", 40 | "sourceMaps": true, 41 | // define the arguments that you would like to pass to CLI, for example 42 | // "args": [ "build", "android", "--justlaunch" ] 43 | "args": [ 44 | 45 | ] 46 | }, 47 | 48 | { 49 | // in case you want to debug a single test, modify it's code to be `it.only(...` instead of `it(...` 50 | "type": "node", 51 | "runtimeArgs": [ 52 | "--harmony" 53 | ], 54 | "request": "launch", 55 | "name": "Launch Tests (Node 4, Node 5)", 56 | "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", 57 | "cwd": "${workspaceRoot}", 58 | "sourceMaps": true 59 | }, 60 | 61 | { 62 | "type": "node", 63 | "request": "attach", 64 | "name": "Attach to Process", 65 | "port": 5858, 66 | "sourceMaps": true 67 | } 68 | 69 | ] 70 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "**/.git": true, 5 | "**/.DS_Store": true, 6 | "**/*.js": { "when": "$(basename).ts"}, 7 | "**/*.js.map": true 8 | } 9 | , 10 | "typescript.tsdk": "./node_modules/typescript/lib" 11 | } -------------------------------------------------------------------------------- /ABIGNORE.md: -------------------------------------------------------------------------------- 1 | .abignore 2 | ========= 3 | 4 | To set exclude and include rules, you can create and manage an `.abignore` file in the root of your project. 5 | 6 | * [Overview](#overview) 7 | * [Create .abignore](#create-abignore) 8 | * [Adding rules and comments](#adding-rules-and-comments) 9 | * [Sample .abignore](#sample-abignore) 10 | * [Troubleshooting](#troubleshooting) 11 | 12 | ## Overview 13 | 14 | When you develop apps with the Progress Telerik AppBuilder Command-Line Interface (AppBuilder CLI), you can choose which files to exclude from your application package. To set exclude and include rules, you can modify the `.abignore` file in the root of your project. 15 | 16 | The AppBuilder CLI respects `.abignore` during the following operations. 17 | 18 | * Build an application package. 19 | * Build an application package for publishing. 20 | * Build and deploy an application package on device. 21 | * Build and deploy in the companion app from QR code. 22 | * Build and deploy in the native emulators. 23 | * LiveSync changes to remote devices. 24 | * LiveSync changes to connected devices. 25 | 26 | The AppBuilder CLI does not respect `.abignore` during the following operations. 27 | 28 | * Build and deploy in the device simulator. 29 | 30 | ## Create .abignore 31 | 32 | Starting with AppBuilder 2.6, all newly created projects or cloned sample apps contain a default `.abignore`. To manage the exclude and include rules for projects created with earlier versions of AppBuilder, you need to manually add `.abignore` to your project. 33 | 34 | ### Create non-configuration-specific .abignore 35 | 36 | * If you are running the AppBuilder CLI on a Windows system, complete these steps to create `.abignore`. 37 | 1. From the command prompt, navigate to the root of your project. 38 | 1. Run the following command. 39 | 40 | ```Shell 41 | type nul > .abignore 42 | ``` 43 | * If you are running the AppBuilder CLI on an OS X or Linux system, complete these steps to create `.abignore`. 44 | 1. From the command prompt, navigate to the root of your project. 45 | 1. Run the following command. 46 | 47 | ```Shell 48 | touch .abignore 49 | ``` 50 | 51 | ### Create configuration-specific .abignore 52 | 53 | * If you are running the AppBuilder CLI on a Windows system, complete these steps to create `.abignore`. 54 | 1. From the command prompt, navigate to the root of your project. 55 | 1. To create an `.abignore` file which AppBuilder respects when you build for debugging, run the following command. 56 | 57 | ```Shell 58 | type nul > .debug.abignore 59 | ``` 60 | 1. To create an `.abignore` file which AppBuilder respects when you build for production, run the following command. 61 | 62 | ```Shell 63 | type nul > .release.abignore 64 | ``` 65 | * If you are running the AppBuilder CLI on an OS X or Linux system, complete these steps to create `.abignore`. 66 | 1. From the command prompt, navigate to the root of your project. 67 | 1. To create an `.abignore` file which AppBuilder respects when you build for debugging, run the following command. 68 | 69 | ```Shell 70 | touch .debug.abignore 71 | ``` 72 | 1. To create an `.abignore` file which AppBuilder respects when you build for production, run the following command. 73 | 74 | ```Shell 75 | touch .release.abignore 76 | ``` 77 | 78 | For more information about working with build configurations in the AppBuilder CLI, see [Managing Build Configurations](http://docs.telerik.com/platform/appbuilder/build-configurations/overview). 79 | 80 | ## Adding rules and comments 81 | 82 | > When you edit `.abignore`, make sure that your exclude and include rules comply with the glob syntax and any syntax specifics of the minimatch matching library.
For more information about glob syntax, see Glob in the Linux Programmer's Manual.
For more information about minimatch syntax, see Comparisons to other fnmatch/glob implementations. 83 | 84 | When you create and modify your `.abignore` file, keep in mind the following specifics. 85 | 86 | * Each rule must start on a new line. 87 | * Empty lines are ignored. 88 | * By default, all rules are exclude rules. 89 | * Starting with [AppBuilder 2.6\*](#troubleshooting), newly created projects contain a default `.abignore` file. This file excludes the following files and subdirectories from your application package. 90 | * All `Thumbs.db` files: Thumbnails cache files managed by Windows. 91 | * All `.DS_Store` files: Hidden OS X system files. 92 | * All `__MACOSX` directories and their contents: Hidden OS X system directories. 93 | * The `bin` directory and its contents: A subdirectory in projects created with Visual Studio. It contains your latest built application packages. 94 | * The `obj` directory and its contents: A subdirectory in projects created with Visual Studio. It contains the archived project files that AppBuilder sends to the build server. 95 | * The `.vs` directory and its contents: A subdirectory in projects created with Visual Studio 2015. It contains information, related specifically to your project in Visual Studio. 96 | * `.gitignore`: A file that Git uses to determine which files and directories to ignore when you are making a commit. 97 | * The `.git` directory and its contents: A subdirectory in which Git stores your version control history and other relevant version control data. 98 | * `.abignore`: This file contains exclude and include rules for your application package. 99 | * The `.ab` directory and its contents: The AppBuilder CLI creates and manages this subdirectory. It contains temporary working files which the AppBuilder CLI uses. 100 | * `.app.json`: This file contains configuration information about projects created with Screen Builder. 101 | * Files associated with popular development environments. 102 | * For projects created with AppBuilder 2.5.2 or earlier, you need to manually create `.abignore`. For such projects, by default, the AppBuilder CLI excludes the following files and subdirectories. You do not need to manually list these files in your `.abignore` file. 103 | * `.ab:` The AppBuilder CLI creates and manages this subdirectory. It contains temporary working files which the AppBuilder CLI uses. 104 | * `.abignore:` This file contains exclude and include rules for your application package. 105 | * `IPA, APK, and XAP:` The application packages for iOS, Android, and Windows Phone 8, respectively. 106 | * To introduce a comment, place a hash (`#`) before the text.
For example: 107 | 108 | ``` 109 | # This file contains exclude and include rules for my application package. 110 | ``` 111 | * Each rule must be a glob that complies with the minimatch syntax.
For example: 112 | 113 | ``` 114 | # The following rule excludes all HTML files from the root. 115 | *.html 116 | 117 | # The following rule excludes all files whose names consist of six characters, starting with index, and that are located in the root. 118 | # For example: index1.html, index2.js, etc. 119 | index?.* 120 | ``` 121 | 122 | For more information about glob syntax, see Glob in the Linux Programmer's Manual.
For more information about minimatch syntax, see Comparisons to other fnmatch/glob implementations. 123 | * File paths must be relative to the location of `.abignore` and must be in the following format: `directory/subdirectory/file`.
For example: 124 | 125 | ``` 126 | # The following rule excludes the views directory, its subdirectories and their contents. 127 | views/**/* 128 | 129 | # The following rule excludes the build.js file located in the scripts subdirectory. 130 | scripts/build.js 131 | ``` 132 | * To include or exclude a build configuration-specific file, reference the configuration-specific file.
For example: 133 | 134 | ``` 135 | # The following rule excludes the main.debug.js file located in the scripts subdirectory. 136 | scripts/main.debug.js 137 | ``` 138 | 139 | For more information about configuration-specific files in AppBuilder, see [Managing Configuration-Specific Files](http://docs.telerik.com/platform/appbuilder/build-configurations/configuration-specific-files). 140 | * Preserve the casing of file paths to ensure that your `.abignore` file works across Windows, OS X, and Linux. 141 | * To introduce an include rule, place an exclamation mark (`!`) before the rule.
For example: 142 | 143 | ``` 144 | # The following rule excludes all HTML files located in the root except for index.html. 145 | *.html 146 | !index.html 147 | ``` 148 | * To refer to files and subdirectories whose names contain an exclamation mark (`!`) or a hash (`#`), place a backslash (`\`) before the exclamation mark or the hash.
For example: 149 | 150 | ``` 151 | # The following rule excludes the !name.js file located in the root. 152 | \!name.js 153 | 154 | # The following rule includes the #cordova.js file located in the root. 155 | !\#cordova.js 156 | ``` 157 | 158 | ## Sample .abignore 159 | 160 | This is the markup of a sample `.abignore` file. This sample is based on the default `.abignore` file included in projects created with AppBuilder 2.6 or later. 161 | 162 | ``` 163 | # This file contains sample exclude and include rules for my application package. 164 | 165 | # The following rule excludes any .DS_Store files and __MACOSX subdirectories and their contents from your project. This rule is useful for projects developed on OS X systems or projects in which you have added files or subdirectories created on an OS X system. 166 | **/.DS_Store 167 | **/__MACOSX/**/* 168 | 169 | # The following rule excludes any Thumbs.db files from your projects. Thumbs.db is a thumbnails cache file managed by Windows. This rule is useful for projects developed on Windows systems or projects in which you have added files or subdirectories created on a Windows system. 170 | **/Thumbs.db 171 | 172 | # The following rule excludes .git subdirectories and their contents and the .gitignore file. This rule is useful for projects developed with Git version control. 173 | .git/**/* 174 | .gitignore 175 | 176 | # The following rule excludes the bin and obj subdirectories. This rule is useful for projects developed with or migrated from Microsoft Visual Studio. 177 | bin/**/* 178 | obj/**/* 179 | 180 | # The following rule excludes all files with a selected name, located anywhere in your project. For example, views/my_views/my_page.html. 181 | **/my_page.html 182 | 183 | # The following rule excludes all files that begin with a selected prefix. For example, the test prefix. 184 | **/test*.* 185 | 186 | # The following rule excludes all files that end in a selected suffix. For example, the debug suffix. 187 | **/*debug.* 188 | 189 | # The following rule excludes all files with a selected extension. For example, Windows PowerShell scripts. 190 | **/*.ps1 191 | 192 | ``` 193 | 194 | ## Troubleshooting 195 | 196 | Between AppBuilder 2.6 and 2.7.3, the default `.abignore` file contained exclude rules with incorrect syntax. If you have created your project with an AppBuilder version between 2.6 and 2.7.3, you need to manually replace the contents of your default `.abignore` file with the following markup. 197 | 198 | ``` 199 | # .abignore lets you configure which of your files and folders should be excluded from your application package during the build process. 200 | # Each project created with AppBuilder 2.6 or later contains a default .abignore which lists a number of system files and folders that might affect the size of your app or might prevent build operations from completing successfully. 201 | # 202 | # For more information about .abignore and how to write exclude and include rules for your projects, see http://docs.telerik.com/platform/appbuilder/testing-your-app/abignore 203 | 204 | # Windows files 205 | **/Thumbs.db 206 | 207 | # Mac OS files 208 | **/.DS_Store 209 | **/__MACOSX/**/* 210 | 211 | # Visual Studio files 212 | bin/**/* 213 | obj/**/* 214 | **/*.obj 215 | **/*.pdb 216 | **/*.user 217 | **/*.aps 218 | **/*.pch 219 | **/*.vspscc 220 | **/*_i.c 221 | **/*_p.c 222 | **/*.ncb 223 | **/*.suo 224 | **/*.tlb 225 | **/*.tlh 226 | **/*.ilk 227 | **/*.lib 228 | **/*.sbr 229 | 230 | # Source control files 231 | .gitignore 232 | .git/**/* 233 | 234 | # AppBuilder files 235 | .abignore 236 | .ab/**/* 237 | .app.json 238 | 239 | # TypeScript files 240 | **/*.ts 241 | **/*.map 242 | 243 | # Other 244 | **/*.bak 245 | **/*.cache 246 | **/*.log 247 | ``` 248 | -------------------------------------------------------------------------------- /BuildPackage.cmd: -------------------------------------------------------------------------------- 1 | call "c:\Program Files (x86)\nodejs\nodevars.bat" 2 | call npm.cmd install -g grunt-cli 3 | 4 | set APPBUILDER_SKIP_POSTINSTALL_TASKS=1 5 | call npm.cmd install 6 | set APPBUILDER_SKIP_POSTINSTALL_TASKS= 7 | 8 | call grunt.cmd pack --no-color 9 | 10 | call npm.cmd cache rm appbuilder 11 | call npm.cmd install -g rimraf 12 | call rimraf.cmd node_modules 13 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contribute to the Progress Telerik AppBuilder Command-Line Interface 2 | === 3 | 4 | *Help us improve the AppBuilder CLI* 5 | 6 | [![Telerik AppBuilder](https://raw.github.com/Icenium/icenium-cli/release/ab-logo.png "Telerik AppBuilder")](http://www.telerik.com/appbuilder "The Telerik AppBuilder web site") 7 | 8 | The AppBuilder CLI lets you build, test, deploy, and publish hybrid mobile apps for iOS, Android, and Windows Phone 8 from your favorite IDE or code editor. You can develop your projects locally from the convenience of your favorite code editor and run the command-line to test, build, deploy in the simulator or on devices, and publish your applications to the App Store or Google Play. 9 | 10 | * [Report an Issue](#bug "Learn how to report an issue") 11 | * [Request a Feature](#request "Learn how to submit a feature or improvement request") 12 | * [Contribute to the Code Base](#contribute "Learn how to submit your own improvements to the code") 13 | 14 | Report an Issue 15 | === 16 | If you find a bug in the source code or a mistake in the documentation, you can submit an issue to our GitHub Repository. 17 | Before you submit your issue, search the archive to check if a similar issues has been logged or addressed. This will let us focus on fixing issues and adding new features. 18 | If your issue appears to be a bug, and hasn't been reported, open a new issue. To help us investigate your issue and respond in a timely manner, you can provide is with the following details. 19 | 20 | * **Overview of the issue:** Provide a short description of the visible symptoms. If applicable, include error messages, screen shots, and stack traces. 21 | * **Motivation for or use case:** Let us know how this particular issue affects your work. 22 | * **Telerik AppBuilder version(s):** List the current version and build number of the CLI interface. You can get it by running `$ appbuilder --version`. Let us know if you have not observed this behavior in earlier versions and if you consider it a regression. 23 | * **System configuration:** Provide us with relevant system configuration information such as operating system, network connection, proxy usage, etc. Let us know if you have been able to reproduce the issue on multiple setups. 24 | * **Steps to reproduce:** If applicable, submit a step-by-step walkthrough of how to reproduce the issue. 25 | * **Related issues:** If you discover a similar issue in our archive, give us a heads up - it might help us identify the culprit. 26 | * **Suggest a fix:** You are welcome to suggest a bug fix or pinpoint the line of code or the commit that you believe has introduced the issue. 27 | 28 | [Back to Top][1] 29 | 30 | Request a Feature 31 | === 32 | You can request a new feature by submitting an issue with the *enhancement* label to our GitHub Repository. 33 | If you want to implement a new feature yourself, consider submitting it to the GitHub Repository as a Pull Request. 34 | 35 | [Back to Top][1] 36 | 37 | Contribute to the Code Base 38 | === 39 | First, read our developers documentation. 40 | 41 | Before you submit a Pull Request, consider the following guidelines. 42 | 43 | * Search GitHub for an open or closed Pull Request that relates to your submission. 44 | * Clone the repository. 45 | ```bash 46 | git clone git@github.com:Icenium/icenium-cli.git 47 | ``` 48 | * Initialize the submodule. 49 | ```bash 50 | git submodule init 51 | ``` 52 | * Fetch data from the submodule. 53 | ```bash 54 | git submodule update 55 | ``` 56 | * Make your changes in a new `git` branch. We use the Gitflow branching model so you will have to branch from our master branch. 57 | ```bash 58 | git checkout -b my-fix-branch master 59 | ``` 60 | * Create your patch and include appropriate test cases. 61 | * Build your changes locally. 62 | ```bash 63 | grunt 64 | ``` 65 | * Ensure all the tests pass. 66 | ```bash 67 | grunt ts:devall 68 | npm test 69 | ``` 70 | * Commit your changes and create a descriptive commit message (the commit message is used to generate release notes). 71 | ```bash 72 | git commit -a 73 | ``` 74 | * Push your branch to GitHub. 75 | ```bash 76 | git push origin my-fix-branch 77 | ``` 78 | * In GitHub, send a Pull Request to icenium-cli:master. 79 | * If we suggest changes, you can modify your branch, rebase, and force a new push to your GitHub repository to update the Pull Request. 80 | ```bash 81 | git rebase master -i 82 | git push -f 83 | ``` 84 | 85 | That's it! Thank you for your contribution! 86 | 87 | When the patch is reviewed and merged, you can safely delete your branch and pull the changes from the main (upstream) repository. 88 | 89 | * Delete the remote branch on GitHub. 90 | ```bash 91 | git push origin --delete my-fix-branch 92 | ``` 93 | * Check out the master branch. 94 | ```bash 95 | git checkout master -f 96 | ``` 97 | * Delete the local branch. 98 | ```bash 99 | git branch -D my-fix-branch 100 | ``` 101 | * Update your master branch with the latest upstream version. 102 | ``` 103 | git pull --ff upstream master 104 | ``` 105 | 106 | [Back to Top][1] 107 | 108 | [1]: #contribute-to-the-telerik-appbuilder-command-line-interface 109 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | var os = require("os"); 2 | 3 | var now = new Date().toISOString(); 4 | 5 | function shallowCopy(obj) { 6 | var result = {}; 7 | Object.keys(obj).forEach(function (key) { 8 | result[key] = obj[key]; 9 | }); 10 | return result; 11 | } 12 | 13 | function getBuildVersion(version) { 14 | var buildVersion = version !== undefined ? version : process.env["BUILD_NUMBER"]; 15 | if (process.env["BUILD_CAUSE_GHPRBCAUSE"]) { 16 | buildVersion = "PR" + buildVersion; 17 | } 18 | 19 | return buildVersion; 20 | } 21 | 22 | module.exports = function (grunt) { 23 | 24 | // Windows cmd does not accept paths with / and unix shell does not accept paths with \\ and we need to execute from a sub-dir. 25 | // To circumvent the issue, hack our environment's PATH and let the OS deal with it, which in practice works 26 | process.env.path = process.env.path + (os.platform() === "win32" ? ";" : ":") + "node_modules/.bin"; 27 | 28 | var isPackageJsonModified = false; 29 | 30 | var defaultEnvironment = "sit"; 31 | // When there are node_modules inside lib\common directory, CLI behaves incorrectly, so delete this dir. 32 | grunt.initConfig({ 33 | deploymentEnvironment: process.env["DeploymentEnvironment"] || defaultEnvironment, 34 | resourceDownloadEnvironment: process.env["ResourceDownloadEnvironment"] || defaultEnvironment, 35 | jobName: process.env["JOB_NAME"] || defaultEnvironment, 36 | buildNumber: process.env["BUILD_NUMBER"] || "non-ci", 37 | dateString: now.substr(0, now.indexOf("T")), 38 | 39 | pkg: grunt.file.readJSON("package.json"), 40 | ts: { 41 | options: grunt.file.readJSON("tsconfig.json").compilerOptions, 42 | 43 | devlib: { 44 | src: ["lib/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], 45 | reference: "lib/.d.ts" 46 | }, 47 | 48 | devall: { 49 | src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!lib/common/test/.d.ts", "!lib/common/messages/**/*.ts"], 50 | reference: "lib/.d.ts" 51 | }, 52 | 53 | release_build: { 54 | src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], 55 | reference: "lib/.d.ts", 56 | options: { 57 | sourceMap: false, 58 | removeComments: true 59 | } 60 | } 61 | }, 62 | 63 | tslint: { 64 | build: { 65 | files: { 66 | src: ["lib/**/*.ts", "test/**/*.ts", "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts", "lib/common/test/unit-tests/**/*.ts", "definitions/**/*.ts", "!**/*.d.ts"] 67 | }, 68 | options: { 69 | configuration: grunt.file.readJSON("./tslint.json") 70 | } 71 | } 72 | }, 73 | 74 | watch: { 75 | devall: { 76 | files: ["lib/**/*.ts", 'test/**/*.ts', "!lib/common/node_modules/**/*.ts", "!lib/common/messages/**/*.ts"], 77 | tasks: ['ts:devall'], 78 | options: { 79 | atBegin: true, 80 | interrupt: true 81 | } 82 | } 83 | }, 84 | 85 | shell: { 86 | options: { 87 | stdout: true, 88 | stderr: true 89 | }, 90 | 91 | apply_resources_environment: { 92 | command: "node bin/appbuilder dev-config-apply <%= resourceDownloadEnvironment %>" 93 | }, 94 | 95 | prepare_resources: { 96 | command: "node bin/appbuilder dev-prepackage" 97 | }, 98 | 99 | apply_deployment_environment: { 100 | command: "node bin/appbuilder dev-config-apply <%= deploymentEnvironment %>" 101 | }, 102 | 103 | build_package: { 104 | command: "npm pack", 105 | options: { 106 | execOptions: { 107 | env: (function () { 108 | var env = shallowCopy(process.env); 109 | env["APPBUILDER_SKIP_POSTINSTALL_TASKS"] = "1"; 110 | return env; 111 | })() 112 | } 113 | } 114 | } 115 | }, 116 | 117 | clean: { 118 | src: ["test/**/*.js*", 119 | "lib/**/*.js*", 120 | "!test-scripts/**/*", 121 | "!lib/common/vendor/*.js", 122 | "!lib/hooks/**/*.js", 123 | "!lib/common/**/*.json", 124 | "!lib/common/Gruntfile.js", 125 | "!lib/common/node_modules/**/*", 126 | "!lib/common/hooks/**/*.js", 127 | "!lib/common/bin/*.js", 128 | "!lib/common/test-scripts/**/*", 129 | "!lib/common/scripts/**/*", 130 | "*.tgz"] 131 | } 132 | }); 133 | 134 | grunt.loadNpmTasks("grunt-contrib-clean"); 135 | grunt.loadNpmTasks("grunt-contrib-watch"); 136 | grunt.loadNpmTasks("grunt-shell"); 137 | grunt.loadNpmTasks("grunt-ts"); 138 | grunt.loadNpmTasks("grunt-tslint"); 139 | 140 | grunt.registerTask("set_package_version", function (version) { 141 | var buildVersion = getBuildVersion(version); 142 | var packageJson = grunt.file.readJSON("package.json"); 143 | packageJson.buildVersion = buildVersion; 144 | grunt.file.write("package.json", JSON.stringify(packageJson, null, " ")); 145 | }); 146 | 147 | grunt.registerTask("setBundleDependencies", function (version) { 148 | var buildVersion = getBuildVersion(version); 149 | var packageJson = grunt.file.readJSON("package.json"); 150 | packageJson.bundleDependencies = Object.keys(packageJson.dependencies); 151 | grunt.file.write("package.json", JSON.stringify(packageJson, null, " ")); 152 | }); 153 | 154 | grunt.registerTask("setPackageName", function (version) { 155 | var fs = require("fs"); 156 | var fileExtension = ".tgz"; 157 | var buildVersion = getBuildVersion(version); 158 | var packageJson = grunt.file.readJSON("package.json"); 159 | var oldFileName = packageJson.name + "-" + packageJson.version; 160 | var newFileName = oldFileName + "-" + buildVersion; 161 | fs.renameSync(oldFileName + fileExtension, newFileName + fileExtension); 162 | }); 163 | 164 | grunt.registerTask("delete_coverage_dir", function () { 165 | var done = this.async(); 166 | var rimraf = require("rimraf"); 167 | rimraf("coverage", function (err) { 168 | if (err) { 169 | console.log("Error while deleting coverage directory from the package."); 170 | done(false); 171 | } 172 | 173 | done(); 174 | }); 175 | }); 176 | 177 | grunt.registerTask("test", ["ts:devall"]); 178 | 179 | grunt.registerTask("remove_prepublish_script", function () { 180 | var packageJson = grunt.file.readJSON("package.json"); 181 | if (packageJson && packageJson.scripts && packageJson.scripts.prepublish) { 182 | delete packageJson.scripts.prepublish; 183 | grunt.file.write("package.json", JSON.stringify(packageJson, null, " ")); 184 | isPackageJsonModified = true; 185 | } 186 | }); 187 | 188 | grunt.registerTask("printPackageJsonWarning", function () { 189 | if (isPackageJsonModified) { 190 | require("colors"); 191 | console.log("NOTE: `grunt pack` command modified package.json. DO NOT COMMIT these changes, they are required only for the produced .tgz.".red.bold); 192 | } 193 | }); 194 | 195 | grunt.registerTask("pack", [ 196 | "clean", 197 | 198 | "ts:release_build", 199 | 200 | "remove_prepublish_script", 201 | 202 | "set_package_version", 203 | "delete_coverage_dir", 204 | "shell:build_package", 205 | "setPackageName", 206 | "printPackageJsonWarning" 207 | ]); 208 | grunt.registerTask("bundle-pack", ["setBundleDependencies", "pack"]); 209 | grunt.registerTask("lint", ["tslint:build"]); 210 | grunt.registerTask("all", ["clean", "test", "lint"]); 211 | grunt.registerTask("rebuild", ["clean", "ts:devlib"]); 212 | grunt.registerTask("default", "ts:devlib"); 213 | }; 214 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright (C) 2014-2018 Progress Software Corporation. All rights reserved. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![AppBuilder](https://raw.github.com/Icenium/icenium-cli/release/ab-logo.png "AppBuilder")](http://www.telerik.com/appbuilder "The AppBuilder web site") 2 | 3 |

The Telerik Platform product is retired as of May 10, 2018. For more information about the discontinuation and how you can recover your apps or data, see the full announcement.


4 | 5 |

Telerik recommends NativeScript Sidekick for developing modern, cross-platform mobile apps with web technologies like JavaScript, Angular, or Vue.js, and Kinvey for hosting critical business back-end in the cloud.


6 | -------------------------------------------------------------------------------- /ab-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Icenium/icenium-cli/9c5e03632989e58dfc0a67c4f201210d9b50c7a3/ab-logo.png -------------------------------------------------------------------------------- /bin/appbuilder: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | "use strict"; 4 | var versionValidator = require("../lib/version-validator"); 5 | var os = require("os"); 6 | 7 | function printRedText(message) { 8 | console.log(`\x1B[31;1m${message}\x1B[0m`) 9 | } 10 | 11 | function printYellowText(message) { 12 | console.log(`\x1B[33;1m${message}\x1B[0m`) 13 | } 14 | 15 | return versionValidator.ensureUpToDate() 16 | .then(() => { 17 | // Now print the information. 18 | printRedText("The Telerik Platform product is retired as of May 10, 2018. "); 19 | printRedText("For more information about the discontinuation and how you can recover your apps or data, please see the full announcement here: https://www.telerik.com/platform-next-level"); 20 | 21 | printYellowText(`${os.EOL}Telerik recommends NativeScript Sidekick (https://www.nativescript.org/nativescript-sidekick) for developing modern, cross-platform mobile apps with web technologies like JavaScript, Angular, or Vue.js, and Kinvey (https://www.kinvey.com/) for hosting critical business back-end in the cloud.`); 22 | process.exit(127); 23 | }); 24 | -------------------------------------------------------------------------------- /bin/appbuilder.cmd: -------------------------------------------------------------------------------- 1 | @node %~dp0\appbuilder %* -------------------------------------------------------------------------------- /bin/appbuilder.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require("./appbuilder"); -------------------------------------------------------------------------------- /for-developers.md: -------------------------------------------------------------------------------- 1 | icenium-cli 2 | =========== 3 | 4 | Cross-Platform Command Line Interface for Progress Telerik Platform AppBuilder. 5 | 6 | First steps 7 | === 8 | You must have Python 2.7.x installed. Don't install 3.x as it won't work! 9 | 10 | After cloning the repository, run: 11 | 12 | ``` 13 | $ npm install 14 | ``` 15 | 16 | This will install all project dependencies. 17 | 18 | It is a good idea to add the `bin\` folder to you path environment variable. 19 | If you do that, you'll get the `appbuilder` command in your path, 20 | and you won't have to type e.g. `node ..\..\bin\appbuilder` before every command. 21 | 22 | Life with TypeScript 23 | === 24 | Before everything else: run `$ npm install -g typescript` to install the compiler. 25 | 26 | Manual compiling: run `$ grunt` in the project root. 27 | 28 | Committing: you can commit only .ts files; .js files are git-ignore'd with a few special exceptions. 29 | 30 | WebStorm integration: enable the TypeScript File Watcher. Uncheck "Immediate file synchronization", 31 | check "Track root files only". The file watcher will continuously compile your .ts files and report 32 | any errors as they arise. If often hangs - simply restart WebStorm to fix it. If it "forgets" to recompile 33 | some change to a file and you need to e.g. debug your code, either make a dummy change to trigger a recompile 34 | or run `grunt`. 35 | 36 | You can run `grunt watch` in a separate console to have your .ts file continously recompiled. 37 | This approach can be better than using WebStorm, because it won't lag the IDE. 38 | 39 | Debugging 40 | === 41 | For the best experience, use WebStorm to debug TypeScript code. If you don't have WebStorm, read on. 42 | 43 | For debugging try using `node-inspector`. To install it run: 44 | 45 | ``` 46 | $ npm install -g node-inspector 47 | ``` 48 | 49 | Open a new node.js console, run `node-inspector` and leave it running. You don't need to ever restart it or anything. 50 | 51 | Start `node` with the `--debug-brk` parameter, e.g.: 52 | 53 | ``` 54 | $ node --debug-brk bin\appbuilder build Android 55 | ``` 56 | 57 | Open Chrome, open `127.0.0.1:8080/debug?port=5858` and start debugging. 58 | 59 | * Place breakpoints by clicking on the line number 60 | * Use F10 and F11 to step over and step into 61 | * Use F8 to continue (like F5 in VS) 62 | * If you need to place a breakpoint in a file that is not open, then use the navigator in the top-left corner to see all files in the project. 63 | 64 | Fiddler 65 | === 66 | To see your HTTP requests in Fiddler, open `config\config.json` and set the `PROXY_TO_FIDDLER` property to `true`. Don't commit it, though! You may commit Fiddler auto-detection, though :) 67 | 68 | Writing unit tests 69 | === 70 | To add a test for a new module, do the following: 71 | 72 | * add a test file to `test/`, e.g. `test/my-component.ts` 73 | * write the test using [mocha][1]'s BDD interface and [chai][3]'s [assertions][2] (preferably) 74 | 75 | To compile and run all unit tests, run the following in the console: 76 | 77 | ``` 78 | $ grunt ts:devall 79 | $ npm test 80 | ``` 81 | 82 | The first command compiles the tests, the second one runs them. 83 | 84 | Deploying to iOS 85 | === 86 | To deploy an application on iOS device, install iTunes. 87 | 88 | Enabling command auto-completion in Bash 89 | === 90 | You can enable command auto-completion for the Bash and zsh shells. Auto-completion for 91 | commands as well as options is supported. 92 | 93 | If you don't have `icenium-cli` installed with the `-g` option, you can install auto-completion using: 94 | 95 | ``` 96 | $ node bin/appbuilder completion >> ~/.bashrc 97 | ``` 98 | 99 | and you must also manually add it to the `PATH` environment variable. Open the `.bashrc` 100 | file in a text editor (in Windows: `$ start ~/.bashrc`) and add the following line anywhere: 101 | 102 | ``` 103 | export PATH=$PATH:/c/work/icenium-cli/bin 104 | ``` 105 | 106 | Change the path to the `icenium-cli` working copy above to match your own. Restart Bash and you're ready to go! 107 | 108 | Continuous integration 109 | === 110 | The CI task is located on the [Icenium Jenkins server](http://bpc15:8080/job/icenium-cli%20CI%20Build/). 111 | There you can see the status of the project and the test run results. 112 | 113 | After building the packaged module, it is copied to \\telerik.com\Resources\BlackDragon\Builds\appbuilder-cli 114 | 115 | Clean install for testing 116 | === 117 | Install prerequisites: 118 | * Node.js 32-bit - http://nodejs.org/dist/v0.10.25/node-v0.10.25-x86.msi 119 | * Android ADB USB Driver (skip this step if you have installed the Android SDK) - "R:\BlackDragon\Android\Universal ADB driver\UniversalAdbDriverSetup6.msi" 120 | 121 | Copy the .tgz file locally, as npm doesn't work with mapped drives. In any terminal: 122 | 123 | ``` 124 | $ npm i -g path/to/icenium-cli-0.1.0.tgz 125 | ``` 126 | 127 | Restart Git Bash and you're ready to roll. 128 | 129 | Developing the CLI on a Mac 130 | === 131 | The Ice server can run only on Windows. The steps below will enable you to connect 132 | a CLI running on your Mac to the Ice server running on the Windows VM. 133 | 134 | * Windows: run cmd, execute `ipconfig` and write down the IPv4 address 135 | * Mac: open terminal and execute `sudo pico /etc/hosts` 136 | * Mac: add the following line to the end of the file: `icetest.icenium.com 192.168.x.x` where the address is the Windows' IP 137 | * Mac: Ctrl+O, Enter, Ctrl-X 138 | * Windows: change the TFIS endpoint in your Ice Web.config to point to localtfis.telerik.com 139 | * Mac: change the AB_SERVER in config.json to point to icetest.icenium.com 140 | * Mac: login using your localtfis credentials (can be edited on integrationadmin.telerik.com) 141 | 142 | That's it. Don't forget that icetest.icenium.com will henceforth be clobbered on your Mac. 143 | 144 | [1]: http://visionmedia.github.io/mocha/#interfaces 145 | [2]: http://chaijs.com/api/assert/ 146 | [3]: http://chaijs.com/guide/styles/#assert 147 | -------------------------------------------------------------------------------- /icenium-cli.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "lib" 6 | }, 7 | { 8 | "path": "bin" 9 | }, 10 | { 11 | "path": "test" 12 | }, 13 | { 14 | "path": "resources" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /lib/declarations.d.ts: -------------------------------------------------------------------------------- 1 | interface IRejectUnauthorized { 2 | /** 3 | * Defines if NODE_TLS_REJECT_UNAUTHORIZED should be set to true or false. Default value is true. 4 | */ 5 | rejectUnauthorized: boolean; 6 | } 7 | 8 | /** 9 | * Proxy settings required for http request. 10 | */ 11 | interface IProxySettings extends IRejectUnauthorized { 12 | /** 13 | * Hostname of the machine used for proxy. 14 | */ 15 | hostname: string; 16 | 17 | /** 18 | * Port of the machine used for proxy that allows connections. 19 | */ 20 | port: string; 21 | 22 | /** 23 | * Protocol of the proxy - http or https 24 | */ 25 | protocol?: string; 26 | 27 | 28 | proxy?: string; 29 | } 30 | 31 | interface IVersionData { 32 | major: string; 33 | minor: string; 34 | patch: string; 35 | } 36 | -------------------------------------------------------------------------------- /lib/version-validator.ts: -------------------------------------------------------------------------------- 1 | import { join } from "path"; 2 | import { readFileSync } from "fs"; 3 | import { execSync } from "child_process"; 4 | import * as url from "url"; 5 | const _ = require("lodash"); 6 | import * as request from "request"; 7 | 8 | async function buildNpmRegistryUrl(packageName: string): Promise { 9 | let registryUrl = await getNpmRegistryUrl(); 10 | if (!_.endsWith(registryUrl, "/")) { 11 | registryUrl += "/"; 12 | } 13 | 14 | return `${registryUrl}${packageName.replace("/", "%2F")}`; 15 | } 16 | 17 | async function getNpmRegistryUrl(): Promise { 18 | let currentNpmRegistry: string; 19 | 20 | try { 21 | currentNpmRegistry = (execSync("npm config get registry") || "").toString().trim(); 22 | } catch (err) { 23 | console.warn(`Unable to get current npm registry. Error is: ${err}`); 24 | } 25 | 26 | return currentNpmRegistry || "http://registry.npmjs.org"; 27 | } 28 | 29 | function toBoolean(str: any): boolean { 30 | return !!(str && str.toString && str.toString().toLowerCase() === "true"); 31 | } 32 | 33 | async function getNpmProxySettings(): Promise { 34 | try { 35 | const npmProxy = (execSync("npm config get proxy") || "").toString().trim(); 36 | 37 | // npm will return null as string in case there's no proxy set. 38 | if (npmProxy && npmProxy !== "null") { 39 | const strictSslString = (execSync("npm config get strict-ssl") || "").toString().trim(); 40 | const uri = url.parse(npmProxy); 41 | return { 42 | hostname: uri.hostname, 43 | port: uri.port, 44 | rejectUnauthorized: toBoolean(strictSslString) 45 | }; 46 | } 47 | } catch (err) { 48 | console.warn(`Unable to get npm proxy configuration. Error is: ${err.message}`); 49 | this.$logger.trace(`Unable to get npm proxy configuration. Error is: ${err.message}.`); 50 | } 51 | 52 | return null; 53 | } 54 | 55 | async function getPackageJsonFromNpmRegistry(packageName: string, version?: string): Promise { 56 | let packageJsonContent: any; 57 | version = version || "latest"; 58 | try { 59 | const url = await buildNpmRegistryUrl(packageName); 60 | 61 | const options: any = { 62 | url, 63 | encoding: null, 64 | followAllRedirects: true, 65 | timeout: 5000 66 | }; 67 | 68 | const proxySettings = await getNpmProxySettings(); 69 | if (proxySettings) { 70 | const proto = proxySettings && proxySettings.protocol || "http:"; 71 | const host = proxySettings && proxySettings.hostname; 72 | const port = proxySettings && proxySettings.port; 73 | 74 | // Note that proto ends with : 75 | options.proxy = `${proto}//${host}:${port}`; 76 | options.rejectUnauthorized = proxySettings ? proxySettings.rejectUnauthorized : true; 77 | } 78 | 79 | const result = await new Promise((resolve, reject) => { 80 | 81 | request.get(options, (error: Error, response: any, body: any) => { 82 | if (error) { 83 | reject(error); 84 | } 85 | 86 | resolve(body.toString()); 87 | }); 88 | }); 89 | 90 | // This call will return error with message '{}' in case there's no such package. 91 | const fullData = JSON.parse(result.toString()); 92 | const distTags = fullData["dist-tags"]; 93 | const versions = fullData.versions; 94 | 95 | // check if passed version is in fact tag (for example latest, next, etc.) In this case - get the real version. 96 | _.each(distTags, (ver: string, tagName: string) => { 97 | if (tagName === version) { 98 | version = ver; 99 | return false; 100 | } 101 | }); 102 | 103 | packageJsonContent = versions[version]; 104 | } catch (err) { 105 | console.warn(`Unable to get package.json from npm registry. Error is: ${err}`); 106 | } 107 | 108 | return packageJsonContent; 109 | } 110 | 111 | async function getInformationFromRegistry(): Promise { 112 | const packageJson = await getPackageJsonFromNpmRegistry("appbuilder"); 113 | 114 | if (!packageJson) { 115 | throw new Error("Unable to get information from registry."); 116 | } 117 | 118 | return packageJson.version; 119 | } 120 | 121 | function versionCompare(version1: string | IVersionData, version2: string | IVersionData): number { 122 | let v1array = getVersionArray(version1), 123 | v2array = getVersionArray(version2); 124 | 125 | if (v1array.length !== v2array.length) { 126 | throw new Error("Version strings are not in the same format"); 127 | } 128 | 129 | for (let i = 0; i < v1array.length; ++i) { 130 | if (v1array[i] !== v2array[i]) { 131 | return v1array[i] > v2array[i] ? 1 : -1; 132 | } 133 | } 134 | 135 | return 0; 136 | } 137 | 138 | function getVersionArray(version: string | IVersionData): number[] { 139 | let result: number[] = [], 140 | parseLambda = (x: string) => parseInt(x, 10), 141 | filterLambda = (x: number) => !isNaN(x); 142 | 143 | if (typeof version === "string") { 144 | let versionString = version.split("-")[0]; 145 | result = _.map(versionString.split("."), parseLambda); 146 | } else { 147 | result = _(version).map(parseLambda).filter(filterLambda).value(); 148 | } 149 | 150 | return result; 151 | } 152 | 153 | async function ensureUpToDate(): Promise { 154 | let latestVersion: string; 155 | 156 | try { 157 | latestVersion = await getInformationFromRegistry(); 158 | } catch (error) { 159 | console.warn("Failed to retrieve AppBuilder version from npm. Make sure you are running latest version of AppBuilder CLI."); 160 | } 161 | 162 | const pathToPackageJson = join(__dirname, "..", "package.json"); 163 | const packageJsonContent = readFileSync(pathToPackageJson).toString(); 164 | const currentVersion = JSON.parse(packageJsonContent).version; 165 | if (latestVersion && versionCompare(latestVersion, currentVersion) > 0) { 166 | console.error("You are running an outdated version of the Telerik AppBuilder CLI. To run this command, you need to update to the latest version of the Telerik AppBuilder CLI. To update now, run 'npm install -g appbuilder'."); 167 | } 168 | } 169 | 170 | module.exports.ensureUpToDate = ensureUpToDate; 171 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appbuilder", 3 | "preferGlobal": true, 4 | "version": "3.7.9", 5 | "author": "Telerik ", 6 | "description": "command line interface to Telerik AppBuilder", 7 | "bin": { 8 | "appbuilder": "./bin/appbuilder" 9 | }, 10 | "scripts": { 11 | "prepublish": "node prepublish.js" 12 | }, 13 | "main": "./bin/appbuilder", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/Icenium/icenium-cli.git" 17 | }, 18 | "keywords": [ 19 | "cordova", 20 | "appbuilder", 21 | "telerik", 22 | "progress", 23 | "mobile", 24 | "nativescript" 25 | ], 26 | "dependencies": { 27 | "lodash": "4.13.1", 28 | "request": "2.81.0" 29 | }, 30 | "analyze": true, 31 | "devDependencies": { 32 | "@types/node": "6.0.61", 33 | "@types/request": "0.0.42", 34 | "chai": "3.5.0", 35 | "chai-as-promised": "6.0.0", 36 | "colors": "1.2.4", 37 | "file": "0.2.2", 38 | "grunt": "1.0.1", 39 | "grunt-contrib-clean": "1.0.0", 40 | "grunt-contrib-watch": "1.0.0", 41 | "grunt-shell": "2.1.0", 42 | "grunt-ts": "6.0.0-beta.10", 43 | "grunt-tslint": "4.0.0", 44 | "rimraf": "2.6.2", 45 | "spec-xunit-file": "0.0.1-3", 46 | "tslint": "4.3.1", 47 | "typescript": "2.1.4" 48 | }, 49 | "bundledDependencies": [], 50 | "license": "Apache-2.0", 51 | "engines": { 52 | "node": ">=6.0.0 <9.0.0" 53 | } 54 | } -------------------------------------------------------------------------------- /prepublish.js: -------------------------------------------------------------------------------- 1 | var skipPostinstallTasks = process.env["APPBUILDER_SKIP_POSTINSTALL_TASKS"]; 2 | if (skipPostinstallTasks) { 3 | return; 4 | } 5 | 6 | var fs = require("fs"), 7 | path = require("path"), 8 | child_process = require("child_process"); 9 | 10 | function invokeGrunt(callback) { 11 | if (!fs.existsSync("lib/version-validator.js")) { 12 | var grunt = require("grunt"); 13 | grunt.cli.tasks = ["ts:devall"]; 14 | grunt.cli(null, callback); 15 | } else { 16 | process.nextTick(callback); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /publish.cmd: -------------------------------------------------------------------------------- 1 | 2 | @if "%1" == "" goto error 3 | @if "%2" == "" goto error 4 | 5 | @for /f "delims=. tokens=1-3" %%a in ( "%2" ) do (set major=%%a && set minor=%%b && set revision=%%c) 6 | 7 | @if not defined revision goto error 8 | @if not defined minor goto error 9 | @if not defined major goto error 10 | 11 | git fetch 12 | git tag -a v%2 -m "Telerik AppBuilder %2" remotes/origin/release 13 | git push origin v%2 14 | 15 | npm publish "%1" 16 | @goto :EOF 17 | 18 | :error 19 | @echo Sample usage: publish appbuilder.tgz 1.2.3 20 | @echo Version string must be in Major.Minor.Revision format 21 | -------------------------------------------------------------------------------- /test.cmd: -------------------------------------------------------------------------------- 1 | grunt ts:devall && npm test 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "removeComments": false, 8 | "noImplicitAny": true, 9 | "experimentalDecorators": true, 10 | "noUnusedLocals": true, 11 | "alwaysStrict": true 12 | }, 13 | "exclude": [ 14 | "node_modules", 15 | "scratch", 16 | "coverage" 17 | ] 18 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "curly": true, 5 | "eofline": true, 6 | "indent": [ 7 | true, 8 | "tabs" 9 | ], 10 | "interface-name": true, 11 | "jsdoc-format": true, 12 | "max-line-length": [ 13 | false, 14 | 140 15 | ], 16 | "no-consecutive-blank-lines": true, 17 | "no-construct": true, 18 | "no-debugger": true, 19 | "no-duplicate-variable": true, 20 | "no-shadowed-variable": true, 21 | "no-empty": true, 22 | "no-eval": true, 23 | "no-switch-case-fall-through": true, 24 | "no-trailing-whitespace": true, 25 | "no-unused-expression": true, 26 | "no-use-before-declare": true, 27 | "no-var-keyword": true, 28 | "no-var-requires": false, 29 | "one-line": [ 30 | true, 31 | "check-catch", 32 | "check-finally", 33 | "check-else", 34 | "check-open-brace", 35 | "check-whitespace" 36 | ], 37 | "quotemark": [ 38 | false, 39 | "double" 40 | ], 41 | "semicolon": true, 42 | "space-before-function-paren": false, 43 | "switch-default": false, 44 | "trailing-comma": [ 45 | false, 46 | { 47 | "multiline": "always", 48 | "singleline": "always" 49 | } 50 | ], 51 | "triple-equals": [ 52 | true, 53 | "allow-null-check" 54 | ], 55 | "typeof-compare": true, 56 | "use-isnan": true, 57 | "variable-name": [ 58 | true, 59 | "ban-keywords", 60 | "allow-leading-underscore" 61 | ], 62 | "whitespace": [ 63 | true, 64 | "check-branch", 65 | "check-decl", 66 | "check-operator", 67 | "check-module", 68 | "check-separator" 69 | ] 70 | } 71 | } --------------------------------------------------------------------------------