You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2019/04/28 22:33:57 UTC

[cordova-docs] 01/01: Create project-structure.md

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-extract_project_structure_from_cli
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git

commit 4245bccd58408805afbdd8f2b2d4fa1cdd30b7b7
Author: Jan Piotrowski <pi...@gmail.com>
AuthorDate: Mon Apr 29 00:33:51 2019 +0200

    Create project-structure.md
---
 .../en/dev/guide/overview/project-structure.md     | 95 ++++++++++++++++++++++
 1 file changed, 95 insertions(+)

diff --git a/www/docs/en/dev/guide/overview/project-structure.md b/www/docs/en/dev/guide/overview/project-structure.md
new file mode 100644
index 0000000..666f9b8
--- /dev/null
+++ b/www/docs/en/dev/guide/overview/project-structure.md
@@ -0,0 +1,95 @@
+---
+license: >
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+title: Architectural overview of Cordova platform
+toc_title: Overview
+description: Start here if you are new to Cordova. Includes installation and next steps.
+---
+
+# Project Structure
+
+## CLI project directory structure
+
+Cordova CLI works with the following directory structure:
+
+```
+myapp/
+|-- package.json
+|-- config.xml
+|-- hooks/
+|-- merges/
+| | |-- android/
+| | |-- windows/
+| | |-- ios/
+|-- www/
+|-- platforms/
+| |-- android/
+| |-- windows/
+| |-- ios/
+|-- plugins/
+  |--cordova-plugin-camera/
+```
+
+### `package.json`
+
+TODO 
+
+### `config.xml`
+
+Configures your application and allows you to customize the behavior of your project. See also [config.xml reference documentation][config.xml ref]
+
+### `www/`
+
+Contains the project's web artifacts, such as .html, .css and .js files. As a cordova application developer, most of your code and assets will go here. They will be copied on a `cordova prepare` to each platform's www directory. The www source directory is reproduced within each platform's subdirectory, appearing for example in `platforms/ios/www` or `platforms/android/assets/www`. Because the CLI constantly copies over files from the source www folder, you should only edit these files a [...]
+
+### `platforms/`
+
+Contains all the source code and build scripts for the platforms that you add to your project.
+
+> **WARNING:** When using the CLI to build your application, you should not edit any files in the /platforms/ directory unless you know what you are doing, or if documentation specifies otherwise. The files in this directory are routinely overwritten when preparing applications for building, or when plugins are re-installed.
+
+### `plugins/`
+
+Any added plugins will be extracted or copied into this directory.
+
+### `hooks/`
+
+This directory may contains scripts used to customize cordova-cli commands. Any scripts you add to these directories will be executed before and after the commands corresponding to the directory name. Useful for integrating your own build systems or integrating with version control systems.
+
+Refer to [Hooks Guide] for more information.
+
+### `merges/`
+
+Platform-specific web assets (HTML, CSS and JavaScript files) are contained within appropriate subfolders in this directory. These are deployed during a `prepare` to the appropriate native directory.  Files placed under `merges/` will override matching files in the `www/` folder for the relevant platform. A quick example, assuming a project structure of:
+
+```
+merges/
+|-- ios/
+| -- app.js
+|-- android/
+| -- android.js
+www/
+-- app.js
+```
+
+After building the Android and iOS projects, the Android application will contain both `app.js` and `android.js`. However, the iOS application will only contain an `app.js`, and it will be the one from `merges/ios/app.js`, overriding the "common" `app.js` located inside `www/`.
+
+### Version control
+
+It is recommended not to check in `platforms/` and `plugins/` directories into version control as they are considered a build artifact. Your platforms and plugins will be saved in config.xml & package.json automatically. These platforms/plugins will be downloaded when `cordova prepare` is invoked.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org