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

harbs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new e948ef1  Added library-basics
e948ef1 is described below

commit e948ef1ccaeb341d9894d22b617f5e3e70dfc220
Author: Harbs <[email protected]>
AuthorDate: Mon Dec 13 14:45:07 2021 +0200

    Added library-basics
---
 _data/toc.json              |  3 +++
 frameworks-and-libraries.md |  2 ++
 libraries/library-basics.md | 57 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)

diff --git a/_data/toc.json b/_data/toc.json
index 408db8f..baaf57a 100644
--- a/_data/toc.json
+++ b/_data/toc.json
@@ -165,6 +165,9 @@
             "path": "frameworks-and-libraries.md",
             "children": [
                 {
+                    "path": "libraries/library-basics.md"
+                },
+                {
                     "path": "libraries/crux.md",
                     "children": [
                         {
diff --git a/frameworks-and-libraries.md b/frameworks-and-libraries.md
index 2fabeae..a8d9884 100644
--- a/frameworks-and-libraries.md
+++ b/frameworks-and-libraries.md
@@ -26,6 +26,8 @@ Pre-written sets of code which allows for easier development 
of Royale-based app
 
 Frameworks provide reliable templates to help you develop complex projects 
more easily and sustainably. Libraries are generally collections of modules and 
functions that focus on a particular task or theme--you might find a library to 
help you with scientific calculations, and another library for manipulating 
graphics.
 
+## Library Basics
+Are you new to Royale libraries? [Read what they are and how to use 
them.](libraries/library-basics) 
 ## Frameworks
 Apache Royale itself is a framework. It can play well with other frameworks to 
help simplify development, especially when many people are working on the same 
project.
 
diff --git a/libraries/library-basics.md b/libraries/library-basics.md
new file mode 100644
index 0000000..fc3c3ab
--- /dev/null
+++ b/libraries/library-basics.md
@@ -0,0 +1,57 @@
+---
+# 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.
+
+layout: docpage
+title: Library Basics
+description: What are libraries in Royale
+permalink: /libraries/library-basics
+---
+
+# Royale Libraries
+
+A bit about Royale libraries. What they are, how to use them and how to create 
them.
+
+Royale libraries are packaged in `swc` files. A `swc` file is a zipped archive 
which contains the following:
+1. A `catalog.xml` which describes what is in the archive.
+2. A `library.swf` file which is binary representation of the code structure 
in Flash format. This is read by the compiler to determine type information and 
code flow.
+3. Optionally, a `js` folder which contains compiled javascript code which can 
be run by a javascript runtime
+
+## Types of Libraries
+There are two basic library types:
+1. Compiled Code Libraries
+2. Typedef libraries
+
+There is no obvious way to tell the difference. Both have a `.swc` extension, 
although typedef libraries will not have any `js` code included and will 
generally be smaller.
+
+### Compiled Code Libraries
+Compiled code libraries are libraries which contain code that will end up in 
your compiled application (assuming you use that code). These can be code that 
you might use internally across multiple projects, or it can be a library that 
was compiled by someone else. Much of the Royale framework is compiled into 
`swc` files that are used in applications.
+
+Compiled code libraries are created using the `compc` compiler. (TODO add 
sample configs for doing this)
+
+### Typedef libraries
+Typedef libraries are libraries which define the types of different classes, 
but contain no code that would be added to an application. Typedef libraries 
are used for core Web APIs and third party javascript libraries which could be 
included in applications as separate javascript files (such as jQuery). Typedef 
libraries are similar to Typescript `d.ts` files.
+
+Typedef libraries are created using the `externc` compiler. (TODO add sample 
configs for doing this)
+
+For completeness sake: There's a third class of libraries which you would 
generally not need to deal with. That's the GCL library included in Royale. It 
has the type definitions for Google Closure Library, but the actual code that 
might be used comes from the Google Closure Library javascript files. (TODO -- 
edit this for accuracy)
+
+## Using SWC Libraries
+
+To use `swc` libraries, you include the `swc` file in your project. Royale 
framework `swc`s are made available automatically, but you can include any 
`swc` you want by adding the file. To use compiled code libraries, you should 
specify the containing folder using `library-path` and/or `js-library-path`. 
(TODO add links to compiler arguments)
+
+## Creating SWC Libraries
+
+TODO fill this out
\ No newline at end of file

Reply via email to