flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - - Replaced the not working archetype for flexjs libraries with a new implementation
Date Wed, 08 Feb 2017 16:42:44 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 82b692096 -> 7829f4cb7


- Replaced the not working archetype for flexjs libraries with a new implementation


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7829f4cb
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7829f4cb
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7829f4cb

Branch: refs/heads/develop
Commit: 7829f4cb74fdc36663267da0f4fcb0d75d0fd984
Parents: 82b6920
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Wed Feb 8 17:42:37 2017 +0100
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Wed Feb 8 17:42:37 2017 +0100

----------------------------------------------------------------------
 .../flexjs-simple-library-archetype/pom.xml     | 31 ++++++++--
 .../META-INF/maven/archetype-metadata.xml       | 37 ++++++++++++
 .../main/resources/META-INF/maven/archetype.xml | 30 ----------
 .../main/resources/archetype-resources/pom.xml  | 60 +++++++++++++++++++-
 .../src/main/flex/MylibClasses.as               | 44 ++++++++++++++
 .../flex/org/example/flexjs/mylib/FlashClass.as | 30 ++++++++++
 .../org/example/flexjs/mylib/UniversalClass.as  | 43 ++++++++++++++
 .../src/main/resources/mylib-manifest.xml       | 27 +++++++++
 8 files changed, 263 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/pom.xml b/archetypes/flexjs-simple-library-archetype/pom.xml
index 714a8dc..173e06e 100644
--- a/archetypes/flexjs-simple-library-archetype/pom.xml
+++ b/archetypes/flexjs-simple-library-archetype/pom.xml
@@ -28,9 +28,28 @@
 
   <artifactId>flexjs-simple-library-archetype</artifactId>
   <version>0.8.0-SNAPSHOT</version>
-  <packaging>jar</packaging>
-
-  <name>Apache Flex - FlexJS: Framework: Archetypes: Library</name>
-  <description>Maven archetype for creating flexjs maven project for building a library</description>
-
-</project>
\ No newline at end of file
+  <packaging>maven-archetype</packaging>
+
+  <name>Apache Flex - FlexJS: Framework: Archetypes: Simple FlexJS Library</name>
+  <description>Maven archetype for creating FlexJS Maven project for building a simple
FlexJS library.</description>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.archetype</groupId>
+        <artifactId>archetype-packaging</artifactId>
+        <version>2.4</version>
+      </extension>
+    </extensions>
+
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <artifactId>maven-archetype-plugin</artifactId>
+          <version>2.4</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
b/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..53a158b
--- /dev/null
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+  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.
+
+-->
+<archetype-descriptor xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0
http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="Core"
+    xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <fileSets>
+    <fileSet filtered="true" encoding="UTF-8">
+      <directory>src/main/resources</directory>
+      <includes>
+        <include>**/*.xml</include>
+      </includes>
+    </fileSet>
+    <fileSet encoding="UTF-8">
+      <directory>src/main/flex</directory>
+      <includes>
+        <include>**/*.as</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype.xml
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype.xml
b/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype.xml
deleted file mode 100644
index 561c04e..0000000
--- a/archetypes/flexjs-simple-library-archetype/src/main/resources/META-INF/maven/archetype.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-  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.
-
--->
-<archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0"
-           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-           xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0
http://maven.apache.org/xsd/archetype-1.0.0.xsd">
-  <id>flexjs-simple-library-archetype</id>
-  <resources>
-    <resource>src/main/java/App.java</resource>
-  </resources>
-  <testResources>
-    <resource>src/test/java/AppTest.java</resource>
-  </testResources>
-</archetype>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/pom.xml
b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/pom.xml
index 4d55544..7184b9d 100644
--- a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/pom.xml
@@ -1,3 +1,4 @@
+#set( $symbol_dollar = '$' )
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
@@ -20,14 +21,67 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
   <modelVersion>4.0.0</modelVersion>
 
-  <groupId>${groupId}</groupId>
   <artifactId>${artifactId}</artifactId>
+  <groupId>${groupId}</groupId>
   <version>${version}</version>
