You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/08/22 15:12:56 UTC

[royale-asjs] branch develop updated: adding FontIcon support for IDEs?

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

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new e1fa31e  adding FontIcon support for IDEs?
e1fa31e is described below

commit e1fa31e83ae611148e909b34df38f821a47b900e
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed Aug 22 17:12:50 2018 +0200

    adding FontIcon support for IDEs?
---
 distribution/pom.xml                               |  13 +++
 distribution/src/main/assembly/component.xml       |   5 +
 frameworks/js/projects/IconsJS/build.xml           | 124 +++++++++++++++++++++
 .../IconsJS/src/main/config/compile-js-config.xml  |  96 ++++++++++++++++
 frameworks/projects/Icons/pom.xml                  |  14 ---
 5 files changed, 238 insertions(+), 14 deletions(-)

diff --git a/distribution/pom.xml b/distribution/pom.xml
index f898e9c..544912e 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -200,6 +200,12 @@
     </dependency>
     <dependency>
       <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Icons</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
       <artifactId>Reflection</artifactId>
       <version>0.9.3-SNAPSHOT</version>
       <type>swc</type>
@@ -366,6 +372,13 @@
     </dependency>
     <dependency>
       <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Icons</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
       <artifactId>Reflection</artifactId>
       <version>0.9.3-SNAPSHOT</version>
       <type>swc</type>
diff --git a/distribution/src/main/assembly/component.xml b/distribution/src/main/assembly/component.xml
index 73c5c65..fe58b96 100644
--- a/distribution/src/main/assembly/component.xml
+++ b/distribution/src/main/assembly/component.xml
@@ -310,6 +310,11 @@ under the License.
       <destName>basic-manifest-network.xml</destName>
     </file>
     <file>
+      <source>../frameworks/projects/Icons/src/main/resources/icons-manifest.xml</source>
+      <outputDirectory>frameworks/manifests</outputDirectory>
+      <destName>basic-manifest-icons.xml</destName>
+    </file>
+    <file>
       <source>../frameworks/projects/Storage/src/main/resources/basic-manifest.xml</source>
       <outputDirectory>frameworks/manifests</outputDirectory>
       <destName>basic-manifest-storage.xml</destName>