-  <packaging>jar</packaging>
+  <packaging>swc</packaging>
+
+  <build>
+    <sourceDirectory>src/main/flex</sourceDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.flex.flexjs.compiler</groupId>
+        <artifactId>flexjs-maven-plugin</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <extensions>true</extensions>
+        <configuration>
+          <namespaces>
+            <!-- Make the classes listed in the manifest be available under the given
namespace -->
+            <namespace>
+              <uri>library://ns.apache.org/flexjs/mylib</uri>
+              <manifest>${symbol_dollar}{project.basedir}/src/main/resources/mylib-manifest.xml</manifest>
+            </namespace>
+          </namespaces>
+          <!-- Tell the compiler which classes to compile and include -->
+          <includeClasses>
+            <includeClass>MylibClasses</includeClass>
+          </includeClasses>
+          <skipExtern>false</skipExtern>
+          <allowSubclassOverrides>true</allowSubclassOverrides>
+        </configuration>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.flex.flexjs.compiler</groupId>
+            <artifactId>compiler-jx</artifactId>
+            <version>0.8.0-SNAPSHOT</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
 
   <dependencies>
+    <!-- For flash compilation, we need the airglobal or playerglobal -->
+    <dependency>
+      <groupId>com.adobe.air.framework</groupId>
+      <artifactId>airglobal</artifactId>
+      <version>20.0</version>
+      <type>swc</type>
+      <scope>provided</scope>
+    </dependency>
+    <!-- For JavaScript compilation, we need some other base classes -->
+    <dependency>
+      <groupId>org.apache.flex.flexjs.typedefs</groupId>
+      <artifactId>flexjs-typedefs-gcl</artifactId>
+      <version>0.8.0-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>typedefs</classifier>
+    </dependency>
+
+    <!-- Add dependencies you might be needing here -->
   </dependencies>
 
-</project>
\ No newline at end of file
+</project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/MylibClasses.as
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/MylibClasses.as
b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/MylibClasses.as
new file mode 100644
index 0000000..71208e3
--- /dev/null
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/MylibClasses.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+
+/**
+ *  @private
+ *  This class is used to link additional classes into rpc.swc
+ *  beyond those that are found by dependency analysis starting
+ *  from the classes specified in manifest.xml.
+ */
+internal class MylibClasses
+{
+    import org.example.flexjs.mylib.UniversalClass; UniversalClass;
+
+	COMPILE::SWF
+	{
+        import org.example.flexjs.mylib.FlashClass; FlashClass;
+	}
+
+	COMPILE::JS
+	{
+        import org.example.flexjs.mylib.JavaScriptClass; JavaScriptClass;
+	}
+
+}
+
+}
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/FlashClass.as
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/FlashClass.as
b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/FlashClass.as
new file mode 100644
index 0000000..0aaf075
--- /dev/null
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/FlashClass.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.example.flexjs.mylib {
+
+public class FlashClass
+{
+
+    public function flashMethod():void {
+        // Do nothing in flash
+    }
+
+}
+}
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/UniversalClass.as
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/UniversalClass.as
b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/UniversalClass.as
new file mode 100644
index 0000000..12b6005
--- /dev/null
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/flex/org/example/flexjs/mylib/UniversalClass.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.example.flexjs.mylib {
+
+public class UniversalClass
+{
+
+	public function universalMethod():void {
+		// Do nothing in all target platforms
+	}
+
+    COMPILE::SWF
+    {
+        public function flashMethod():void {
+            // Do nothing in flash
+        }
+    }
+    COMPILE::JS
+    {
+        public function javaScriptMethod():void {
+            // Do nothing in JavaScript
+        }
+    }
+
+}
+}
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7829f4cb/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/resources/mylib-manifest.xml
----------------------------------------------------------------------
diff --git a/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/resources/mylib-manifest.xml
b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/resources/mylib-manifest.xml
new file mode 100644
index 0000000..b59832d
--- /dev/null
+++ b/archetypes/flexjs-simple-library-archetype/src/main/resources/archetype-resources/src/main/resources/mylib-manifest.xml
@@ -0,0 +1,27 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?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.
+
+-->
+<componentPackage>
+
+    <component id="UniversalClass" class="org.example.flexjs.mylib.UniversalClass"/>
+
+</componentPackage>


Mime
View raw message