diff --git a/frameworks/js/projects/IconsJS/build.xml b/frameworks/js/projects/IconsJS/build.xml
new file mode 100644
index 0000000..fba5946
--- /dev/null
+++ b/frameworks/js/projects/IconsJS/build.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0"?>
+<!--
+
+  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.
+
+-->
+
+
+<project name="IconsJS" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../../.."/>
+    
+    <property file="${ROYALE_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${ROYALE_HOME}/build.properties"/>
+    <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+    
+    <property name="target.name" value="${ant.project.name}.swc" />
+    <echo file="${basedir}/${target.name}.properties">target.name.nojs=${ant.project.name}</echo>
+    <replaceregexp file="${basedir}/${target.name}.properties" match="(.*)JS$" replace="\1" flags="m" />
+    <property file="${basedir}/${target.name}.properties"/>
+    <delete file="${basedir}/${target.name}.properties"/>
+    
+    <target name="main" depends="clean,check-compiler,compile" description="Full build of ${ant.project.name}.swc">
+    </target>
+    
+    <target name="clean">
+        <delete failonerror="false">
+            <fileset dir="${ROYALE_HOME}/frameworks/js/libs">
+                <include name="${target.name}"/>
+            </fileset>
+        </delete>
+        <delete failonerror="false" includeemptydirs="true">
+            <fileset dir="${basedir}/target">
+                <include name="**/**"/>
+            </fileset>
+        </delete>
+    </target>
+    
+    <target name="compile" depends="check-compiler">
+        <echo message="Cross-compiling ${target.name}"/>
+        <echo message="ROYALE_COMPILER_HOME: ${ROYALE_COMPILER_HOME}"/>
+        <mkdir dir="${basedir}/target/generated-sources/royale"/>
+        <java jar="${ROYALE_COMPILER_HOME}/lib/compc.jar" fork="true" >
+            <jvmarg value="-Xmx384m" />
+            <jvmarg value="-Dsun.io.useCanonCaches=false" />
+            <jvmarg value="-Droyalelib=${ROYALE_HOME}/frameworks" />
+            <arg value="+royalelib=${ROYALE_HOME}/frameworks" />
+            <arg value="-compiler.strict-xml=true" />
+            <arg value="-compiler.targets=SWF,JSRoyale" />
+            <arg value="-output=${basedir}/target/${target.name}" />
+            <arg value="-load-config=${ROYALE_HOME}/frameworks/js-config.xml" />
+            <arg value="-load-config+=${basedir}/src/main/config/compile-js-config.xml" />
+        </java>
+        <copy file="${basedir}/target/${target.name}" tofile="${ROYALE_HOME}/frameworks/js/libs/${target.name}" />
+    </target>
+    
+    <target name="copy-js" >
+        <mkdir dir="${ROYALE_HOME}/frameworks/js/generated-sources"/>
+        <copy todir="${ROYALE_HOME}/frameworks/js/generated-sources">
+            <fileset dir="${basedir}/target/generated-sources/royale">
+                <include name="**/**" />
+            </fileset>
+        </copy>
+    </target>
+    
+    <target name="check-compiler" depends="check-compiler-home, check-transpiler-home">
+        <path id="lib.path">
+            <fileset dir="${ROYALE_COMPILER_HOME}/lib" includes="compiler-royaleTasks.jar"/>
+        </path>
+        <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+    </target>
+    
+    <target name="check-compiler-home" unless="ROYALE_SWF_COMPILER_HOME"
+        description="Check ROYALE_SWF_COMPILER_HOME is a directory.">
+        
+        <echo message="ROYALE_SWF_COMPILER_HOME is ${env.ROYALE_SWF_COMPILER_HOME}"/>
+        
+        <available file="${env.ROYALE_SWF_COMPILER_HOME}/lib/compiler-mxmlc.jar"
+        type="file"
+        property="ROYALE_SWF_COMPILER_HOME"
+        value="${env.ROYALE_SWF_COMPILER_HOME}"/>
+        
+        <available file="${ROYALE_HOME}/../royale-compiler/compiler/lib/compiler-mxmlc.jar"
+        type="file"
+        property="ROYALE_SWF_COMPILER_HOME"
+        value="${ROYALE_HOME}/../royale-compiler/compiler"/>
+        
+        <fail message="ROYALE_SWF_COMPILER_HOME must be set to a folder with a lib sub-folder containing compiler-mxmlc.jar such as the compiler folder in royale-compiler repo or a Royale SDK folder"
+        unless="ROYALE_SWF_COMPILER_HOME"/>
+    </target>
+    
+    <target name="check-transpiler-home" unless="ROYALE_COMPILER_HOME"
+        description="Check ROYALE_SWF_COMPILER_HOME is a directory.">
+        
+        <echo message="ROYALE_COMPILER_HOME is ${env.ROYALE_COMPILER_HOME}"/>
+        
+        <available file="${env.ROYALE_COMPILER_HOME}/lib/jsc.jar"
+        type="file"
+        property="ROYALE_COMPILER_HOME"
+        value="${env.ROYALE_COMPILER_HOME}"/>
+        
+        <available file="${ROYALE_HOME}/../royale-compiler/compiler-jx/lib/jsc.jar"
+        type="file"
+        property="ROYALE_COMPILER_HOME"
+        value="${ROYALE_HOME}/../royale-compiler/compiler-jx"/>
+        
+        <fail message="ROYALE_COMPILER_HOME must be set to a folder with a lib sub-folder containing jsc.jar such as the compiler-jx folder in royale-compiler repo or the js folder of a Royale SDK"
+        unless="ROYALE_COMPILER_HOME"/>
+    </target>
+    
+</project>
diff --git a/frameworks/js/projects/IconsJS/src/main/config/compile-js-config.xml b/frameworks/js/projects/IconsJS/src/main/config/compile-js-config.xml
new file mode 100644
index 0000000..8984685
--- /dev/null
+++ b/frameworks/js/projects/IconsJS/src/main/config/compile-js-config.xml
@@ -0,0 +1,96 @@
+<!--
+
+  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.
+
+-->
+<royale-config>
+
+    <compiler>
+        <accessible>false</accessible>
+        
+        <!-- build both SWF and JS. -->
+        <targets>
+            <target>SWF</target>
+            <target>JSRoyale</target>
+        </targets>
+        <strict-xml>true</strict-xml>
+
+		<mxml>
+			<children-as-data>true</children-as-data>
+		</mxml>
+		<binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event>
+		<binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind>
+		<binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+        <define>
+            <name>COMPILE::SWF</name>
+            <value>false</value>
+        </define>
+        <define>
+            <name>COMPILE::JS</name>
+            <value>true</value>
+        </define>
+
+        <keep-as3-metadata>
+          <name>Bindable</name>
+          <name>Managed</name>
+          <name>ChangeEvent</name>
+          <name>NonCommittingChangeEvent</name>
+          <name>Transient</name>
+        </keep-as3-metadata>
+	  
+        <locale/>
+        
+        <!-- overwrite the default library-path setting -->
+        <library-path>
+            <path-element>../../../../../../../js/libs/GCL.swc</path-element>
+            <!-- asjscompc won't 'link' these classes in, but will list their requires
+                 if these swcs are on the external-library-path then their requires
+                 will not be listed -->
+            <path-element>../../../../../libs/CoreJS.swc</path-element>
+            <path-element>../../../../../libs/ReflectionJS.swc</path-element>
+        </library-path>
+        
+        <namespaces>
+            <namespace>
+                <uri>library://ns.apache.org/royale/basic</uri>
+                <manifest>../../../../../../projects/Network/src/main/resources/basic-manifest.xml</manifest>
+            </namespace>
+        </namespaces>
+        
+        <source-path>
+            <path-element>../../../../../../projects/Icons/src/main/royale</path-element>
+        </source-path>
+        
+        <warn-no-constructor>false</warn-no-constructor>
+    </compiler>
+    
+    <include-file>
+    </include-file>
+
+    <include-sources>
+    </include-sources>
+    
+    <include-classes>
+        <class>IconsClasses</class>
+    </include-classes>
+    
+    <include-namespaces>
+        <uri>library://ns.apache.org/royale/basic</uri>
+    </include-namespaces>
+        
+
+</royale-config>
diff --git a/frameworks/projects/Icons/pom.xml b/frameworks/projects/Icons/pom.xml
index 1e869b3..fa4b888 100644
--- a/frameworks/projects/Icons/pom.xml
+++ b/frameworks/projects/Icons/pom.xml
@@ -86,20 +86,6 @@
       <type>swc</type>
       <classifier>js</classifier>
     </dependency>
-    <dependency>
-      <groupId>org.apache.royale.framework</groupId>
-      <artifactId>Binding</artifactId>
-      <version>0.9.3-SNAPSHOT</version>
-      <type>swc</type>
-      <classifier>swf</classifier>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.royale.framework</groupId>
-      <artifactId>Binding</artifactId>
-      <version>0.9.3-SNAPSHOT</version>
-      <type>swc</type>
-      <classifier>js</classifier>
-    </dependency>
   </dependencies>
 
 </project>